Skip to content

Commit

Permalink
Merge pull request #105 from Angelinas1/patch-4
Browse files Browse the repository at this point in the history
fix for pvr.radio
  • Loading branch information
marcelveldt committed Nov 16, 2017
2 parents f6fbd2c + 24195fc commit 1bc5aad
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions resources/lib/kodi_monitor.py
Expand Up @@ -67,6 +67,11 @@ def onNotification(self, sender, method, data):
self.monitor_radiostream()
else:
self.set_music_properties()
if getCondVisibility("Pvr.IsPlayingRadio"):
if getCondVisibility("!Player.IsInternetStream"):
self.monitor_radiostream()
else:
self.set_music_properties()
elif getCondVisibility("VideoPlayer.Content(livetv) | String.StartsWith(Player.FileNameAndPath,pvr://)"):
self.monitor_livetv()
else:
Expand Down Expand Up @@ -223,6 +228,14 @@ def set_music_properties(self):
li_title = li_title.split(splitchar)[1].strip()
break

# fix for pvr.radio
if not li_artist and getCondVisibility("Pvr.IsPlayingRadio"):
for splitchar in [" - ", "-", ":", ";"]:
if splitchar in li_title:
li_artist = li_title.split(splitchar)[0].strip()
li_title = li_title.split(splitchar)[1].strip()
break

if getCondVisibility("Skin.HasSetting(SkinHelper.EnableMusicArt)") and li_artist and(
li_title or li_album):
result = self.metadatautils.get_music_artwork(li_artist, li_album, li_title, li_disc)
Expand Down Expand Up @@ -300,9 +313,9 @@ def get_mediatype():
'''get current content type'''
if getCondVisibility("VideoPlayer.Content(movies)"):
mediatype = "movie"
elif getCondVisibility("VideoPlayer.Content(episodes) | !IsEmpty(VideoPlayer.TvShowTitle)"):
elif getCondVisibility("VideoPlayer.Content(episodes) | !String.IsEmpty(VideoPlayer.TvShowTitle)"):
mediatype = "episode"
elif xbmc.getInfoLabel("VideoPlayer.Content(musicvideos) | !IsEmpty(VideoPlayer.Artist)"):
elif xbmc.getInfoLabel("VideoPlayer.Content(musicvideos) | !String.IsEmpty(VideoPlayer.Artist)"):
mediatype = "musicvideo"
else:
mediatype = "file"
Expand Down

0 comments on commit 1bc5aad

Please sign in to comment.