Merge pull request #351 from hagaygo/fix-youtube-addon-call

Fix youtube addon call for trailer playback
This commit is contained in:
mcarlton00 2024-10-25 19:59:51 -04:00 committed by GitHub
commit 29151d837a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -945,7 +945,10 @@ def play_action(params):
def play_item_trailer(item_id):
log.debug("== ENTER: playTrailer ==")
handle = int(sys.argv[1]) if sys.argv and len(sys.argv) > 1 else -1
if handle != -1:
xbmcplugin.endOfDirectory(handle, succeeded=False, updateListing=False, cacheToDisc=False)
url = "/Users/{}/Items/{}/LocalTrailers?format=json".format(
user_details.get('user_id'), item_id
)
@ -1021,7 +1024,7 @@ def play_item_trailer(item_id):
elif trailer.get("type") == "remote":
youtube_id = trailer.get("url").rsplit('=', 1)[1]
url_root = "plugin.video.youtube/play/?video_id="
play_url = "RunPlugin(plugin://{}{})".format(url_root, youtube_id)
play_url = "PlayMedia(plugin://{}{})".format(url_root, youtube_id)
log.debug("youtube_plugin: {0}".format(play_url))
xbmc.executebuiltin(play_url)