Viperinius / jellyfin-plugin-spotify-import

Import playlists from Spotify in Jellyfin
GNU General Public License v3.0
35 stars 2 forks source link

current import doesn't work for usernames with special chars #14

Closed n3amil closed 11 months ago

n3amil commented 11 months ago

the current regex in https://github.com/Viperinius/jellyfin-plugin-spotify-import/blob/master/Viperinius.Plugin.SpotifyImport/Configuration/playlistConfig.js#L296

does not allow special characters in the username (mine has underscores). This results in the username not being sent to the server and stored with the configuration. After "Save" and page reload the rows remain empty.

I checked the spotify registration, seems like they don't limit the username in any way. I think the better approach might be to check for the 3 currently allowed username formats and just match the parts we know and strip them instead of a regex? if string contains spotify.com/user -> strip everything until "...spotify.com/user/", remaining part is the username if string contains spotify:user: -> strip that, remaining part is the username else: its just the username. This would circumvent the whole "valid URL" regex mess and fiddling the username out of the URL.