Commit 4f28f10e authored by echel0n's avatar echel0n

Merge branch 'release/9.4.27'

parents a00158cb c5ea143e
......@@ -229,6 +229,7 @@ module.exports = function (grunt) {
grunt.log.writeln(('Packaging Pre-Release v' + newVersion).magenta);
const tasks = [
'changelog',
'webpack:dev',
'sync_trans', // sync translations with crowdin
'exec:git_commit:Pre-Release v' + newVersion,
......@@ -265,8 +266,9 @@ module.exports = function (grunt) {
grunt.log.writeln(('Packaging Release v' + newVersion).magenta);
const tasks = [
'changelog',
'webpack:prod',
//'sync_trans', // sync translations with crowdin
'sync_trans', // sync translations with crowdin
'exec:git_commit:Release v' + newVersion,
'exec:git_flow_release_start:' + newVersion,
'exec:git_flow_release_finish:' + newVersion + ':Release v' + newVersion,
......
# Changelog
- * 0ff8c3f - 2018-11-10: Release v9.4.26
- * 38e0115 - 2018-11-10: Release v9.4.27
- * 0f190e0 - 2018-11-10: Added function to check database index data integrity and rebuild if failed
- * 7c31b0c - 2018-11-10: Fixed issue for missing database indexes.
- * 3f20cdd - 2018-11-10: Refactored misc errors to warnings.
- * 4127ed3 - 2018-11-10: Refactored misc errors to warnings.
- * 78c64b1 - 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
......
grunt changelog
\ No newline at end of file
......@@ -316,8 +316,7 @@ def main():
# start app
app.start()
except (SystemExit, KeyboardInterrupt):
if app:
app.shutdown()
if app: app.shutdown()
except ImportError:
traceback.print_exc()
if os.path.isfile(REQS_FILE):
......
......@@ -136,7 +136,7 @@ def codeDescription(status_code):
if status_code in http_error_code:
return http_error_code[status_code]
else:
sickrage.app.log.error("Unknown error code: %s. Please submit an issue" % status_code)
sickrage.app.log.warning("Unknown error code: %s. Please submit an issue" % status_code)
return 'unknown'
......
......@@ -2423,7 +2423,7 @@ class ConfigMigrator(Config):
"""
if current_version > expected_version:
sickrage.app.log.error("Your config version (%i) has been incremented past what this version of supports "
sickrage.app.log.warning("Your config version (%i) has been incremented past what this version of supports "
"(%i). If you have used other forks or a newer version of your config file may be "
"unusable due to their modifications." % (current_version,
expected_version)
......
......@@ -225,15 +225,35 @@ class srDatabase(object):
def check_integrity(self):
for index_name in self._indexes:
try:
for x in self.db.all(index_name):
try:
self.get('id', x.get('_id'))
except (ValueError, TypeError) as e:
self.delete(self.get(index_name, x.get('key')))
except Exception as e:
if index_name in self.db.indexes_names:
self.db.destroy_index(self.db.indexes_names[index_name])
sickrage.app.log.debug('Checking data integrity for index {}'.format(index_name))
data = []
failed = False
# check integrity of index data
for x in self.db.all(index_name):
try:
data += [self.get('id', x.get('_id'))]
except Exception:
failed = True
# check if we failed integrity check, if so then destroy index
if failed and index_name in self.db.indexes_names:
self.db.destroy_index(self.db.indexes_names[index_name])
# check if index exists, if not then add it
if index_name not in self.db.indexes_names:
self.db.add_index(self._indexes[index_name](self.db.path, index_name))
# rebuild index if failed
if failed:
sickrage.app.log.debug('Failed data integrity check, rebuilding index {}'.format(index_name))
for x in data:
del x['_id'], x['_rev']
self.insert(x)
# cleanup
del data
def migrate(self):
if os.path.isfile(self.old_db_path):
......
......@@ -553,7 +553,7 @@ def make_dirs(path):
sickrage.app.log.debug("Folder %s didn't exist, creating it" % path)
os.makedirs(path)
except (OSError, IOError) as e:
sickrage.app.log.error("Failed creating %s : %r" % (path, e))
sickrage.app.log.warning("Failed creating %s : %r" % (path, e))
return False
# not Windows, create all missing folders and set permissions
......
......@@ -56,7 +56,7 @@ def getSeasonNZBs(name, urlData, season):
if sceneNameMatch:
showName, qualitySection, groupName = sceneNameMatch.groups()
else:
sickrage.app.log.error("Unable to parse " + name + " into a scene name. If it's a valid one log a bug.")
sickrage.app.log.error("Unable to parse " + name + " into a scene name. If it's a valid, log a bug.")
return {}, ''
regex = '(' + re.escape(showName) + '\.S%02d(?:[E0-9]+)\.[\w\._]+\-\w+' % season + ')'
......@@ -107,7 +107,7 @@ def saveNZB(nzbName, nzbString):
nzb_fh.write(nzbString)
except EnvironmentError as e:
sickrage.app.log.error("Unable to save NZB: {}".format(e))
sickrage.app.log.warning("Unable to save NZB: {}".format(e))
def stripNS(element, ns):
......
......@@ -73,8 +73,7 @@ def snatchEpisode(result, endStatus=SNATCHED):
is_proper = True if endStatus == SNATCHED_PROPER else False
dlResult = NZBGet.sendNZB(result, is_proper)
else:
sickrage.app.log.error(
"Unknown NZB action specified in config: " + sickrage.app.config.nzb_method)
sickrage.app.log.error("Unknown NZB action specified in config: " + sickrage.app.config.nzb_method)
elif result.resultType in ("torrent", "torznab"):
# add public trackers to torrent result
if not result.provider.private:
......@@ -381,8 +380,7 @@ def searchProviders(show, episodes, manualSearch=False, downCurQuality=False, up
sickrage.app.log.warning("Authentication error: {}".format(e))
break
except Exception as e:
sickrage.app.log.error(
"Error while searching " + providerObj.name + ", skipping: {}".format(e))
sickrage.app.log.error("Error while searching " + providerObj.name + ", skipping: {}".format(e))
break
finally:
threading.currentThread().setName(origThreadName)
......
......@@ -526,7 +526,7 @@ class TVEpisode(object):
# early conversion to int so that episode doesn't get marked dirty
self.indexerid = try_int(safe_getattr(myEp, 'id'), self.indexerid)
if self.indexerid is None:
sickrage.app.log.error("Failed to retrieve ID from " + IndexerApi(self.indexer).name)
sickrage.app.log.warning("Failed to retrieve ID from " + IndexerApi(self.indexer).name)
if self.indexerid != -1:
self.deleteEpisode()
return False
......@@ -606,7 +606,7 @@ class TVEpisode(object):
try:
os.rename(nfoFile, nfoFile + ".old")
except Exception as e:
sickrage.app.log.error(
sickrage.app.log.warning(
"Failed to rename your episode's NFO file - you need to delete it or fix it: {}".format(e))
raise NoNFOException("Error in NFO format")
......@@ -902,14 +902,14 @@ class TVEpisode(object):
cur_result = self.rename_ep_file(cur_related_file, proper_related_path,
absolute_current_path_no_ext_length + len(subfolder))
if not cur_result:
sickrage.app.log.error(str(self.indexerid) + ": Unable to rename file " + cur_related_file)
sickrage.app.log.warning(str(self.indexerid) + ": Unable to rename file " + cur_related_file)
for cur_related_sub in related_subs:
absolute_proper_subs_path = os.path.join(sickrage.app.config.subtitles_dir, self.formatted_filename())
cur_result = self.rename_ep_file(cur_related_sub, absolute_proper_subs_path,
absolute_current_path_no_ext_length)
if not cur_result:
sickrage.app.log.error(str(self.indexerid) + ": Unable to rename file " + cur_related_sub)
sickrage.app.log.warning(str(self.indexerid) + ": Unable to rename file " + cur_related_sub)
# save the ep
with self.lock:
......@@ -1392,7 +1392,7 @@ class TVEpisode(object):
sickrage.app.log.info("Renaming file from %s to %s" % (cur_path, new_path))
moveFile(cur_path, new_path)
except (OSError, IOError) as e:
sickrage.app.log.error("Failed renaming %s to %s : %r" % (cur_path, new_path, e))
sickrage.app.log.warning("Failed renaming %s to %s : %r" % (cur_path, new_path, e))
return False
# clean up any old folders that are empty
......
......@@ -522,7 +522,7 @@ class TVShow(object):
"Found episode by absolute_number %s which is S%02dE%02d" % (
absolute_number, season or 0, episode or 0))
elif len(dbData) > 1:
sickrage.app.log.error("Multiple entries for absolute number: " + str(
sickrage.app.log.warning("Multiple entries for absolute number: " + str(
absolute_number) + " in show: " + self.name + " found ")
return None
else:
......@@ -818,8 +818,7 @@ class TVShow(object):
try:
curEp = self.getEpisode(season, episode, filename)
except EpisodeNotFoundException:
sickrage.app.log.error(
str(self.indexerid) + ": Unable to figure out what this file is, skipping")
sickrage.app.log.error("{}: Unable to figure out what this file is, skipping".format(self.indexerid))
continue
else:
......@@ -1212,9 +1211,8 @@ class TVShow(object):
episode.downloadSubtitles()
except Exception:
sickrage.app.log.debug(
sickrage.app.log.error(
"%s: Error occurred when downloading subtitles for %s" % (self.indexerid, self.name))
sickrage.app.log.error(traceback.format_exc())
def saveToDB(self, force_save=False):
if not self.dirty and not force_save:
......
......@@ -404,8 +404,7 @@ class ApiCall(ApiHandler):
elif arg_type == "ignore":
pass
else:
sickrage.app.log.error(
'Invalid param type: "{}" can not be checked. Ignoring it.'.format(str(arg_type)))
sickrage.app.log.error('Invalid param type: "{}" can not be checked. Ignoring it.'.format(str(arg_type)))
if error:
# this is a real ApiError !!
......
......@@ -3928,6 +3928,9 @@ class ConfigBackupRestore(Config):
return finalResult
def saveBackupRestore(self, **kwargs):
return self.redirect("/config/backuprestore/")
@Route('/config/search(/?.*)')
class ConfigSearch(Config):
......
<%inherit file="../layouts/config.mako"/>
<%def name='formaction()'><% return 'backuprestore' %></%def>
<%def name='formaction()'><% return 'saveBackupRestore' %></%def>
<%block name="menus">
<li class="nav-item px-1"><a class="nav-link" data-toggle="tab" href="#backup">${_('Backup')}</a></li>
<li class="nav-item px-1"><a class="nav-link" data-toggle="tab" href="#restore">${_('Restore')}</a></li>
......
This diff is collapsed.
......@@ -383,7 +383,7 @@ class GenericMetadata(object):
chmodAsParent(nfo_file_path)
except IOError as e:
sickrage.app.log.error(
sickrage.app.log.warning(
"Unable to write file to " + nfo_file_path + " - are you sure the folder is writable? {}".format(e))
return False
......@@ -427,7 +427,7 @@ class GenericMetadata(object):
chmodAsParent(nfo_file_path)
except IOError as e:
sickrage.app.log.error(
sickrage.app.log.warning(
"Unable to write file to " + nfo_file_path + " - are you sure the folder is writable? {}".format(e))
return False
......@@ -610,7 +610,7 @@ class GenericMetadata(object):
chmodAsParent(image_path)
except IOError as e:
sickrage.app.log.error(
sickrage.app.log.warning(
"Unable to write image to " + image_path + " - are you sure the show folder is writable? {}".format(e))
return False
......@@ -650,7 +650,7 @@ class GenericMetadata(object):
return None
if image_type not in ('fanart', 'poster', 'series', 'poster_thumb', 'series_thumb'):
sickrage.app.log.error(
sickrage.app.log.warning(
"Invalid image type " + str(image_type) + ", couldn't find it in the " + IndexerApi(
show_obj.indexer).name + " object")
return
......
......@@ -424,7 +424,7 @@ class Mede8erMetadata(MediaBrowserMetadata):
nfo_file.close()
chmodAsParent(nfo_file_path)
except IOError as e:
sickrage.app.log.error(
sickrage.app.log.warning(
"Unable to write file to " + nfo_file_path + " - are you sure the folder is writable? {}".format(e))
return False
......
......@@ -323,7 +323,7 @@ class TIVOMetadata(GenericMetadata):
chmodAsParent(nfo_file_path)
except EnvironmentError as e:
sickrage.app.log.error(
sickrage.app.log.warning(
"Unable to write file to " + nfo_file_path + " - are you sure the folder is writable? {}".format(e))
return False
......
......@@ -48,7 +48,7 @@ class IPTorrentsProvider(TorrentProvider):
self.custom_url = ""
self.cache = TVCache(self)
self.cache = TVCache(self, min_time=10)
def login(self):
return self.cookie_login('sign in')
......@@ -117,9 +117,13 @@ class IPTorrentsProvider(TorrentProvider):
seeders = int(torrent.find('td', attrs={'class': 'ac t_seeders'}).text)
leechers = int(torrent.find('td', attrs={'class': 'ac t_leechers'}).text)
results += [
{'title': title, 'link': download_url, 'size': size, 'seeders': seeders, 'leechers': leechers}
]
results += [{
'title': title,
'link': download_url,
'size': size,
'seeders': seeders,
'leechers': leechers
}]
if mode != 'RSS':
sickrage.app.log.debug("Found result: {}".format(title))
......
......@@ -227,7 +227,7 @@ def get_subtitles_path(video_path):
new_subtitles_path = os.path.join(os.path.dirname(video_path), sickrage.app.config.subtitles_dir)
dir_exists = makeDir(new_subtitles_path)
if not dir_exists:
sickrage.app.log.error('Unable to create subtitles folder {}'.format(new_subtitles_path))
sickrage.app.log.warning('Unable to create subtitles folder {}'.format(new_subtitles_path))
else:
chmodAsParent(new_subtitles_path)
else:
......
9.4.26
\ No newline at end of file
9.4.27
\ No newline at end of file
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