Skip to content

Commit

Permalink
fix opensubsonic date, and locale detection
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Dec 24, 2024
1 parent ff3b1ad commit 774bd99
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions backend/mediaprovider/subsonic/subsonicmediaprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ func fillAlbum(subAlbum *subsonic.AlbumID3, album *mediaprovider.Album) {
album.Date = mediaprovider.ItemDate{
Year: ord.Year,
Month: ord.Month,
Day: ord.Date,
Day: ord.Day,
}
} else {
album.Date.Year = &subAlbum.Year
Expand All @@ -594,7 +594,7 @@ func fillAlbum(subAlbum *subsonic.AlbumID3, album *mediaprovider.Album) {
album.ReissueDate = mediaprovider.ItemDate{
Year: rd.Year,
Month: rd.Month,
Day: rd.Date,
Day: rd.Day,
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/pelletier/go-toml/v2 v2.0.8
github.com/quarckster/go-mpris-server v1.0.3
github.com/supersonic-app/go-mpv v0.1.0
github.com/supersonic-app/go-subsonic v0.0.0-20241017150725-a5686988ef9c
github.com/supersonic-app/go-subsonic v0.0.0-20241224013245-9b2841f3711d
github.com/zalando/go-keyring v0.2.1
golang.org/x/net v0.25.0
golang.org/x/text v0.16.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/supersonic-app/go-mpv v0.1.0 h1:U+cCnLQxmpqx5mY6nMlC0J4uIdCCXUbAjpjS04XkFu8=
github.com/supersonic-app/go-mpv v0.1.0/go.mod h1:1bQz6kBQumJopXEbkiqoLxIXLy7F7yWFBvknvpAtIC0=
github.com/supersonic-app/go-subsonic v0.0.0-20241017150725-a5686988ef9c h1:UsXe5/TXViPgw21zO2Fgh0F/hSl0TXox0yjRc+vT6XQ=
github.com/supersonic-app/go-subsonic v0.0.0-20241017150725-a5686988ef9c/go.mod h1:D+OWPXeD9owcdcoXATv5YPBGWxxVvn5k98rt5B4wMc4=
github.com/supersonic-app/go-subsonic v0.0.0-20241224013245-9b2841f3711d h1:70+Nn7yh+cfeKqqXVTdpneFqXuvrBLyP7U6GVUsjTU4=
github.com/supersonic-app/go-subsonic v0.0.0-20241224013245-9b2841f3711d/go.mod h1:D+OWPXeD9owcdcoXATv5YPBGWxxVvn5k98rt5B4wMc4=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
4 changes: 2 additions & 2 deletions ui/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const (

func dateFormatForLocale(locale string) DateFormat {
var region string
if i := strings.Index(locale, "-"); i > 0 {
region = locale[i+1:]
if i := strings.Index(locale, "-"); i > 0 && len(locale) >= 5 {
region = locale[i+1 : i+3]
}
switch strings.ToUpper(region) {
case "US":
Expand Down

0 comments on commit 774bd99

Please sign in to comment.