Commit a00158cb authored by echel0n's avatar echel0n

Merge branch 'release/9.4.26'

parents 8760819d 78c64b17
# Changelog
- * 9c6cc9e - 2018-11-10: Release v9.4.25
- * 0ff8c3f - 2018-11-10: Release v9.4.26
- * 9e4dc5f - 2018-11-10: Fixed issue with file browser and clicking on files not properly choosing file and closing browser dialog.
- * 0972ec5 - 2018-11-10: Removed restoring of application ID from backup/restore functions
- * 9cf70c3 - 2018-11-10: Release v9.4.25
- * af3348b - 2018-11-10: Refactored misc logging errors to warnings.
- * 73acd71 - 2018-11-09: Release v9.4.24
- * ede2f85 - 2018-11-09: Added threaded event queue. Fixed duplicate notifications.
......
......@@ -45,7 +45,6 @@ import rarfile
import requests
import six
from bs4 import BeautifulSoup
from configobj import ConfigObj
import sickrage
from sickrage.core.common import Quality, SKIPPED, WANTED, FAILED, UNAIRED
......@@ -904,7 +903,7 @@ def extract_zipfile(archive, targetDir):
zip_file.close()
return True
except Exception as e:
sickrage.app.log.error("Zip extraction error: %r " % repr(e))
sickrage.app.log.warning("Zip extraction error: %r " % repr(e))
return False
......@@ -924,12 +923,11 @@ def create_zipfile(fileList, archive, arcname=None):
z.write(f, os.path.relpath(f, arcname))
return True
except Exception as e:
sickrage.app.log.error("Zip creation error: {} ".format(e))
sickrage.app.log.warning("Zip creation error: {} ".format(e))
return False
def restoreConfigZip(archive, targetDir, restore_appid=True, restore_database=True, restore_config=True,
restore_cache=True):
def restoreConfigZip(archive, targetDir, restore_database=True, restore_config=True, restore_cache=True):
"""
Restores a backup ZIP file back in place
......@@ -938,6 +936,9 @@ def restoreConfigZip(archive, targetDir, restore_appid=True, restore_database=Tr
:return: True on success, False on failure
"""
if not os.path.isfile(archive):
return
try:
if not os.path.exists(targetDir):
os.mkdir(targetDir)
......@@ -962,15 +963,9 @@ def restoreConfigZip(archive, targetDir, restore_appid=True, restore_database=Tr
zip_file.extract(member, targetDir)
if restore_config and not restore_appid:
cfg = ConfigObj(os.path.join(targetDir, 'config.ini'), indent_type=' ', encoding='utf8')
if 'app_id' in cfg['General']:
del cfg['General']['app_id']
cfg.write()
return True
except Exception as e:
sickrage.app.log.error("Zip extraction error: {}".format(e))
sickrage.app.log.warning("Zip extraction error: {}".format(e))
shutil.rmtree(targetDir)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3905,19 +3905,18 @@ class ConfigBackupRestore(Config):
return finalResult
@staticmethod
def restore(backupFile=None, restore_appid=None, restore_database=None, restore_config=None, restore_cache=None):
def restore(backupFile=None, restore_database=None, restore_config=None, restore_cache=None):
finalResult = ''
if backupFile:
source = backupFile
target_dir = os.path.join(sickrage.app.data_dir, 'restore')
restore_appid = checkbox_to_value(restore_appid)
restore_database = checkbox_to_value(restore_database)
restore_config = checkbox_to_value(restore_config)
restore_cache = checkbox_to_value(restore_cache)
if restoreConfigZip(source, target_dir, restore_appid, restore_database, restore_config, restore_cache):
if restoreConfigZip(source, target_dir, restore_database, restore_config, restore_cache):
finalResult += _("Successfully extracted restore files to " + target_dir)
finalResult += _("<br>Restart sickrage to complete the restore.")
else:
......
......@@ -66,15 +66,6 @@
<br/>
<div class="form-row">
<div class="col-md-12">
<label for="restore_appid">
<input type="checkbox" class="toggle color-primary is-material" name="restore_appid" id="restore_appid" checked/>
${_('Restore application id (requires restoring config)')}
</label>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<label for="restore_database">
......
9.4.25
\ No newline at end of file
9.4.26
\ No newline at end of file
......@@ -855,7 +855,7 @@ $(document).ready(function ($) {
link = $('<a href="javascript:void(0)">').on('click', function () {
if (entry.isFile) {
SICKRAGE.browser.currentBrowserPath = entry.path;
$('.browserDialog .ui-button:contains("Ok")').click();
SICKRAGE.browser.fileBrowserDialog.find('.modal-footer .btn-success').click();
} else {
SICKRAGE.browser.browse(entry.path, endpoint, includeFiles, fileTypes);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment