diff --git a/CHANGES.md b/CHANGES.md
index f600616..ae53469 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,4 +1,11 @@
-### 0.21.30 (2020-04-30 10:20:00 UTC)
+### 0.21.31 (2020-05-13 19:10:00 UTC)
+
+* Fix correct type for hashlib call under py3
+* Change improve loading logic, stop loop when reloading and only call location.reload(); once
+* Fix RarBG under py3
+
+
+### 0.21.30 (2020-04-30 10:20:00 UTC)
* Fix Milkie torrent provider breaking changes
diff --git a/gui/slick/js/loadingStartup.js b/gui/slick/js/loadingStartup.js
index 06e1b95..9233053 100644
--- a/gui/slick/js/loadingStartup.js
+++ b/gui/slick/js/loadingStartup.js
@@ -12,6 +12,8 @@ var baseUrl = function () {
return $.SickGear.Root;
};
+var reloading = false
+
var ajaxConsumer = function () {
var that = this;
that.timeoutId = 0;
@@ -29,7 +31,8 @@ var ajaxConsumer = function () {
uiUpdateComplete(data.message);
})
.fail(function (jqXHR, textStatus, errorThrown) {
- if (404 === jqXHR.status) {
+ if (404 === jqXHR.status && !reloading) {
+ reloading = true;
putMsg('Finished loading. Reloading page');
location.reload();
}
@@ -37,10 +40,12 @@ var ajaxConsumer = function () {
})
.always(function (jqXHR, textStatus) {
clearTimeout(that.timeoutId);
- if (that.pollInterval)
- that.timeoutId = setTimeout(ajaxConsumer.checkLoadNotifications, that.pollInterval);
- logInfo(that.pollInterval ? '^-- ' + that.pollInterval/1000 + 's to next work' : '^-- no more work');
- logInfo('====');
+ if (!reloading){
+ if (that.pollInterval)
+ that.timeoutId = setTimeout(ajaxConsumer.checkLoadNotifications, that.pollInterval);
+ logInfo(that.pollInterval ? '^-- ' + that.pollInterval/1000 + 's to next work' : '^-- no more work');
+ logInfo('====');
+ }
});
}
};
diff --git a/sickbeard/providers/generic.py b/sickbeard/providers/generic.py
index eecbe6e..79c5c8c 100644
--- a/sickbeard/providers/generic.py
+++ b/sickbeard/providers/generic.py
@@ -1768,7 +1768,8 @@ class TorrentProvider(GenericProvider):
@staticmethod
def _decode(data, c):
try:
- result = ''.join([chr(int(str(bytearray([(8 * c)[i] ^ x for i, x in enumerate(data)])[i:i + 2]), 16))
+ fx = (lambda x: x, lambda x: str(x))[PY2]
+ result = ''.join([chr(int(fx(bytearray([(8 * c)[i] ^ x for i, x in enumerate(data)])[i:i + 2]), 16))
for i in range(0, len(data), 2)])
except (BaseException, Exception):
result = '|'
diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py
index 6249449..21df587 100644
--- a/sickbeard/webserve.py
+++ b/sickbeard/webserve.py
@@ -1359,7 +1359,7 @@ class Home(MainHandler):
:param tvid_prodid:
:type tvid_prodid:
:param season:
- :type season:
+ :type season:
:param episode:
:type episode:
:param absolute:
@@ -1985,8 +1985,8 @@ class Home(MainHandler):
last_found = ('', ' since %s' % SGDatetime.fromordinal(
show_obj.last_found_on_indexer).sbfdate())[1 < show_obj.last_found_on_indexer]
show_message = (
- 'The master ID of this show has been abandoned%s, ' % last_found +
+ 'The master ID of this show has been abandoned%s, ' % last_found +
'replace it here'
% (sickbeard.WEB_ROOT, tvid_prodid, show_obj.prodid)
+ ('', '
%s' % show_message)[0 < len(show_message)])
@@ -6203,7 +6203,7 @@ class ConfigGeneral(Config):
# Create some values to seed md5
seed = str(time.time()) + str(random.random())
- result = hashlib.new('md5', seed).hexdigest()
+ result = hashlib.new('md5', decode_bytes(seed)).hexdigest()
# Return a hex digest of the md5, eg 49f68a5c8493ec2c0bf489821c21fc3b
logger.log(u'New API generated')
@@ -6515,7 +6515,7 @@ class ConfigSearch(Config):
sab_username=None, sab_password=None, sab_apikey=None, sab_category=None, sab_host=None,
nzbget_username=None, nzbget_password=None, nzbget_category=None, nzbget_host=None,
nzbget_use_https=None, nzbget_priority=None, nzbget_parent_map=None,
- torrent_username=None, torrent_password=None, torrent_label=None, torrent_label_var=None,
+ torrent_username=None, torrent_password=None, torrent_label=None, torrent_label_var=None,
torrent_verify_cert=None, torrent_path=None, torrent_seed_time=None, torrent_paused=None,
torrent_high_bandwidth=None, torrent_host=None):