From: Clinton Ebadi Date: Sun, 18 Apr 2021 17:27:28 +0000 (-0400) Subject: party-upload: use song.title if it exists X-Git-Url: https://git.hcoop.net/clinton/unknownlamer-kodi-addons.git/commitdiff_plain/60f1621b3acec3e5432f5a29f7f1f77f6b6d5711 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. --- 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'''