From 60f1621b3acec3e5432f5a29f7f1f77f6b6d5711 Mon Sep 17 00:00:00 2001 From: Clinton Ebadi Date: Sun, 18 Apr 2021 13:27:28 -0400 Subject: [PATCH] party-upload: use song.title if it exists song.label has been changed at some point to be the full text in the playlist and not just the song title, grab the song title and use it if available, falling back to the playlist label if needed. --- party-upload/partyparty.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/party-upload/partyparty.py b/party-upload/partyparty.py index 98d8f9f..4ecfd1c 100644 --- a/party-upload/partyparty.py +++ b/party-upload/partyparty.py @@ -37,7 +37,7 @@ def connect (_kodi): kodi = _kodi return kodi -SONG_PROPERTIES = ['album', 'artist', 'albumartist', 'dateadded', 'userrating', 'displayartist'] +SONG_PROPERTIES = ['album', 'artist', 'albumartist', 'title', 'dateadded', 'userrating', 'displayartist'] PAGE_SELF = os.environ['SCRIPT_NAME'] if 'SCRIPT_NAME' in os.environ else '' class Song: @@ -83,7 +83,10 @@ class Song: else: self.rating = -1 # might be better to use None here - self.label = song['label'] + if 'title' in song and len(song['title']) > 0: + self.label = song['title'] + else: + self.label = song['label'] def songs(items): '''Convert list of Kodi Items into Song instances''' -- 2.20.1