Commit 01711ebe authored by echel0n's avatar echel0n
Browse files

Merge branch 'release/9.3.69'

parents d3507edb e93f949d
# Changelog
- * 14eb31c - 2018-09-04: Release v9.3.68
- * 39f81c5 - 2018-09-05: Release v9.3.69
- * 3f84dd7 - 2018-09-05: Added main database function to sync tv episodes to index
- * 51f6fb2 - 2018-09-04: Release v9.3.68
- * 78d23e1 - 2018-09-04: Added 'tv_episodes_by_indexerid' database index. Added database test case. Fixed TV episode database upsert code. Misc variable name cleanup.
- * c11dace - 2018-09-01: Release v9.3.67
- * 1430717 - 2018-09-01: Fixed issue #255 - total episode count incorrect. Improved memory usage from database calls. Misc code cleanup.
......
......@@ -264,7 +264,7 @@ class Core(object):
db.upgrade()
# compact main database
if not self.developer and self.config.last_db_compact < time.time() - 604800: # 7 days
if self.config.last_db_compact < time.time() - 604800: # 7 days
self.main_db.compact()
self.config.last_db_compact = int(time.time())
......
......@@ -24,8 +24,7 @@ import sickrage
from sickrage.core.databases import srDatabase
from sickrage.core.databases.main.index import MainTVShowsIndex, MainTVEpisodesIndex, MainIMDBInfoIndex, \
MainXEMRefreshIndex, MainSceneNumberingIndex, MainIndexerMappingIndex, MainHistoryIndex, \
MainBlacklistIndex, MainWhitelistIndex, MainFailedSnatchHistoryIndex, MainFailedSnatchesIndex, MainVersionIndex, \
MainTVEpisodesByIndexerIDIndex
MainBlacklistIndex, MainWhitelistIndex, MainFailedSnatchHistoryIndex, MainFailedSnatchesIndex, MainVersionIndex
class MainDB(srDatabase):
......@@ -35,7 +34,6 @@ class MainDB(srDatabase):
'version': MainVersionIndex,
'tv_shows': MainTVShowsIndex,
'tv_episodes': MainTVEpisodesIndex,
'tv_episodes_by_indexerid': MainTVEpisodesByIndexerIDIndex,
'imdb_info': MainIMDBInfoIndex,
'xem_refresh': MainXEMRefreshIndex,
'scene_numbering': MainSceneNumberingIndex,
......@@ -176,4 +174,4 @@ class MainDB(srDatabase):
for ep in self.all('tv_episodes'):
if not self.get('tv_shows', ep['showid']):
sickrage.app.log.info("Deleting orphan episode with id: {}".format(ep["indexerid"]))
self.delete(ep)
self.delete(ep)
\ No newline at end of file
......@@ -68,21 +68,6 @@ class MainTVEpisodesIndex(HashIndex):
return data.get('showid'), None
class MainTVEpisodesByIndexerIDIndex(HashIndex):
_version = 1
def __init__(self, *args, **kwargs):
kwargs['key_format'] = 'I'
super(MainTVEpisodesByIndexerIDIndex, self).__init__(*args, **kwargs)
def make_key(self, key):
return key
def make_key_value(self, data):
if data.get('_t') == 'tv_episodes' and data.get('indexerid'):
return data.get('indexerid'), None
class MainIMDBInfoIndex(HashIndex):
_version = 1
......
......@@ -34,9 +34,8 @@ def new_episode_finder():
else:
curDate += datetime.timedelta(days=2)
curTime = datetime.datetime.now(sickrage.app.tz)
show = None
curTime = datetime.datetime.now(sickrage.app.tz)
for episode in sickrage.app.main_db.all('tv_episodes'):
if not all([episode['status'] == UNAIRED, episode['season'] > 0, episode['airdate'] > 1]):
......@@ -76,6 +75,5 @@ def new_episode_finder():
ep_obj.saveToDB()
def get_backlog_cycle_time():
return max([sickrage.app.config.daily_searcher_freq * 4, 30])
\ No newline at end of file
......@@ -775,9 +775,12 @@ class TVEpisode(object):
}
try:
dbData = sickrage.app.main_db.get('tv_episodes_by_indexerid', self.indexerid)
dbData.update(tv_episode)
sickrage.app.main_db.update(dbData)
for x in sickrage.app.main_db.get_many('tv_episodes', self.show.indexerid):
if x['indexerid'] == self.indexerid:
x.update(tv_episode)
sickrage.app.main_db.update(x)
return
raise RecordNotFound
except RecordNotFound:
sickrage.app.main_db.insert(tv_episode)
......
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2018-09-04 22:06-0700\n"
"PO-Revision-Date: 2018-09-05 05:06\n"
"POT-Creation-Date: 2018-09-05 01:02-0700\n"
"PO-Revision-Date: 2018-09-05 08:02\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: Arabic\n"
"MIME-Version: 1.0\n"
......
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2018-09-04 22:06-0700\n"
"PO-Revision-Date: 2018-09-05 05:06\n"
"POT-Creation-Date: 2018-09-05 01:02-0700\n"
"PO-Revision-Date: 2018-09-05 08:02\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: Catalan\n"
"MIME-Version: 1.0\n"
......
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2018-09-04 22:06-0700\n"
"PO-Revision-Date: 2018-09-05 05:06\n"
"POT-Creation-Date: 2018-09-05 01:02-0700\n"
"PO-Revision-Date: 2018-09-05 08:02\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: Czech\n"
"MIME-Version: 1.0\n"
......
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2018-09-04 22:06-0700\n"
"PO-Revision-Date: 2018-09-05 05:06\n"
"POT-Creation-Date: 2018-09-05 01:02-0700\n"
"PO-Revision-Date: 2018-09-05 08:02\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: Danish\n"
"MIME-Version: 1.0\n"
......
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2018-09-04 22:06-0700\n"
"PO-Revision-Date: 2018-09-05 05:07\n"
"POT-Creation-Date: 2018-09-05 01:02-0700\n"
"PO-Revision-Date: 2018-09-05 08:03\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
......
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2018-09-04 22:06-0700\n"
"PO-Revision-Date: 2018-09-05 05:07\n"
"POT-Creation-Date: 2018-09-05 01:02-0700\n"
"PO-Revision-Date: 2018-09-05 08:03\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: Greek\n"
"MIME-Version: 1.0\n"
......
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: sickragetv\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2018-09-04 22:06-0700\n"
"PO-Revision-Date: 2018-09-05 05:07\n"
"POT-Creation-Date: 2018-09-05 01:02-0700\n"
"PO-Revision-Date: 2018-09-05 08:02\n"
"Last-Translator: echel0n <[email protected]>\n"
"Language-Team: English\n"
"MIME-Version: 1.0\n"
......
Supports Markdown
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