Skip to content

Commit

Permalink
Fix issue with deleting, force browsing for TV episodes only at this …
Browse files Browse the repository at this point in the history
…stage
  • Loading branch information
bossanova808 committed Nov 7, 2024
1 parent 20687ae commit bfd0a2f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
30 changes: 16 additions & 14 deletions resources/lib/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ def onPlaybackFinished():
switchback_playback = HOME_WINDOW.getProperty('Switchback')
HOME_WINDOW.clearProperty('Switchback')
if switchback_playback == 'true':
Logger.debug("Force browsing to library location of just finished playback")
if Store.current_playback.type == "episode":
Logger.debug("Force browsing to tvshow/season/ of just finished playback")
command = json.dumps({
"jsonrpc": "2.0",
"id": 1,
Expand All @@ -187,22 +187,24 @@ def onPlaybackFinished():
"window": "videos",
# DBID is used here, not the expected TvShowDBID as I can't seem to get that infolabel set for a Switchback playback??
# See switchback_plugin.py - 'dbid': playback.dbid if playback.type != 'episode' else playback.tvshowdbid,
"parameters": [f'videodb://tvshows/titles/{Store.current_playback.dbid}/{Store.current_playback.season}', 'return'],
"parameters": [f'videodb://tvshows/titles/{Store.current_playback.dbid}/{Store.current_playback.season}'],
}
})
send_kodi_json(f'Browse to episode of {Store.current_playback.showtitle}', command)
elif Store.current_playback.type == "movie":
Logger.debug("%%% HERE!")
command = json.dumps({
"jsonrpc": "2.0",
"id": 1,
"method": "GUI.ActivateWindow",
"params": {
"window": "videos",
"parameters": [f'videodb://movies/titles/{Store.current_playback.dbid}', 'return'],
}
})
send_kodi_json(f'Browse to movie {Store.current_playback.title}', command)
# @TODO - is is possible to force Kodi to browse to a particular movie?
# (i.e. a particular movie focussed within the movies list)
# elif Store.current_playback.type == "movie":
# Logger.debug("Force browsing to movie of just finished playback")
# command = json.dumps({
# "jsonrpc": "2.0",
# "id": 1,
# "method": "GUI.ActivateWindow",
# "params": {
# "window": "videos",
# "parameters": [f'videodb://movies/titles/', 'return'],
# }
# })
# send_kodi_json(f'Browse to movie {Store.current_playback.title}', command)

Logger.debug(Store.switchback_list)

Expand Down
2 changes: 1 addition & 1 deletion resources/lib/switchback_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def create_kodi_list_item_from_playback(playback, index=None, offscreen=False):

# index can be zero, so in this case, must explicitly check against None!
if index is not None:
list_item.addContextMenuItems([(LANGUAGE(32004), "RunPlugin(plugin://script.switchback?mode=delete&index=" + str(index) + ")")])
list_item.addContextMenuItems([(LANGUAGE(32004), "RunPlugin(plugin://plugin.switchback?mode=delete&index=" + str(index) + ")")])

return list_item

Expand Down

0 comments on commit bfd0a2f

Please sign in to comment.