party-upload: use song.title if it exists
authorClinton Ebadi <clinton@unknownlamer.org>
Sun, 18 Apr 2021 17:27:28 +0000 (13:27 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Sun, 18 Apr 2021 17:27:28 +0000 (13:27 -0400)
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

index 98d8f9f..4ecfd1c 100644 (file)
@@ -37,7 +37,7 @@ def connect (_kodi):
     kodi = _kodi
     return 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:
 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
 
       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'''
 
 def songs(items):
    '''Convert list of Kodi Items into Song instances'''