Commit 0972ec50 authored by echel0n's avatar echel0n

Removed restoring of application ID from backup/restore functions

parent 2cfa68ae
# Changelog
- * 9c6cc9e - 2018-11-10: Release v9.4.25
- * bce57f6 - 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
......@@ -928,8 +927,7 @@ def create_zipfile(fileList, archive, arcname=None):
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
......@@ -962,12 +960,6 @@ 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))
......
......@@ -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">
......
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