#782 for Jellyfin: treat usernames as case-insensitive

This commit is contained in:
Drew Weymouth
2026-01-24 11:05:12 -08:00
parent 8e2e4c6d89
commit e6127ccc11
5 changed files with 57 additions and 50 deletions
+8 -1
View File
@@ -12,6 +12,7 @@ import (
"fyne.io/fyne/v2/widget"
"github.com/deluan/sanitize"
"github.com/dweymouth/supersonic/backend/mediaprovider"
"github.com/dweymouth/supersonic/backend/mediaprovider/jellyfin"
"github.com/dweymouth/supersonic/sharedutil"
"github.com/dweymouth/supersonic/ui/util"
)
@@ -49,7 +50,13 @@ func (sp *SelectPlaylist) fetchUserOwnedPlaylists() {
log.Printf("error getting playlists: %s", err.Error())
}
userPlaylists := sharedutil.FilterSlice(playlists, func(playlist *mediaprovider.Playlist) bool {
return playlist.Owner == sp.loggedInUser
if _, isJellyfin := sp.mp.(*jellyfin.JellyfinMediaProvider); isJellyfin {
// Jellyfin usernames are case-insensitive
return strings.EqualFold(playlist.Owner, sp.loggedInUser)
} else {
// Subsonic usernames are case-sensitive
return playlist.Owner == sp.loggedInUser
}
})
sp.allPlaylistResuts = sharedutil.MapSlice(userPlaylists, sp.playlistToSearchResult)
}