Test Fix Torrent
This commit is contained in:
@@ -1495,20 +1495,17 @@ def play_torrent(item, xlistitem, mediaurl):
|
|||||||
torr_client = torrent_options[selection][0]
|
torr_client = torrent_options[selection][0]
|
||||||
|
|
||||||
if torr_client in ['elementum'] and item.infoLabels['tmdb_id']:
|
if torr_client in ['elementum'] and item.infoLabels['tmdb_id']:
|
||||||
import xbmcaddon
|
|
||||||
addon = xbmcaddon.Addon(id='plugin.video.elementum')
|
|
||||||
if addon.getSetting('download_storage') != '1':
|
|
||||||
addon.setSetting('download_storage', '1')
|
|
||||||
xbmc.sleep(2000)
|
|
||||||
if item.contentType == 'episode' and "elementum" not in torr_client:
|
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':
|
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:
|
if torr_client in ['elementum'] and item.downloadFilename:
|
||||||
torrent.elementum_download(item)
|
torrent.elementum_download(item)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
# import xbmcaddon
|
||||||
|
# xbmcaddon.Addon(id='plugin.video.elementum').setSetting('download_storage', '1')
|
||||||
if (item.fromLibrary and item.play_from == 'window') or item.window:
|
if (item.fromLibrary and item.play_from == 'window') or item.window:
|
||||||
xlistitem.setPath(torrent_options[selection][1] % mediaurl)
|
xlistitem.setPath(torrent_options[selection][1] % mediaurl)
|
||||||
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||||
@@ -1517,7 +1514,7 @@ def play_torrent(item, xlistitem, mediaurl):
|
|||||||
xbmc_player.play(playlist, xlistitem)
|
xbmc_player.play(playlist, xlistitem)
|
||||||
else:
|
else:
|
||||||
if not item.autoplay and item.channel != 'videolibrary': fakeVideo()
|
if not item.autoplay and item.channel != 'videolibrary': fakeVideo()
|
||||||
if xbmc.getCondVisibility("system.platform.android"): xbmc.sleep(300)
|
if xbmc.getCondVisibility("system.platform.android"): xbmc.sleep(3000)
|
||||||
xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
|
xbmc.executebuiltin("PlayMedia(" + torrent_options[selection][1] % mediaurl + ")")
|
||||||
|
|
||||||
# torrent.mark_auto_as_watched(item)
|
# torrent.mark_auto_as_watched(item)
|
||||||
@@ -1827,13 +1824,15 @@ def set_played_time(item):
|
|||||||
del db['viewed'][ID]
|
del db['viewed'][ID]
|
||||||
|
|
||||||
|
|
||||||
def prevent_busy():
|
def prevent_busy(item=None):
|
||||||
xbmc.executebuiltin('Dialog.Close(all,true)')
|
if item and (not item.autoplay and item.channel != 'videolibrary' and not item.window):
|
||||||
|
fakeVideo()
|
||||||
|
else:
|
||||||
|
xbmc.executebuiltin('Dialog.Close(all,true)')
|
||||||
|
|
||||||
|
|
||||||
def fakeVideo():
|
def fakeVideo():
|
||||||
xbmc_player.play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))
|
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4")))
|
||||||
# xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4")))
|
|
||||||
while not is_playing():
|
while not is_playing():
|
||||||
xbmc.sleep(10)
|
xbmc.sleep(10)
|
||||||
if xbmc.getCondVisibility("system.platform.android"):
|
if xbmc.getCondVisibility("system.platform.android"):
|
||||||
|
|||||||
+6
-3
@@ -165,7 +165,7 @@ def monitor_update(TorrentPath, value, remove=False):
|
|||||||
jsontools.dump(json)
|
jsontools.dump(json)
|
||||||
filetools.write(monitor, jsontools.dump(json), silent=True)
|
filetools.write(monitor, jsontools.dump(json), silent=True)
|
||||||
|
|
||||||
if len(Monitor) == 0: set_elementum()
|
set_elementum()
|
||||||
|
|
||||||
|
|
||||||
def set_elementum(SET=False):
|
def set_elementum(SET=False):
|
||||||
@@ -174,12 +174,14 @@ def set_elementum(SET=False):
|
|||||||
backup_setting = json['settings']
|
backup_setting = json['settings']
|
||||||
write = False
|
write = False
|
||||||
if SET:
|
if SET:
|
||||||
|
elementum_setting.setSetting('logger_silent', 'true')
|
||||||
|
elementum_setting.setSetting('download_storage', '0')
|
||||||
if elementum_setting.getSetting('logger_silent') == False or not 'logger_silent' in backup_setting:
|
if elementum_setting.getSetting('logger_silent') == False or not 'logger_silent' in backup_setting:
|
||||||
elementum_setting.setSetting('logger_silent', 'true')
|
elementum_setting.setSetting('logger_silent', 'true')
|
||||||
backup_setting['logger_silent'] = 'false'
|
backup_setting['logger_silent'] = 'false'
|
||||||
|
|
||||||
if elementum_setting.getSetting('download_storage') != 0 or not 'download_storage' in backup_setting:
|
if elementum_setting.getSetting('download_storage') != 0 or not 'download_storage' in backup_setting:
|
||||||
backup_setting['download_storage'] = elementum_setting.getSetting('download_storage') # Backup Setting
|
# backup_setting['download_storage'] = elementum_setting.getSetting('download_storage') # Backup Setting
|
||||||
elementum_setting.setSetting('download_storage', '0') # Set Setting
|
elementum_setting.setSetting('download_storage', '0') # Set Setting
|
||||||
|
|
||||||
if elementum_setting.getSetting('download_path') != config.get_setting('downloadpath') or not 'download_path' in backup_setting:
|
if elementum_setting.getSetting('download_path') != config.get_setting('downloadpath') or not 'download_path' in backup_setting:
|
||||||
@@ -188,8 +190,9 @@ def set_elementum(SET=False):
|
|||||||
write = True
|
write = True
|
||||||
|
|
||||||
elif backup_setting:
|
elif backup_setting:
|
||||||
|
elementum_setting.setSetting('download_storage', '1')
|
||||||
elementum_setting.setSetting('logger_silent', backup_setting['logger_silent'])
|
elementum_setting.setSetting('logger_silent', backup_setting['logger_silent'])
|
||||||
elementum_setting.setSetting('download_storage', backup_setting['download_storage'])
|
# elementum_setting.setSetting('download_storage', backup_setting['download_storage'])
|
||||||
elementum_setting.setSetting('download_path', backup_setting['download_path'])
|
elementum_setting.setSetting('download_path', backup_setting['download_path'])
|
||||||
json['settings'] = {}
|
json['settings'] = {}
|
||||||
write = True
|
write = True
|
||||||
|
|||||||
Reference in New Issue
Block a user