Skip to content

Commit

Permalink
Added seson and episode display on remote side for tvshows
Browse files Browse the repository at this point in the history
  • Loading branch information
albaintor committed May 24, 2024
1 parent 3dfbcac commit ec8ec19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion intg-kodi/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ async def on_device_disconnected(device_id: str):
)
elif configured_entity.entity_type == ucapi.EntityTypes.REMOTE:
api.configured_entities.update_attributes(
entity_id, {ucapi.media_player.Attributes.STATE: ucapi.remote.States.UNAVAILABLE}
entity_id, {ucapi.remote.Attributes.STATE: ucapi.remote.States.UNAVAILABLE}
)

# TODO #20 when multiple devices are supported, the device state logic isn't that simple anymore!
Expand Down
8 changes: 8 additions & 0 deletions intg-kodi/kodi.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,16 @@ async def _update_states(self) -> None:
self._media_title = media_title
updated_data[MediaAttr.MEDIA_TITLE] = self._media_title
artists = self._item.get("artist")
season: int|None= self._item.get("season")
episode: int|None = self._item.get("episode")
if artists and len(artists) > 0:
media_artist = artists[0]
elif (season and season > 0) or (episode and episode > 0):
media_artist = ""
if season and season > 0:
media_artist = "S"+str(season)
if episode and episode > 0:
media_artist += "E"+str(episode)
else:
media_artist = ""
if media_artist != self._media_artist:
Expand Down

0 comments on commit ec8ec19

Please sign in to comment.