diff --git a/CHANGES.md b/CHANGES.md index 59d46ad1..dac2809b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/sickbeard/databases/mainDB.py b/sickbeard/databases/mainDB.py index 59616b50..fe4ea879 100644 --- a/sickbeard/databases/mainDB.py +++ b/sickbeard/databases/mainDB.py @@ -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): diff --git a/sickbeard/db.py b/sickbeard/db.py index 0818f5c1..0ef25659 100644 --- a/sickbeard/db.py +++ b/sickbeard/db.py @@ -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, } diff --git a/sickbeard/tv.py b/sickbeard/tv.py index 28d8e8b4..362eac75 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -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()