fix opensubsonic date, and locale detection

This commit is contained in:
Drew Weymouth
2024-12-23 17:39:57 -08:00
parent ff3b1addf8
commit 774bd996fc
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -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":