feat: refactor add_jellyfin_user_to_playlist to use internal method for user assignment

This commit is contained in:
Kamil
2024-12-11 14:15:28 +00:00
parent 67d2b3cb9e
commit a44c5b5209

View File

@@ -506,6 +506,10 @@ def remove_jellyfin_user_from_playlist():
def add_jellyfin_user_to_playlist():
playlist_id = request.args.get('playlist')
user_id = request.args.get('user')
return add_jellyfin_user_to_playlist_internal(user_id, playlist_id)
def add_jellyfin_user_to_playlist_internal(user_id, playlist_id):
# assign this playlist also to the user in the database
# get the playlist from the db
playlist = Playlist.query.filter_by(jellyfin_id=playlist_id).first()