Merge remote-tracking branch 'origin/master'

This commit is contained in:
marco
2021-11-21 13:34:37 +01:00
5 changed files with 43 additions and 33 deletions

View File

@@ -1496,26 +1496,33 @@ def play_torrent(item, xlistitem, mediaurl):
if torr_client in ['elementum'] and item.infoLabels['tmdb_id']:
if item.contentType == 'episode' and "elementum" not in torr_client:
mediaurl += "&episode=%s&library=&season=%s&show=%s&tmdb=%s&type=episode" % (item.infoLabels['episode'], item.infoLabels['season'], item.infoLabels['tmdb_id'], item.infoLabels['tmdb_id'])
mediaurl += "&episode=%s&season=%s&show=%s&tmdb=%s&type=episode" % (item.infoLabels['episode'], item.infoLabels['season'], item.infoLabels['tmdb_id'], item.infoLabels['tmdb_id'])
elif item.contentType == 'movie':
mediaurl += "&library=&tmdb=%s&type=movie" % (item.infoLabels['tmdb_id'])
mediaurl += "&tmdb=%s&type=movie" % (item.infoLabels['tmdb_id'])
if torr_client in ['elementum'] and item.downloadFilename:
torrent.elementum_download(item)
else:
import xbmcaddon
xbmcaddon.Addon(id='plugin.video.elementum').setSetting('download_storage', '1')
if (item.fromLibrary and item.play_from == 'window') or item.window:
xlistitem.setPath(torrent_options[selection][1] % mediaurl)
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
playlist.clear()
playlist.add(torrent_options[selection][1] % mediaurl, xlistitem)
xbmc_player.play(playlist, xlistitem)
else:
if not item.autoplay and item.channel != 'videolibrary': fakeVideo()
if xbmc.getCondVisibility("system.platform.android"): xbmc.sleep(3000)
xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
addon = xbmcaddon.Addon(id='plugin.video.elementum')
# from core.support import dbg;dbg()
if addon.getSetting('download_storage') == '0':
addon.setSetting('download_storage', '1')
xbmc.sleep(3000)
xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
# import xbmcaddon
# xbmcaddon.Addon(id='plugin.video.elementum').setSetting('download_storage', '1')
# if (item.fromLibrary and item.play_from == 'window') or item.window:
# xlistitem.setPath(torrent_options[selection][1] % mediaurl)
# playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
# playlist.clear()
# playlist.add(torrent_options[selection][1] % mediaurl, xlistitem)
# xbmc_player.play(playlist, xlistitem)
# else:
# if not item.autoplay and item.channel != 'videolibrary': fakeVideo()
# if xbmc.getCondVisibility("system.platform.android"): xbmc.sleep(3000)
# xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
# torrent.mark_auto_as_watched(item)