library_move di default e cancellazione json a download completo

This commit is contained in:
marco
2020-04-15 14:06:50 +02:00
parent 20d66e020a
commit a728fab273
2 changed files with 7 additions and 3 deletions

View File

@@ -97,7 +97,7 @@
<setting id="downloadlistpath" type="folder" label="30018" visible="eq(-2,true)" default="special://profile/addon_data/plugin.video.kod/downloads/list/" option="writeable"/>
<!-- <setting id="library_add" type="bool" label="70230" default="false"/>
<setting id="library_move" type="bool" label="70231" default="false" visible="eq(-1,true)" subsetting="true"/> -->
<setting id="library_move" type="bool" label="70231" visible="eq(-3,true)" default="false"/>
<setting id="library_move" type="bool" label="70231" visible="eq(-3,true)" default="true"/>
<setting id="settings_kod1" type="action" label="70789" action="" visible="eq(-4,true)"/>
<setting id="browser" type="bool" label="70232" visible="eq(-5,true)" default="true"/>
<setting id="server_speed" type="bool" label="70242" visible="eq(-6,true)" default="true"/>

View File

@@ -669,7 +669,7 @@ def download_from_url(url, item):
save_server_statistics(item.server, d.speed[0], d.state != d.states.error)
if status == STATUS_CODES.completed and config.get_setting("library_move") == True:
if status == STATUS_CODES.completed and config.get_setting("videolibrary_kodi") and config.get_setting("library_move"):
move_to_libray(item.clone(downloadFilename=file))
return {"downloadUrl": d.download_url, "downloadStatus": status, "downloadSize": d.size[0],
@@ -860,7 +860,11 @@ def start_download(item):
# No tenemos server, necesitamos buscar el mejor
else:
ret = download_from_best_server(item)
update_json(item.path, ret)
if ret["downloadStatus"] == STATUS_CODES.completed and config.get_setting("videolibrary_kodi") and config.get_setting("library_move"):
filetools.remove(item.path)
else:
update_json(item.path, ret)
return ret["downloadStatus"]