|
|
|
#
|
|
|
|
# This file is part of SickGear.
|
|
|
|
#
|
|
|
|
# SickGear is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# SickGear is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with SickGear. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
import datetime
|
|
|
|
|
|
|
|
import sickbeard
|
|
|
|
from . import logger
|
|
|
|
from ._legacy_classes import LegacyTVShow, LegacyTVEpisode
|
|
|
|
from .common import UNKNOWN
|
|
|
|
from .name_cache import buildNameCache
|
|
|
|
|
|
|
|
from six import string_types
|
|
|
|
|
|
|
|
# noinspection PyUnreachableCode
|
|
|
|
if False:
|
|
|
|
from typing import Text
|
|
|
|
|
|
|
|
|
|
|
|
class TVBase(object):
|
|
|
|
def __init__(self):
|
|
|
|
|
|
|
|
self.dirty = True
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def dirty_setter(attr_name, types=None):
|
|
|
|
def wrapper(self, val):
|
|
|
|
if getattr(self, attr_name) != val:
|
|
|
|
if None is types or isinstance(val, types):
|
|
|
|
setattr(self, attr_name, val)
|
|
|
|
self.dirty = True
|
|
|
|
else:
|
|
|
|
logger.log('Didn\'t change property "%s" because expected: %s, but got: %s with value: %s' %
|
|
|
|
(attr_name, types, type(val), val), logger.WARNING)
|
|
|
|
|
|
|
|
return wrapper
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def dict_prevent_nonetype(d, key, default=''):
|
|
|
|
v = getattr(d, key, default)
|
|
|
|
return (v, default)[None is v]
|
|
|
|
|
|
|
|
|
|
|
|
# noinspection PyAbstractClass
|
|
|
|
class TVShowBase(LegacyTVShow, TVBase):
|
|
|
|
def __init__(self, tvid, prodid, lang=''):
|
|
|
|
# type: (int, int, Text) -> None
|
|
|
|
super(TVShowBase, self).__init__(tvid, prodid)
|
|
|
|
|
|
|
|
self._air_by_date = 0
|
|
|
|
self._airs = ''
|
|
|
|
self._anime = 0
|
|
|
|
self._classification = ''
|
|
|
|
self._dvdorder = 0
|
|
|
|
self._flatten_folders = int(sickbeard.FLATTEN_FOLDERS_DEFAULT)
|
|
|
|
self._genre = ''
|
|
|
|
self._imdb_info = {}
|
|
|
|
self._imdbid = ''
|
|
|
|
self._lang = lang
|
|
|
|
self._last_update_indexer = 1
|
|
|
|
self._name = ''
|
|
|
|
self._overview = ''
|
|
|
|
self._prune = 0
|
|
|
|
self._quality = int(sickbeard.QUALITY_DEFAULT)
|
|
|
|
self._rls_global_exclude_ignore = set()
|
|
|
|
self._rls_global_exclude_require = set()
|
|
|
|
self._rls_ignore_words = set()
|
|
|
|
self._rls_ignore_words_regex = False
|
|
|
|
self._rls_require_words = set()
|
|
|
|
self._rls_require_words_regex = False
|
|
|
|
self._runtime = 0
|
|
|
|
self._scene = 0
|
|
|
|
self._sports = 0
|
|
|
|
self._startyear = 0
|
|
|
|
self._status = ''
|
|
|
|
self._subtitles = int(sickbeard.SUBTITLES_DEFAULT) if sickbeard.SUBTITLES_DEFAULT else 0
|
|
|
|
self._tag = ''
|
|
|
|
self._upgrade_once = 0
|
|
|
|
self.internal_network = ''
|
|
|
|
|
|
|
|
# name = property(lambda self: self._name, dirty_setter('_name'))
|
|
|
|
@property
|
|
|
|
def rls_ignore_words_regex(self):
|
|
|
|
return self._rls_ignore_words_regex
|
|
|
|
|
|
|
|
@rls_ignore_words_regex.setter
|
|
|
|
def rls_ignore_words_regex(self, val):
|
|
|
|
self.dirty_setter('_rls_ignore_words_regex')(self, val)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def rls_require_words_regex(self):
|
|
|
|
return self._rls_require_words_regex
|
|
|
|
|
|
|
|
@rls_require_words_regex.setter
|
|
|
|
def rls_require_words_regex(self, val):
|
|
|
|
self.dirty_setter('_rls_require_words_regex')(self, val)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def rls_global_exclude_ignore(self):
|
|
|
|
return self._rls_global_exclude_ignore
|
|
|
|
|
|
|
|
@rls_global_exclude_ignore.setter
|
|
|
|
def rls_global_exclude_ignore(self, val):
|
|
|
|
self.dirty_setter('_rls_global_exclude_ignore', set)(self, val)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def rls_global_exclude_require(self):
|
|
|
|
return self._rls_global_exclude_require
|
|
|
|
|
|
|
|
@rls_global_exclude_require.setter
|
|
|
|
def rls_global_exclude_require(self, val):
|
|
|
|
self.dirty_setter('_rls_global_exclude_require', set)(self, val)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def name(self):
|
|
|
|
return self._name
|
|
|
|
|
|
|
|
@name.setter
|
|
|
|
def name(self, *arg):
|
|
|
|
_current_name = self._name
|
|
|
|
self.dirty_setter('_name')(self, *arg)
|
|
|
|
if _current_name != self._name:
|
|
|
|
buildNameCache(self)
|
|
|
|
|
|
|
|
# imdbid = property(lambda self: self._imdbid, dirty_setter('_imdbid'))
|
|
|
|
@property
|
|
|
|
def imdbid(self):
|
|
|
|
return self._imdbid
|
|
|
|
|
|
|
|
@imdbid.setter
|
|
|
|
def imdbid(self, *arg):
|
|
|
|
self.dirty_setter('_imdbid')(self, *arg)
|
|
|
|
|
Add support for multiple TV info sources.
Changelog
---------
Change improve loading speed of shows at startup.
Change improve main execution loop speed.
Add force cast update to view show page.
Add person view.
Add character view.
Add characters, person to clean-up cache (30 days).
Add reload person, character images every 7 days.
Add suppress UI notification for scheduled people updates during show updates and during switching ids.
Add resume support of switched shows after restart that switched id but not finished updating.
Add failed TV info switches to show tasks page.
Add remove item from queue and clear queue test buttons to mange/show-tasks and manage/search-tasks.
Change improve show update logic.
Add to view-show page a notification message if a show fails to switch.
Add check for existing show with new id pair before switching.
Change prioritize first episode start year over the start year set at the tv info source.
Change delete non existing episodes when switching indexer.
Change "exists in db" link on search results page to support any info source.
Add TMDB person pics as fallback.
Add use person fallback for character images.
Add logic to add start, end year in case of multiple characters per person.
Change improve speed getting list in the import view.
Add abort people cast update when show is deleted, also remove show from any queued show item or search item
Support list of names to search for in show search.
Change assist user search terms when the actual title of a show is unknown.
Add support URLs in search.
Change remove year from search term ... year is still used for relevancy order.
Add updating show.nfo when a cast changes.
Change use longest biography available for output.
Add UI requests of details for feb 28 will also return feb 29 in years without feb 29.
Add fetch extra data fallback from TMDB for persons.
technical commit messages (combined commits)
--------------------------------------------
Add tmdb get_trending, get_popular, get_top_rated, discover to tvinfoapi.
Add home/get_persons ajax endpoint, currently supports: birthday, deathday, names.
Change daily-schedule to new get_episode_time - More TODO
Change view-show to use get_episode_time.
Add get show updates list in show updater.
Add get_episode_time to network_timezones.
Add airtime for episode and show to get_episode_time.
Small ep obj load performance improvement.
Add handle special episodes and assign numbers based on airdate.
Add handle tvmaze specials without airdate.
Change during switch tv info source, specials are removed from db because of non-existing generic numbering.
Change add first/latest regular episode, use first_aired_regular_episode in all places that have airdate of first episode.
Add IMDb to person interface.
Add akas to person.
Add IMDb bio parser.
Add TMDB api for people.
Add character role start/end year to IMDb api and tv character.
Fix updating characters with multiple persons, by limiting to one.
Add cache to imdb_api.py.
Add cache to tmdb_api: get_person, _search_person.
Add cache to trakt get_person, _search_person cache.
Improve main execution loop speed https://stackify.com/20-simple-python-performance-tuning-tips/ point: 12
Add network to episode for tvdb_api (from show data).
Add fallback for network/timezone for tv episode to tv show.
Add skip retrieve_exceptions for tv info sources that don't have 'scene_url'.
Change move network load before show load to make sure the tvshow obj timezone can be set (startup).
Add datetime.time to/from integer to sbdatetime (hour, minute only).
Add load all indexer mapping at once from db during startup.
Add load the failed count during startup.
Change move sanitize_filename to sg_helpers.
Change move download_file to sg_helpers.
Add list_tables, list_indexes to db.py.
Add multi db column add function.
Restore backup tables during upgrade.
Use lib.tvinfo_base import everywhere.
Add new properties to tvepisode.
Add show_updates to indexer endpoint.
Add new db schema.
Add Character and Persons tables.
Add tvmaze_api lib.
Add pytvmaze lib.
Add debug __repr__ to people/show queue.
Add crew to show tvinfo_base.
Drop backup tables for now.
Don't save switch refresh, update show queue items (since they are sub queues of switch).
Remove show from switched_shows in case it is in it when deleting the show.
Use switch queue for manual switch
Load/save updated time for person/Character.
Add show_queue table.
Add _get_item_sql, _delete_item_from_db_sql to search search_queue.
Add people_queue type.
Add people scheduler.
Add people queue.
Add tvinfo source switch queue item.
Alternate naming for person/character images.
Add load and save image/thumb urls for persons.
Add load character pics.
Add save images for characters.
Add save image urls for characters to db.
Change limit for person searches to 100 instead of 10 default.
Add person verification.
Add people_url and character_url to sources that support them.
Add save castlist changes.
Add remove old characters from castlist.
Change optimize find_show_by_id.
Change improve debug info for person, character obj.
Add db_support_upsert support flag in db.py.
Add cast list objs and load from db.
Add parse and add additional images to TVInfo.
Add optional loading of images and actors/crew.
Fix _make_timestamp in py2.
Save and load _src_update_time.
Change use update time for show updates.
Add _set_network optimization.
Add src_update_timestamp to tvshow tbl.
Add updated_timestamp to TVInfoShow.
Add _indexer_update_time TVShow obj.
Add support to search for external ids on TV info sources: [TVINFO_TVDB, TVINFO_IMDb, TVINFO_TMDB, TVINFO_TRAKT].
Change show tasks page, keep remove button for failed switches always visible.
Add use get_url for tvmaze_api interface (to support failure handling), without changing original lib.
Add missing settings in switch show.
Add new switch error: TVSWITCH_ID_CONFLICT: 'new id conflicts with existing show'.
Add messages for manual switch id.
Add connection skip handling.
Add get_url failure handling to Trakt lib.
Add real search_person to tvinfo interface.
Change move TMDB api key to tmdb_api.
Add get_url usage via tmdb_api.
Change join/split of akas/join and sql group_concat to `;;;` to prevent issues with names that may contain comma (`,`).
Add Trakt api specific failure times.
Add warning about reassigning MEMCACHE
Add calc_age to sg_helpers for person page to remove dupe code.
Add return age in ajax for persons.
Change format dates on person page to honour config/General.
Add convert_to_inch_fraction_html to sg_helpers.
Change direct assign method instead of wrapper (faster).
Change force disk_pickle_protocol=2 for py2 compatibility in tvinfo cache.
Add episode rename info during switch.
Add save deleted episodes when switching tvinfo source.
Add get_switch_changed page.
Add force=True to QueueItemRefresh during switch of tvinfo to force rewriting of metadata.
Add filter character dupes in tvdb_api only take images for unique character, role combos on tvdb.
Fix humanize lib in py27.
Add diskcache to tvinfo_base.
Add doc files for diskcache lib.
Add clean tvinfo to show_updater.
Add switch_ep_errors table to sickbeard.db
Add debug log message when extra data is fetched for a person.
Change make character loading more efficient.
Add placeholder image for characters and persons.
Change start, end year moved to new extra table to support multiple person per character.
Change replace start_year, end_year with persons_years in Character class.
Add new table character_person_years, change table structure characters.
Add check if show is found for switch pages.
Add missing scheduled to cache.db people queue table.
Change trakt show search now will ignore failure handling, to make sure it's always tried when searching for shows.
Change add/improve tvmaze id cross search.
Change improve search, if only ids are given, resulting seriesnames on source will be used as text search on following tvinfo sources.
Add new parameter: prefer_person to imagecache/character endpoint.
Add if prefer_person is set and person_id is set to valid person and the character has more then 1 person assigned the character image will not be returned, instead the actors image or the placeholder.
Add only take external ids if character is confirmed in logic.
Add match name instead of person id for checking same person in show when adding cast for sources without person id (tvdb)
Add cache tmdb genres directly in dict for performance.
4 years ago
|
|
|
# network = property(lambda self: self.internal_network, dirty_setter('internal_network'))
|
|
|
|
@property
|
|
|
|
def network(self):
|
Add support for multiple TV info sources.
Changelog
---------
Change improve loading speed of shows at startup.
Change improve main execution loop speed.
Add force cast update to view show page.
Add person view.
Add character view.
Add characters, person to clean-up cache (30 days).
Add reload person, character images every 7 days.
Add suppress UI notification for scheduled people updates during show updates and during switching ids.
Add resume support of switched shows after restart that switched id but not finished updating.
Add failed TV info switches to show tasks page.
Add remove item from queue and clear queue test buttons to mange/show-tasks and manage/search-tasks.
Change improve show update logic.
Add to view-show page a notification message if a show fails to switch.
Add check for existing show with new id pair before switching.
Change prioritize first episode start year over the start year set at the tv info source.
Change delete non existing episodes when switching indexer.
Change "exists in db" link on search results page to support any info source.
Add TMDB person pics as fallback.
Add use person fallback for character images.
Add logic to add start, end year in case of multiple characters per person.
Change improve speed getting list in the import view.
Add abort people cast update when show is deleted, also remove show from any queued show item or search item
Support list of names to search for in show search.
Change assist user search terms when the actual title of a show is unknown.
Add support URLs in search.
Change remove year from search term ... year is still used for relevancy order.
Add updating show.nfo when a cast changes.
Change use longest biography available for output.
Add UI requests of details for feb 28 will also return feb 29 in years without feb 29.
Add fetch extra data fallback from TMDB for persons.
technical commit messages (combined commits)
--------------------------------------------
Add tmdb get_trending, get_popular, get_top_rated, discover to tvinfoapi.
Add home/get_persons ajax endpoint, currently supports: birthday, deathday, names.
Change daily-schedule to new get_episode_time - More TODO
Change view-show to use get_episode_time.
Add get show updates list in show updater.
Add get_episode_time to network_timezones.
Add airtime for episode and show to get_episode_time.
Small ep obj load performance improvement.
Add handle special episodes and assign numbers based on airdate.
Add handle tvmaze specials without airdate.
Change during switch tv info source, specials are removed from db because of non-existing generic numbering.
Change add first/latest regular episode, use first_aired_regular_episode in all places that have airdate of first episode.
Add IMDb to person interface.
Add akas to person.
Add IMDb bio parser.
Add TMDB api for people.
Add character role start/end year to IMDb api and tv character.
Fix updating characters with multiple persons, by limiting to one.
Add cache to imdb_api.py.
Add cache to tmdb_api: get_person, _search_person.
Add cache to trakt get_person, _search_person cache.
Improve main execution loop speed https://stackify.com/20-simple-python-performance-tuning-tips/ point: 12
Add network to episode for tvdb_api (from show data).
Add fallback for network/timezone for tv episode to tv show.
Add skip retrieve_exceptions for tv info sources that don't have 'scene_url'.
Change move network load before show load to make sure the tvshow obj timezone can be set (startup).
Add datetime.time to/from integer to sbdatetime (hour, minute only).
Add load all indexer mapping at once from db during startup.
Add load the failed count during startup.
Change move sanitize_filename to sg_helpers.
Change move download_file to sg_helpers.
Add list_tables, list_indexes to db.py.
Add multi db column add function.
Restore backup tables during upgrade.
Use lib.tvinfo_base import everywhere.
Add new properties to tvepisode.
Add show_updates to indexer endpoint.
Add new db schema.
Add Character and Persons tables.
Add tvmaze_api lib.
Add pytvmaze lib.
Add debug __repr__ to people/show queue.
Add crew to show tvinfo_base.
Drop backup tables for now.
Don't save switch refresh, update show queue items (since they are sub queues of switch).
Remove show from switched_shows in case it is in it when deleting the show.
Use switch queue for manual switch
Load/save updated time for person/Character.
Add show_queue table.
Add _get_item_sql, _delete_item_from_db_sql to search search_queue.
Add people_queue type.
Add people scheduler.
Add people queue.
Add tvinfo source switch queue item.
Alternate naming for person/character images.
Add load and save image/thumb urls for persons.
Add load character pics.
Add save images for characters.
Add save image urls for characters to db.
Change limit for person searches to 100 instead of 10 default.
Add person verification.
Add people_url and character_url to sources that support them.
Add save castlist changes.
Add remove old characters from castlist.
Change optimize find_show_by_id.
Change improve debug info for person, character obj.
Add db_support_upsert support flag in db.py.
Add cast list objs and load from db.
Add parse and add additional images to TVInfo.
Add optional loading of images and actors/crew.
Fix _make_timestamp in py2.
Save and load _src_update_time.
Change use update time for show updates.
Add _set_network optimization.
Add src_update_timestamp to tvshow tbl.
Add updated_timestamp to TVInfoShow.
Add _indexer_update_time TVShow obj.
Add support to search for external ids on TV info sources: [TVINFO_TVDB, TVINFO_IMDb, TVINFO_TMDB, TVINFO_TRAKT].
Change show tasks page, keep remove button for failed switches always visible.
Add use get_url for tvmaze_api interface (to support failure handling), without changing original lib.
Add missing settings in switch show.
Add new switch error: TVSWITCH_ID_CONFLICT: 'new id conflicts with existing show'.
Add messages for manual switch id.
Add connection skip handling.
Add get_url failure handling to Trakt lib.
Add real search_person to tvinfo interface.
Change move TMDB api key to tmdb_api.
Add get_url usage via tmdb_api.
Change join/split of akas/join and sql group_concat to `;;;` to prevent issues with names that may contain comma (`,`).
Add Trakt api specific failure times.
Add warning about reassigning MEMCACHE
Add calc_age to sg_helpers for person page to remove dupe code.
Add return age in ajax for persons.
Change format dates on person page to honour config/General.
Add convert_to_inch_fraction_html to sg_helpers.
Change direct assign method instead of wrapper (faster).
Change force disk_pickle_protocol=2 for py2 compatibility in tvinfo cache.
Add episode rename info during switch.
Add save deleted episodes when switching tvinfo source.
Add get_switch_changed page.
Add force=True to QueueItemRefresh during switch of tvinfo to force rewriting of metadata.
Add filter character dupes in tvdb_api only take images for unique character, role combos on tvdb.
Fix humanize lib in py27.
Add diskcache to tvinfo_base.
Add doc files for diskcache lib.
Add clean tvinfo to show_updater.
Add switch_ep_errors table to sickbeard.db
Add debug log message when extra data is fetched for a person.
Change make character loading more efficient.
Add placeholder image for characters and persons.
Change start, end year moved to new extra table to support multiple person per character.
Change replace start_year, end_year with persons_years in Character class.
Add new table character_person_years, change table structure characters.
Add check if show is found for switch pages.
Add missing scheduled to cache.db people queue table.
Change trakt show search now will ignore failure handling, to make sure it's always tried when searching for shows.
Change add/improve tvmaze id cross search.
Change improve search, if only ids are given, resulting seriesnames on source will be used as text search on following tvinfo sources.
Add new parameter: prefer_person to imagecache/character endpoint.
Add if prefer_person is set and person_id is set to valid person and the character has more then 1 person assigned the character image will not be returned, instead the actors image or the placeholder.
Add only take external ids if character is confirmed in logic.
Add match name instead of person id for checking same person in show when adding cast for sources without person id (tvdb)
Add cache tmdb genres directly in dict for performance.
4 years ago
|
|
|
return self.internal_network
|
|
|
|
|
|
|
|
@network.setter
|
|
|
|
def network(self, *arg):
|
Add support for multiple TV info sources.
Changelog
---------
Change improve loading speed of shows at startup.
Change improve main execution loop speed.
Add force cast update to view show page.
Add person view.
Add character view.
Add characters, person to clean-up cache (30 days).
Add reload person, character images every 7 days.
Add suppress UI notification for scheduled people updates during show updates and during switching ids.
Add resume support of switched shows after restart that switched id but not finished updating.
Add failed TV info switches to show tasks page.
Add remove item from queue and clear queue test buttons to mange/show-tasks and manage/search-tasks.
Change improve show update logic.
Add to view-show page a notification message if a show fails to switch.
Add check for existing show with new id pair before switching.
Change prioritize first episode start year over the start year set at the tv info source.
Change delete non existing episodes when switching indexer.
Change "exists in db" link on search results page to support any info source.
Add TMDB person pics as fallback.
Add use person fallback for character images.
Add logic to add start, end year in case of multiple characters per person.
Change improve speed getting list in the import view.
Add abort people cast update when show is deleted, also remove show from any queued show item or search item
Support list of names to search for in show search.
Change assist user search terms when the actual title of a show is unknown.
Add support URLs in search.
Change remove year from search term ... year is still used for relevancy order.
Add updating show.nfo when a cast changes.
Change use longest biography available for output.
Add UI requests of details for feb 28 will also return feb 29 in years without feb 29.
Add fetch extra data fallback from TMDB for persons.
technical commit messages (combined commits)
--------------------------------------------
Add tmdb get_trending, get_popular, get_top_rated, discover to tvinfoapi.
Add home/get_persons ajax endpoint, currently supports: birthday, deathday, names.
Change daily-schedule to new get_episode_time - More TODO
Change view-show to use get_episode_time.
Add get show updates list in show updater.
Add get_episode_time to network_timezones.
Add airtime for episode and show to get_episode_time.
Small ep obj load performance improvement.
Add handle special episodes and assign numbers based on airdate.
Add handle tvmaze specials without airdate.
Change during switch tv info source, specials are removed from db because of non-existing generic numbering.
Change add first/latest regular episode, use first_aired_regular_episode in all places that have airdate of first episode.
Add IMDb to person interface.
Add akas to person.
Add IMDb bio parser.
Add TMDB api for people.
Add character role start/end year to IMDb api and tv character.
Fix updating characters with multiple persons, by limiting to one.
Add cache to imdb_api.py.
Add cache to tmdb_api: get_person, _search_person.
Add cache to trakt get_person, _search_person cache.
Improve main execution loop speed https://stackify.com/20-simple-python-performance-tuning-tips/ point: 12
Add network to episode for tvdb_api (from show data).
Add fallback for network/timezone for tv episode to tv show.
Add skip retrieve_exceptions for tv info sources that don't have 'scene_url'.
Change move network load before show load to make sure the tvshow obj timezone can be set (startup).
Add datetime.time to/from integer to sbdatetime (hour, minute only).
Add load all indexer mapping at once from db during startup.
Add load the failed count during startup.
Change move sanitize_filename to sg_helpers.
Change move download_file to sg_helpers.
Add list_tables, list_indexes to db.py.
Add multi db column add function.
Restore backup tables during upgrade.
Use lib.tvinfo_base import everywhere.
Add new properties to tvepisode.
Add show_updates to indexer endpoint.
Add new db schema.
Add Character and Persons tables.
Add tvmaze_api lib.
Add pytvmaze lib.
Add debug __repr__ to people/show queue.
Add crew to show tvinfo_base.
Drop backup tables for now.
Don't save switch refresh, update show queue items (since they are sub queues of switch).
Remove show from switched_shows in case it is in it when deleting the show.
Use switch queue for manual switch
Load/save updated time for person/Character.
Add show_queue table.
Add _get_item_sql, _delete_item_from_db_sql to search search_queue.
Add people_queue type.
Add people scheduler.
Add people queue.
Add tvinfo source switch queue item.
Alternate naming for person/character images.
Add load and save image/thumb urls for persons.
Add load character pics.
Add save images for characters.
Add save image urls for characters to db.
Change limit for person searches to 100 instead of 10 default.
Add person verification.
Add people_url and character_url to sources that support them.
Add save castlist changes.
Add remove old characters from castlist.
Change optimize find_show_by_id.
Change improve debug info for person, character obj.
Add db_support_upsert support flag in db.py.
Add cast list objs and load from db.
Add parse and add additional images to TVInfo.
Add optional loading of images and actors/crew.
Fix _make_timestamp in py2.
Save and load _src_update_time.
Change use update time for show updates.
Add _set_network optimization.
Add src_update_timestamp to tvshow tbl.
Add updated_timestamp to TVInfoShow.
Add _indexer_update_time TVShow obj.
Add support to search for external ids on TV info sources: [TVINFO_TVDB, TVINFO_IMDb, TVINFO_TMDB, TVINFO_TRAKT].
Change show tasks page, keep remove button for failed switches always visible.
Add use get_url for tvmaze_api interface (to support failure handling), without changing original lib.
Add missing settings in switch show.
Add new switch error: TVSWITCH_ID_CONFLICT: 'new id conflicts with existing show'.
Add messages for manual switch id.
Add connection skip handling.
Add get_url failure handling to Trakt lib.
Add real search_person to tvinfo interface.
Change move TMDB api key to tmdb_api.
Add get_url usage via tmdb_api.
Change join/split of akas/join and sql group_concat to `;;;` to prevent issues with names that may contain comma (`,`).
Add Trakt api specific failure times.
Add warning about reassigning MEMCACHE
Add calc_age to sg_helpers for person page to remove dupe code.
Add return age in ajax for persons.
Change format dates on person page to honour config/General.
Add convert_to_inch_fraction_html to sg_helpers.
Change direct assign method instead of wrapper (faster).
Change force disk_pickle_protocol=2 for py2 compatibility in tvinfo cache.
Add episode rename info during switch.
Add save deleted episodes when switching tvinfo source.
Add get_switch_changed page.
Add force=True to QueueItemRefresh during switch of tvinfo to force rewriting of metadata.
Add filter character dupes in tvdb_api only take images for unique character, role combos on tvdb.
Fix humanize lib in py27.
Add diskcache to tvinfo_base.
Add doc files for diskcache lib.
Add clean tvinfo to show_updater.
Add switch_ep_errors table to sickbeard.db
Add debug log message when extra data is fetched for a person.
Change make character loading more efficient.
Add placeholder image for characters and persons.
Change start, end year moved to new extra table to support multiple person per character.
Change replace start_year, end_year with persons_years in Character class.
Add new table character_person_years, change table structure characters.
Add check if show is found for switch pages.
Add missing scheduled to cache.db people queue table.
Change trakt show search now will ignore failure handling, to make sure it's always tried when searching for shows.
Change add/improve tvmaze id cross search.
Change improve search, if only ids are given, resulting seriesnames on source will be used as text search on following tvinfo sources.
Add new parameter: prefer_person to imagecache/character endpoint.
Add if prefer_person is set and person_id is set to valid person and the character has more then 1 person assigned the character image will not be returned, instead the actors image or the placeholder.
Add only take external ids if character is confirmed in logic.
Add match name instead of person id for checking same person in show when adding cast for sources without person id (tvdb)
Add cache tmdb genres directly in dict for performance.
4 years ago
|
|
|
self.dirty_setter('internal_network')(self, *arg)
|
|
|
|
|
|
|
|
# genre = property(lambda self: self._genre, dirty_setter('_genre'))
|
|
|
|
@property
|
|
|
|
def genre(self):
|
|
|
|
return self._genre
|
|
|
|
|
|
|
|
@genre.setter
|
|
|
|
def genre(self, *arg):
|
|
|
|
self.dirty_setter('_genre')(self, *arg)
|
|
|
|
|
|
|
|
# classification = property(lambda self: self._classification, dirty_setter('_classification'))
|
|
|
|
@property
|
|
|
|
def classification(self):
|
|
|
|
return self._classification
|
|
|
|
|
|
|
|
@classification.setter
|
|
|
|
def classification(self, *arg):
|
|
|
|
self.dirty_setter('_classification')(self, *arg)
|
|
|
|
|
|
|
|
# runtime = property(lambda self: self._runtime, dirty_setter('_runtime'))
|
|
|
|
@property
|
|
|
|
def runtime(self):
|
|
|
|
return self._runtime
|
|
|
|
|
|
|
|
@runtime.setter
|
|
|
|
def runtime(self, *arg):
|
|
|
|
self.dirty_setter('_runtime')(self, *arg)
|
|
|
|
|
|
|
|
# imdb_info = property(lambda self: self._imdb_info, dirty_setter('_imdb_info'))
|
|
|
|
@property
|
|
|
|
def imdb_info(self):
|
|
|
|
return self._imdb_info
|
|
|
|
|
|
|
|
@imdb_info.setter
|
|
|
|
def imdb_info(self, *arg):
|
|
|
|
self.dirty_setter('_imdb_info')(self, *arg)
|
|
|
|
|
|
|
|
# quality = property(lambda self: self._quality, dirty_setter('_quality'))
|
|
|
|
@property
|
|
|
|
def quality(self):
|
|
|
|
return self._quality
|
|
|
|
|
|
|
|
@quality.setter
|
|
|
|
def quality(self, *arg):
|
|
|
|
self.dirty_setter('_quality')(self, *arg)
|
|
|
|
|
|
|
|
# flatten_folders = property(lambda self: self._flatten_folders, dirty_setter('_flatten_folders'))
|
|
|
|
@property
|
|
|
|
def flatten_folders(self):
|
|
|
|
return self._flatten_folders
|
|
|
|
|
|
|
|
@flatten_folders.setter
|
|
|
|
def flatten_folders(self, *arg):
|
|
|
|
self.dirty_setter('_flatten_folders')(self, *arg)
|
|
|
|
|
|
|
|
# status = property(lambda self: self._status, dirty_setter('_status'))
|
|
|
|
@property
|
|
|
|
def status(self):
|
|
|
|
return self._status
|
|
|
|
|
|
|
|
@status.setter
|
|
|
|
def status(self, *arg):
|
|
|
|
self.dirty_setter('_status')(self, *arg)
|
|
|
|
|
|
|
|
# airs = property(lambda self: self._airs, dirty_setter('_airs'))
|
|
|
|
@property
|
|
|
|
def airs(self):
|
|
|
|
return self._airs
|
|
|
|
|
|
|
|
@airs.setter
|
|
|
|
def airs(self, *arg):
|
|
|
|
self.dirty_setter('_airs')(self, *arg)
|
|
|
|
|
|
|
|
# startyear = property(lambda self: self._startyear, dirty_setter('_startyear'))
|
|
|
|
@property
|
|
|
|
def startyear(self):
|
|
|
|
return self._startyear
|
|
|
|
|
|
|
|
@startyear.setter
|
|
|
|
def startyear(self, *arg):
|
|
|
|
self.dirty_setter('_startyear')(self, *arg)
|
|
|
|
|
|
|
|
# air_by_date = property(lambda self: self._air_by_date, dirty_setter('_air_by_date'))
|
|
|
|
@property
|
|
|
|
def air_by_date(self):
|
|
|
|
return self._air_by_date
|
|
|
|
|
|
|
|
@air_by_date.setter
|
|
|
|
def air_by_date(self, *arg):
|
|
|
|
self.dirty_setter('_air_by_date')(self, *arg)
|
|
|
|
|
|
|
|
# subtitles = property(lambda self: self._subtitles, dirty_setter('_subtitles'))
|
|
|
|
@property
|
|
|
|
def subtitles(self):
|
|
|
|
return self._subtitles
|
|
|
|
|
|
|
|
@subtitles.setter
|
|
|
|
def subtitles(self, *arg):
|
|
|
|
self.dirty_setter('_subtitles')(self, *arg)
|
|
|
|
|
|
|
|
# dvdorder = property(lambda self: self._dvdorder, dirty_setter('_dvdorder'))
|
|
|
|
@property
|
|
|
|
def dvdorder(self):
|
|
|
|
return self._dvdorder
|
|
|
|
|
|
|
|
@dvdorder.setter
|
|
|
|
def dvdorder(self, *arg):
|
|
|
|
self.dirty_setter('_dvdorder')(self, *arg)
|
|
|
|
|
|
|
|
# upgrade_once = property(lambda self: self._upgrade_once, dirty_setter('_upgrade_once'))
|
|
|
|
@property
|
|
|
|
def upgrade_once(self):
|
|
|
|
return self._upgrade_once
|
|
|
|
|
|
|
|
@upgrade_once.setter
|
|
|
|
def upgrade_once(self, *arg):
|
|
|
|
self.dirty_setter('_upgrade_once')(self, *arg)
|
|
|
|
|
|
|
|
# lang = property(lambda self: self._lang, dirty_setter('_lang'))
|
|
|
|
@property
|
|
|
|
def lang(self):
|
|
|
|
return self._lang
|
|
|
|
|
|
|
|
@lang.setter
|
|
|
|
def lang(self, *arg):
|
|
|
|
self.dirty_setter('_lang')(self, *arg)
|
|
|
|
|
|
|
|
# last_update_indexer = property(lambda self: self._last_update_indexer, dirty_setter('_last_update_indexer'))
|
|
|
|
@property
|
|
|
|
def last_update_indexer(self):
|
|
|
|
return self._last_update_indexer
|
|
|
|
|
|
|
|
@last_update_indexer.setter
|
|
|
|
def last_update_indexer(self, *arg):
|
|
|
|
self.dirty_setter('_last_update_indexer')(self, *arg)
|
|
|
|
|
|
|
|
# sports = property(lambda self: self._sports, dirty_setter('_sports'))
|
|
|
|
@property
|
|
|
|
def sports(self):
|
|
|
|
return self._sports
|
|
|
|
|
|
|
|
@sports.setter
|
|
|
|
def sports(self, *arg):
|
|
|
|
self.dirty_setter('_sports')(self, *arg)
|
|
|
|
|
|
|
|
# anime = property(lambda self: self._anime, dirty_setter('_anime'))
|
|
|
|
@property
|
|
|
|
def anime(self):
|
|
|
|
return self._anime
|
|
|
|
|
|
|
|
@anime.setter
|
|
|
|
def anime(self, *arg):
|
|
|
|
self.dirty_setter('_anime')(self, *arg)
|
|
|
|
|
|
|
|
# scene = property(lambda self: self._scene, dirty_setter('_scene'))
|
|
|
|
@property
|
|
|
|
def scene(self):
|
|
|
|
return self._scene
|
|
|
|
|
|
|
|
@scene.setter
|
|
|
|
def scene(self, *arg):
|
|
|
|
self.dirty_setter('_scene')(self, *arg)
|
|
|
|
|
|
|
|
# rls_ignore_words = property(lambda self: self._rls_ignore_words, dirty_setter('_rls_ignore_words'))
|
|
|
|
@property
|
|
|
|
def rls_ignore_words(self):
|
|
|
|
return self._rls_ignore_words
|
|
|
|
|
|
|
|
@rls_ignore_words.setter
|
|
|
|
def rls_ignore_words(self, *arg):
|
|
|
|
self.dirty_setter('_rls_ignore_words', set)(self, *arg)
|
|
|
|
|
|
|
|
# rls_require_words = property(lambda self: self._rls_require_words, dirty_setter('_rls_require_words'))
|
|
|
|
@property
|
|
|
|
def rls_require_words(self):
|
|
|
|
return self._rls_require_words
|
|
|
|
|
|
|
|
@rls_require_words.setter
|
|
|
|
def rls_require_words(self, *arg):
|
|
|
|
self.dirty_setter('_rls_require_words', set)(self, *arg)
|
|
|
|
|
|
|
|
# overview = property(lambda self: self._overview, dirty_setter('_overview'))
|
|
|
|
@property
|
|
|
|
def overview(self):
|
|
|
|
return self._overview
|
|
|
|
|
|
|
|
@overview.setter
|
|
|
|
def overview(self, *arg):
|
|
|
|
self.dirty_setter('_overview')(self, *arg)
|
|
|
|
|
|
|
|
# prune = property(lambda self: self._prune, dirty_setter('_prune'))
|
|
|
|
@property
|
|
|
|
def prune(self):
|
|
|
|
return self._prune
|
|
|
|
|
|
|
|
@prune.setter
|
|
|
|
def prune(self, *arg):
|
|
|
|
self.dirty_setter('_prune')(self, *arg)
|
|
|
|
|
|
|
|
# tag = property(lambda self: self._tag, dirty_setter('_tag'))
|
|
|
|
@property
|
|
|
|
def tag(self):
|
|
|
|
return self._tag
|
|
|
|
|
|
|
|
@tag.setter
|
|
|
|
def tag(self, *arg):
|
|
|
|
self.dirty_setter('_tag')(self, *arg)
|
|
|
|
|
|
|
|
|
|
|
|
# noinspection PyAbstractClass
|
|
|
|
class TVEpisodeBase(LegacyTVEpisode, TVBase):
|
|
|
|
|
|
|
|
def __init__(self, season, episode, tvid):
|
|
|
|
super(TVEpisodeBase, self).__init__(tvid)
|
|
|
|
|
|
|
|
self._absolute_number = 0
|
|
|
|
self._airdate = datetime.date.fromordinal(1)
|
|
|
|
self._description = ''
|
|
|
|
self._episode = episode
|
|
|
|
self._file_size = 0
|
|
|
|
self._hasnfo = False
|
|
|
|
self._hastbn = False
|
|
|
|
self._is_proper = False
|
|
|
|
self._name = ''
|
|
|
|
self._release_group = ''
|
|
|
|
self._release_name = ''
|
|
|
|
self._season = season
|
|
|
|
self._status = UNKNOWN
|
|
|
|
self._subtitles = list()
|
|
|
|
self._subtitles_lastsearch = str(datetime.datetime.min)
|
|
|
|
self._subtitles_searchcount = 0
|
|
|
|
self._version = 0
|
|
|
|
|
|
|
|
# name = property(lambda self: self._name, dirty_setter('_name', string_types))
|
|
|
|
@property
|
|
|
|
def name(self):
|
|
|
|
return self._name
|
|
|
|
|
|
|
|
@name.setter
|
|
|
|
def name(self, *arg):
|
|
|
|
self.dirty_setter('_name', string_types)(self, *arg)
|
|
|
|
|
|
|
|
# season = property(lambda self: self._season, dirty_setter('_season'))
|
|
|
|
@property
|
|
|
|
def season(self):
|
|
|
|
""" Season number.
|
|
|
|
|
|
|
|
:return: Season number
|
|
|
|
:rtype: int
|
|
|
|
"""
|
|
|
|
return self._season
|
|
|
|
|
|
|
|
@season.setter
|
|
|
|
def season(self, *arg):
|
|
|
|
self.dirty_setter('_season')(self, *arg)
|
|
|
|
|
|
|
|
# episode = property(lambda self: self._episode, dirty_setter('_episode'))
|
|
|
|
@property
|
|
|
|
def episode(self):
|
|
|
|
""" Episode number.
|
|
|
|
|
|
|
|
:return: Episode number
|
|
|
|
:rtype: int
|
|
|
|
"""
|
|
|
|
return self._episode
|
|
|
|
|
|
|
|
@episode.setter
|
|
|
|
def episode(self, *arg):
|
|
|
|
self.dirty_setter('_episode')(self, *arg)
|
|
|
|
|
|
|
|
# absolute_number = property(lambda self: self._absolute_number, dirty_setter('_absolute_number'))
|
|
|
|
@property
|
|
|
|
def absolute_number(self):
|
|
|
|
return self._absolute_number
|
|
|
|
|
|
|
|
@absolute_number.setter
|
|
|
|
def absolute_number(self, *arg):
|
|
|
|
self.dirty_setter('_absolute_number')(self, *arg)
|
|
|
|
|
|
|
|
# description = property(lambda self: self._description, dirty_setter('_description'))
|
|
|
|
@property
|
|
|
|
def description(self):
|
|
|
|
return self._description
|
|
|
|
|
|
|
|
@description.setter
|
|
|
|
def description(self, *arg):
|
|
|
|
self.dirty_setter('_description')(self, *arg)
|
|
|
|
|
|
|
|
# subtitles = property(lambda self: self._subtitles, dirty_setter('_subtitles'))
|
|
|
|
@property
|
|
|
|
def subtitles(self):
|
|
|
|
return self._subtitles
|
|
|
|
|
|
|
|
@subtitles.setter
|
|
|
|
def subtitles(self, *arg):
|
|
|
|
self.dirty_setter('_subtitles')(self, *arg)
|
|
|
|
|
|
|
|
# subtitles_searchcount = property(lambda self: self._subtitles_searchcount, dirty_setter('_subtitles_searchcount'))
|
|
|
|
@property
|
|
|
|
def subtitles_searchcount(self):
|
|
|
|
return self._subtitles_searchcount
|
|
|
|
|
|
|
|
@subtitles_searchcount.setter
|
|
|
|
def subtitles_searchcount(self, *arg):
|
|
|
|
self.dirty_setter('_subtitles_searchcount')(self, *arg)
|
|
|
|
|
|
|
|
# subtitles_lastsearch = property(lambda self: self._subtitles_lastsearch, dirty_setter('_subtitles_lastsearch'))
|
|
|
|
@property
|
|
|
|
def subtitles_lastsearch(self):
|
|
|
|
return self._subtitles_lastsearch
|
|
|
|
|
|
|
|
@subtitles_lastsearch.setter
|
|
|
|
def subtitles_lastsearch(self, *arg):
|
|
|
|
self.dirty_setter('_subtitles_lastsearch')(self, *arg)
|
|
|
|
|
|
|
|
# airdate = property(lambda self: self._airdate, dirty_setter('_airdate'))
|
|
|
|
@property
|
|
|
|
def airdate(self):
|
|
|
|
return self._airdate
|
|
|
|
|
|
|
|
@airdate.setter
|
|
|
|
def airdate(self, *arg):
|
|
|
|
self.dirty_setter('_airdate')(self, *arg)
|
|
|
|
|
|
|
|
# hasnfo = property(lambda self: self._hasnfo, dirty_setter('_hasnfo'))
|
|
|
|
@property
|
|
|
|
def hasnfo(self):
|
|
|
|
return self._hasnfo
|
|
|
|
|
|
|
|
@hasnfo.setter
|
|
|
|
def hasnfo(self, *arg):
|
|
|
|
self.dirty_setter('_hasnfo')(self, *arg)
|
|
|
|
|
|
|
|
# hastbn = property(lambda self: self._hastbn, dirty_setter('_hastbn'))
|
|
|
|
@property
|
|
|
|
def hastbn(self):
|
|
|
|
return self._hastbn
|
|
|
|
|
|
|
|
@hastbn.setter
|
|
|
|
def hastbn(self, *arg):
|
|
|
|
self.dirty_setter('_hastbn')(self, *arg)
|
|
|
|
|
|
|
|
# status = property(lambda self: self._status, dirty_setter('_status'))
|
|
|
|
@property
|
|
|
|
def status(self):
|
|
|
|
return self._status
|
|
|
|
|
|
|
|
@status.setter
|
|
|
|
def status(self, *arg):
|
|
|
|
self.dirty_setter('_status')(self, *arg)
|
|
|
|
|
|
|
|
# file_size = property(lambda self: self._file_size, dirty_setter('_file_size'))
|
|
|
|
@property
|
|
|
|
def file_size(self):
|
|
|
|
return self._file_size
|
|
|
|
|
|
|
|
@file_size.setter
|
|
|
|
def file_size(self, *arg):
|
|
|
|
self.dirty_setter('_file_size')(self, *arg)
|
|
|
|
|
|
|
|
# release_name = property(lambda self: self._release_name, dirty_setter('_release_name'))
|
|
|
|
@property
|
|
|
|
def release_name(self):
|
|
|
|
return self._release_name
|
|
|
|
|
|
|
|
@release_name.setter
|
|
|
|
def release_name(self, *arg):
|
|
|
|
self.dirty_setter('_release_name')(self, *arg)
|
|
|
|
|
|
|
|
# is_proper = property(lambda self: self._is_proper, dirty_setter('_is_proper'))
|
|
|
|
@property
|
|
|
|
def is_proper(self):
|
|
|
|
return self._is_proper
|
|
|
|
|
|
|
|
@is_proper.setter
|
|
|
|
def is_proper(self, *arg):
|
|
|
|
self.dirty_setter('_is_proper')(self, *arg)
|
|
|
|
|
|
|
|
# version = property(lambda self: self._version, dirty_setter('_version'))
|
|
|
|
@property
|
|
|
|
def version(self):
|
|
|
|
return self._version
|
|
|
|
|
|
|
|
@version.setter
|
|
|
|
def version(self, *arg):
|
|
|
|
self.dirty_setter('_version')(self, *arg)
|
|
|
|
|
|
|
|
# release_group = property(lambda self: self._release_group, dirty_setter('_release_group'))
|
|
|
|
@property
|
|
|
|
def release_group(self):
|
|
|
|
return self._release_group
|
|
|
|
|
|
|
|
@release_group.setter
|
|
|
|
def release_group(self, *arg):
|
|
|
|
self.dirty_setter('_release_group')(self, *arg)
|