Add show overview from indexers to the database

This commit is contained in:
Adam 2015-03-22 19:52:56 +08:00 committed by Supremicus
parent c1fe671a82
commit 94d0ce3e44
4 changed files with 21 additions and 3 deletions

View file

@ -74,6 +74,7 @@
* Add option to collapse seasons and leave current season open on displayShow (disabled)
* Add filesize to episode location qtip on displayShow
* Change selected options from editShow will only show when enabled now on displayShow
* Add show overview from indexers to the database
[develop changelog]
* Fix traceback error when using the menu item Manage/Update Kodi

View file

@ -27,7 +27,7 @@ from sickbeard import encodingKludge as ek
from sickbeard.name_parser.parser import NameParser, InvalidNameException, InvalidShowException
MIN_DB_VERSION = 9 # oldest db version we support migrating from
MAX_DB_VERSION = 20001
MAX_DB_VERSION = 20002
class MainSanityCheck(db.DBSanityCheck):
@ -960,6 +960,16 @@ class DBIncreaseTo20001(db.SchemaUpgrade):
return self.checkDBVersion()
class AddTvShowOverview(db.SchemaUpgrade):
def execute(self):
backup_database(self.checkDBVersion())
logger.log(u'Adding column overview to tv_shows')
self.addColumn('tv_shows', 'overview', 'TEXT', '')
self.setDBVersion(20002)
return self.checkDBVersion()
# 10001 -> 10000
class RemoveDefaultEpStatusFromTvShows(db.SchemaUpgrade):
def execute(self):

View file

@ -412,7 +412,7 @@ def MigrationCode(myDB):
10001: sickbeard.mainDB.RemoveDefaultEpStatusFromTvShows,
20000: sickbeard.mainDB.DBIncreaseTo20001,
# 20001: sickbeard.mainDB.AddCoolSickGearFeature2,
20001: sickbeard.mainDB.AddTvShowOverview,
# 20002: sickbeard.mainDB.AddCoolSickGearFeature3,
}

View file

@ -98,6 +98,7 @@ class TVShow(object):
self._scene = 0
self._rls_ignore_words = ""
self._rls_require_words = ""
self._overview = ''
self.dirty = True
@ -141,6 +142,7 @@ class TVShow(object):
scene = property(lambda self: self._scene, dirty_setter("_scene"))
rls_ignore_words = property(lambda self: self._rls_ignore_words, dirty_setter("_rls_ignore_words"))
rls_require_words = property(lambda self: self._rls_require_words, dirty_setter("_rls_require_words"))
overview = property(lambda self: self._overview, dirty_setter('_overview'))
@property
def is_anime(self):
@ -832,6 +834,9 @@ class TVShow(object):
if self.is_anime:
self.release_groups = BlackAndWhiteList(self.indexerid)
if not self.overview:
self.overview = sqlResults[0]['overview']
logger.log(str(self.indexerid) + u': Show info [%s] loaded from database' % self.name)
# Get IMDb_info from database
@ -895,6 +900,7 @@ class TVShow(object):
self.startyear = int(str(myEp["firstaired"]).split('-')[0])
self.status = getattr(myEp, 'status', '')
self.overview = getattr(myEp, 'overview', '')
def load_imdb_info(self):
@ -1184,7 +1190,8 @@ class TVShow(object):
"imdb_id": self.imdbid,
"last_update_indexer": self.last_update_indexer,
"rls_ignore_words": self.rls_ignore_words,
"rls_require_words": self.rls_require_words
'rls_require_words': self.rls_require_words,
'overview': self.overview
}
myDB = db.DBConnection()