You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1108 lines
43 KiB

import copy
import datetime
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
import diskcache
import logging
import threading
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
import shutil
import time
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
from exceptions_helper import ex
from six import integer_types, iteritems, iterkeys, string_types, text_type
from _23 import list_items, list_values
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
from lib.tvinfo_base.exceptions import *
from sg_helpers import calc_age, make_dirs
# noinspection PyUnreachableCode
if False:
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
from typing import Any, AnyStr, Dict, List, Optional, Set, Tuple, Union
TVINFO_TVDB = 1
TVINFO_TVRAGE = 2
TVINFO_TVMAZE = 3
# old tvdb api - version 1
# TVINFO_TVDB_V1 = 10001
# mapped only source
TVINFO_IMDB = 100
TVINFO_TRAKT = 101
TVINFO_TMDB = 102
# end mapped only source
TVINFO_TVDB_SLUG = 1001
TVINFO_TRAKT_SLUG = 1101
# generic stuff
TVINFO_SLUG = 100000
# social media sources
TVINFO_TWITTER = 250000
TVINFO_FACEBOOK = 250001
TVINFO_INSTAGRAM = 250002
TVINFO_WIKIPEDIA = 250003
log = logging.getLogger('TVInfo')
log.addHandler(logging.NullHandler())
TVInfoShowContainer = {} # type: Dict[ShowContainer]
class ShowContainer(dict):
"""Simple dict that holds a series of Show instances
"""
def __init__(self, **kwargs):
super(ShowContainer, self).__init__(**kwargs)
# limit caching of TVInfoShow objects to 15 minutes
self.max_age = 900 # type: integer_types
self.lock = threading.RLock()
def __setitem__(self, k, v):
super(ShowContainer, self).__setitem__(k, (v, time.time()))
def __getitem__(self, k):
return super(ShowContainer, self).__getitem__(k)[0]
def cleanup_old(self):
"""
remove entries that are older then max_age
"""
acquired_lock = self.lock.acquire(False)
if acquired_lock:
try:
current_time = time.time()
for k, v in list_items(self):
if self.max_age < current_time - v[1]:
lock_acquired = self[k].lock.acquire(False)
if lock_acquired:
try:
del self[k]
except (BaseException, Exception):
try:
self[k].lock.release()
except RuntimeError:
pass
finally:
self.lock.release()
def __str__(self):
nr_shows = len(self)
return '<ShowContainer (containing %s Show%s)>' % (nr_shows, ('s', '')[1 == nr_shows])
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__
class TVInfoIDs(object):
def __init__(self, tvdb=None, tmdb=None, tvmaze=None, imdb=None, trakt=None, rage=None, ids=None):
# type: (integer_types, integer_types, integer_types, integer_types, integer_types, integer_types, Dict[int, integer_types]) -> TVInfoIDs
ids = ids or {}
self.tvdb = tvdb or ids.get(TVINFO_TVDB)
self.tmdb = tmdb or ids.get(TVINFO_TMDB)
self.tvmaze = tvmaze or ids.get(TVINFO_TVMAZE)
self.imdb = imdb or ids.get(TVINFO_IMDB)
self.trakt = trakt or ids.get(TVINFO_TRAKT)
self.rage = rage or ids.get(TVINFO_TVRAGE)
def __getitem__(self, key):
return {TVINFO_TVDB: self.tvdb, TVINFO_TMDB: self.tmdb, TVINFO_TVMAZE: self.tvmaze,
TVINFO_IMDB: self.imdb, TVINFO_TRAKT: self.trakt, TVINFO_TVRAGE: self.rage}.get(key)
def __iter__(self):
for s, v in [(TVINFO_TVDB, self.tvdb), (TVINFO_TMDB, self.tmdb), (TVINFO_TVMAZE, self.tvmaze),
(TVINFO_IMDB, self.imdb), (TVINFO_TRAKT, self.trakt), (TVINFO_TVRAGE, self.rage)]:
yield s, v
def __str__(self):
return ', '.join('%s:%s' % v for v in self.__iter__())
__repr__ = __str__
iteritems = __iter__
items = __iter__
class TVInfoImageType(object):
poster = 1
banner = 2
# fanart/background
fanart = 3
typography = 4
other = 10
reverse_str = {
1: 'poster',
2: 'banner',
# fanart/background
3: 'fanart',
4: 'typography',
10: 'other'
}
class TVInfoImageSize(object):
original = 1
medium = 2
small = 3
reverse_str = {
1: 'original',
2: 'medium',
3: 'small'
}
class TVInfoImage(object):
def __init__(self, image_type, sizes, img_id=None, main_image=False, type_str='', rating=None, votes=None):
self.img_id = img_id # type: Optional[integer_types]
self.image_type = image_type # type: integer_types
self.sizes = sizes # type: Dict[TVInfoImageSize, AnyStr]
self.type_str = type_str # type: AnyStr
self.main_image = main_image # type: bool
self.rating = rating # type: Optional[Union[float, integer_types]]
self.votes = votes # type: Optional[integer_types]
def __str__(self):
return '<TVInfoImage %s [%s]>' % (TVInfoImageType.reverse_str.get(self.image_type, 'unknown'),
', '.join(TVInfoImageSize.reverse_str.get(s, 'unkown') for s in self.sizes))
__repr__ = __str__
class TVInfoShow(dict):
"""Holds a dict of seasons, and show data.
"""
def __init__(self):
dict.__init__(self)
self.lock = threading.RLock()
self.data = {} # type: Dict
self.ep_loaded = False # type: bool
self.poster_loaded = False # type: bool
self.banner_loaded = False # type: bool
self.fanart_loaded = False # type: bool
self.season_images_loaded = False # type: bool
self.seasonwide_images_loaded = False # type: bool
self.actors_loaded = False # type: bool
self.show_not_found = False # type: bool
self.id = None # type: integer_types
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.ids = TVInfoIDs() # type: TVInfoIDs
self.slug = None # type: Optional[AnyStr]
self.seriesid = None # type: integer_types
self.seriesname = None # type: Optional[AnyStr]
self.aliases = [] # type: List[AnyStr]
self.season = None # type: integer_types
self.classification = None # type: Optional[AnyStr]
self.genre = None # type: Optional[AnyStr]
self.genre_list = [] # type: List[AnyStr]
self.actors = [] # type: List[Dict]
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.cast = CastList() # type: CastList
self.crew = CrewList() # type: CrewList
self.show_type = [] # type: List[AnyStr]
self.network = None # type: Optional[AnyStr]
self.network_id = None # type: integer_types
self.network_timezone = None # type: Optional[AnyStr]
self.network_country = None # type: Optional[AnyStr]
self.network_country_code = None # type: Optional[AnyStr]
self.network_is_stream = None # type: Optional[bool]
self.runtime = None # type: integer_types
self.language = None # type: Optional[AnyStr]
self.official_site = None # type: Optional[AnyStr]
self.imdb_id = None # type: Optional[AnyStr]
self.zap2itid = None # type: Optional[AnyStr]
self.airs_dayofweek = None # type: Optional[AnyStr]
self.airs_time = None # type: Optional[AnyStr]
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.time = None # type: Optional[datetime.time]
self.firstaired = None # type: Optional[AnyStr]
self.added = None # type: Optional[AnyStr]
self.addedby = None # type: Union[integer_types, AnyStr]
self.siteratingcount = None # type: integer_types
self.lastupdated = None # type: integer_types
self.contentrating = None # type: Optional[AnyStr]
self.rating = None # type: integer_types
self.status = None # type: Optional[AnyStr]
self.overview = None # type: Optional[AnyStr]
self.poster = None # type: Optional[AnyStr]
self.poster_thumb = None # type: Optional[AnyStr]
self.banner = None # type: Optional[AnyStr]
self.banner_thumb = None # type: Optional[AnyStr]
self.fanart = None # type: Optional[AnyStr]
self.banners = {} # type: Dict
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.images = {} # type: Dict[TVInfoImageType, List[TVInfoImage]]
self.updated_timestamp = None # type: Optional[integer_types]
# special properties for trending, popular, ...
self.popularity = None # type: Optional[Union[integer_types, float]]
self.vote_count = None # type: Optional[integer_types]
self.vote_average = None # type: Optional[Union[integer_types, float]]
self.origin_countries = [] # type: List[AnyStr]
def __str__(self):
nr_seasons = len(self)
return '<Show %r (containing %s season%s)>' % (self.seriesname, nr_seasons, ('s', '')[1 == nr_seasons])
def __getattr__(self, key):
if key in self:
# Key is an episode, return it
return self[key]
if key in self.data:
# Non-numeric request is for show-data
return self.data[key]
raise AttributeError
def __getitem__(self, key):
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
if isinstance(key, string_types) and key in self.__dict__:
return self.__dict__[key]
if key in self:
# Key is an episode, return it
return dict.__getitem__(self, key)
if key in self.data:
# Non-numeric request is for show-data
return dict.__getitem__(self.data, key)
# Data wasn't found, raise appropriate error
if isinstance(key, integer_types) or isinstance(key, string_types) and key.isdigit():
# Episode number x was not found
raise BaseTVinfoSeasonnotfound('Could not find season %s' % (repr(key)))
else:
# If it's not numeric, it must be an attribute name, which
# doesn't exist, so attribute error.
raise BaseTVinfoAttributenotfound('Cannot find attribute %s' % (repr(key)))
def __deepcopy__(self, memo):
cls = self.__class__
result = cls.__new__(cls)
memo[id(self)] = result
for k, v in self.__dict__.items():
if 'lock' != k:
setattr(result, k, copy.deepcopy(v, memo))
for k, v in self.items():
result[k] = copy.deepcopy(v)
if isinstance(k, integer_types):
setattr(result[k], 'show', result)
return result
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def __bool__(self):
# type: (...) -> bool
return bool(self.id) or any(iterkeys(self.data))
def aired_on(self, date):
ret = self.search(str(date), 'firstaired')
if 0 == len(ret):
raise BaseTVinfoEpisodenotfound('Could not find any episodes that aired on %s' % date)
return ret
def search(self, term=None, key=None):
"""
Search all episodes in show. Can search all data, or a specific key (for
example, episodename)
Always returns an array (can be empty). First index contains the first
match, and so on.
"""
results = []
for cur_season in list_values(self):
searchresult = cur_season.search(term=term, key=key)
if 0 != len(searchresult):
results.extend(searchresult)
return results
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__
__nonzero__ = __bool__
class TVInfoSeason(dict):
def __init__(self, show=None, **kwargs):
"""The show attribute points to the parent show
"""
super(TVInfoSeason, self).__init__(**kwargs)
self.show = show # type: TVInfoShow
self.id = None # type: integer_types
self.number = None # type: integer_types
self.name = None # type: Optional[AnyStr]
self.actors = [] # type: List[Dict]
self.cast = CastList() # type: Dict[integer_types, Character]
self.network = None # type: Optional[AnyStr]
self.network_id = None # type: integer_types
self.network_timezone = None # type: Optional[AnyStr]
self.network_country = None # type: Optional[AnyStr]
self.network_country_code = None # type: Optional[AnyStr]
self.network_is_stream = None # type: Optional[bool]
self.ordered = None # type: Optional[integer_types]
self.start_date = None # type: Optional[AnyStr]
self.end_date = None # type: Optional[AnyStr]
self.poster = None # type: Optional[AnyStr]
self.summery = None # type: Optional[AnyStr]
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.episode_order = None # type: Optional[integer_types]
def __str__(self):
nr_episodes = len(self)
return '<Season %s instance (containing %s episode%s)>' % \
(self.number, nr_episodes, ('s', '')[1 == nr_episodes])
def __getattr__(self, episode_number):
if episode_number in self:
return self[episode_number]
raise AttributeError
def __getitem__(self, episode_number):
if episode_number not in self:
raise BaseTVinfoEpisodenotfound('Could not find episode %s' % (repr(episode_number)))
else:
return dict.__getitem__(self, episode_number)
def __deepcopy__(self, memo):
cls = self.__class__
result = cls.__new__(cls)
memo[id(self)] = result
for k, v in self.__dict__.items():
if 'show' != k:
setattr(result, k, copy.deepcopy(v, memo))
for k, v in self.items():
result[k] = copy.deepcopy(v)
if isinstance(k, integer_types):
setattr(result[k], 'season', result)
return result
def search(self, term=None, key=None):
"""Search all episodes in season, returns a list of matching Episode
instances.
"""
results = []
for ep in list_values(self):
searchresult = ep.search(term=term, key=key)
if None is not searchresult:
results.append(searchresult)
return results
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__
class TVInfoEpisode(dict):
def __init__(self, season=None, **kwargs):
"""The season attribute points to the parent season
"""
super(TVInfoEpisode, self).__init__(**kwargs)
self.id = None # type: integer_types
self.seriesid = None # type: integer_types
self.season = season # type: TVInfoSeason
self.seasonnumber = None # type: integer_types
self.episodenumber = None # type: integer_types
self.absolute_number = None # type: integer_types
self.is_special = None # type: Optional[bool]
self.actors = [] # type: List[Dict]
self.gueststars = None # type: Optional[AnyStr]
self.gueststars_list = [] # type: List[AnyStr]
self.cast = CastList() # type: Dict[integer_types, Character]
self.directors = [] # type: List[AnyStr]
self.writer = None # type: Optional[AnyStr]
self.writers = [] # type: List[AnyStr]
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.crew = CrewList() # type: CrewList
self.episodename = None # type: Optional[AnyStr]
self.overview = None # type: Optional[AnyStr]
self.language = {'episodeName': None, 'overview': None} # type: Dict[AnyStr, Optional[AnyStr]]
self.productioncode = None # type: Optional[AnyStr]
self.showurl = None # type: Optional[AnyStr]
self.lastupdated = None # type: integer_types
self.dvddiscid = None # type: Optional[AnyStr]
self.dvd_season = None # type: integer_types
self.dvd_episodenumber = None # type: integer_types
self.dvdchapter = None # type: integer_types
self.firstaired = None # type: Optional[AnyStr]
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.airtime = None # type: Optional[datetime.time]
self.runtime = 0 # type: integer_types
self.timestamp = None # type: Optional[integer_types]
self.network = None # type: Optional[AnyStr]
self.network_id = None # type: integer_types
self.network_timezone = None # type: Optional[AnyStr]
self.network_country = None # type: Optional[AnyStr]
self.network_country_code = None # type: Optional[AnyStr]
self.network_is_stream = None # type: Optional[bool]
self.filename = None # type: Optional[AnyStr]
self.lastupdatedby = None # type: Union[integer_types, AnyStr]
self.airsafterseason = None # type: integer_types
self.airsbeforeseason = None # type: integer_types
self.airsbeforeepisode = None # type: integer_types
self.imdb_id = None # type: Optional[AnyStr]
self.contentrating = None # type: Optional[AnyStr]
self.thumbadded = None # type: Optional[AnyStr]
self.rating = None # type: Union[integer_types, float]
self.siteratingcount = None # type: integer_types
def __str__(self):
seasno, epno = int(getattr(self, 'seasonnumber', 0)), int(getattr(self, 'episodenumber', 0))
epname = getattr(self, 'episodename', '')
if None is not epname:
return '<Episode %02dx%02d - %r>' % (seasno, epno, epname)
else:
return '<Episode %02dx%02d>' % (seasno, epno)
def __getattr__(self, key):
if key in self:
return self[key]
raise AttributeError
def __getitem__(self, key):
try:
return dict.__getitem__(self, key)
except KeyError:
raise BaseTVinfoAttributenotfound('Cannot find attribute %s' % (repr(key)))
def __deepcopy__(self, memo):
cls = self.__class__
result = cls.__new__(cls)
memo[id(self)] = result
for k, v in self.__dict__.items():
if 'season' != k:
setattr(result, k, copy.deepcopy(v, memo))
for k, v in self.items():
result[k] = copy.deepcopy(v)
return result
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def __bool__(self):
# type: (...) -> bool
return bool(self.id) or bool(self.episodename)
def search(self, term=None, key=None):
"""Search episode data for term, if it matches, return the Episode (self).
The key parameter can be used to limit the search to a specific element,
for example, episodename.
"""
if None is term:
raise TypeError('must supply string to search for (contents)')
term = text_type(term).lower()
for cur_key, cur_value in iteritems(self):
cur_key, cur_value = text_type(cur_key).lower(), text_type(cur_value).lower()
if None is not key and cur_key != key:
# Do not search this key
continue
if cur_value.find(text_type(term).lower()) > -1:
return 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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__
__nonzero__ = __bool__
class Persons(dict):
"""Holds all Persons instances for a show
"""
def __str__(self):
persons_count = len(self)
return '<Persons (containing %s Person%s)>' % (persons_count, ('', 's')[1 != persons_count])
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__
class CastList(Persons):
def __init__(self, **kwargs):
super(CastList, self).__init__(**kwargs)
for t in iterkeys(RoleTypes.reverse):
if t < RoleTypes.crew_limit:
self[t] = [] # type: List[Character]
def __str__(self):
persons_count = []
for t in iterkeys(RoleTypes.reverse):
if t < RoleTypes.crew_limit:
if len(self.get(t, [])):
persons_count.append('%s: %s' % (RoleTypes.reverse[t], len(self.get(t, []))))
persons_text = ', '.join(persons_count)
persons_text = ('0', '(%s)' % persons_text)['' != persons_text]
return '<Cast (containing %s Person%s)>' % (persons_text, ('', 's')['' != persons_text])
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__
class CrewList(Persons):
def __init__(self, **kwargs):
super(CrewList, self).__init__(**kwargs)
for t in iterkeys(RoleTypes.reverse):
if t >= RoleTypes.crew_limit:
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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[t] = [] # type: List[Crew]
def __str__(self):
persons_count = []
for t in iterkeys(RoleTypes.reverse):
if t >= RoleTypes.crew_limit:
if len(self.get(t, [])):
persons_count.append('%s: %s' % (RoleTypes.reverse[t], len(self.get(t, []))))
persons_text = ', '.join(persons_count)
persons_text = ('0', '(%s)' % persons_text)['' != persons_text]
return '<Crew (containing %s Person%s)>' % (persons_text, ('', 's')['' != persons_text])
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__
class PersonBase(dict):
"""Represents a single person. Should contain..
id,
image,
name,
role,
sortorder
"""
def __init__(self, p_id=None, name=None, image=None, gender=None, bio=None, birthdate=None, deathdate=None,
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
country=None, country_code=None, country_timezone=None, ids=None, thumb_url=None, **kwargs):
# type: (integer_types, AnyStr, AnyStr, int, AnyStr, datetime.date, datetime.date, AnyStr, AnyStr, AnyStr, Dict, AnyStr, Dict) -> PersonBase
super(PersonBase, self).__init__(**kwargs)
self.id = p_id # type: Optional[integer_types]
self.name = name # type: Optional[AnyStr]
self.image = image # type: Optional[AnyStr]
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.thumb_url = thumb_url # type: Optional[AnyStr]
self.gender = gender # type: Optional[int]
self.bio = bio # type: Optional[AnyStr]
self.birthdate = birthdate # type: Optional[datetime.date]
self.deathdate = deathdate # type: Optional[datetime.date]
self.country = country # type: Optional[AnyStr]
self.country_code = country_code # type: Optional[AnyStr]
self.country_timezone = country_timezone # type: Optional[AnyStr]
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.ids = ids or {} # type: Dict[int, integer_types]
def calc_age(self, date=None):
# type: (Optional[datetime.date]) -> Optional[int]
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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 calc_age(self.birthdate, self.deathdate, date)
@property
def age(self):
# type: (...) -> Optional[int]
"""
:return: age of person if birthdate is known, in case of deathdate is known return age of death
"""
return self.calc_age()
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def __bool__(self):
# type: (...) -> bool
return bool(self.name)
def __str__(self):
return '<Person "%s">' % self.name
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__
__nonzero__ = __bool__
class PersonGenders(object):
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
unknown = 0
male = 1
female = 2
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
named = {'unknown': 0, 'male': 1, 'female': 2}
reverse = {v: k for k, v in iteritems(named)}
tmdb_map = {0: unknown, 1: female, 2: male}
imdb_map = {'female': female, 'male': male}
class Crew(PersonBase):
def __init__(self, crew_type_name=None, **kwargs):
super(Crew, self).__init__(**kwargs)
self.crew_type_name = crew_type_name
def __str__(self):
return '<Crew%s "%s)">' % (('', ('/%s' % self.crew_type_name))[isinstance(self.crew_type_name, string_types)],
self.name)
__repr__ = __str__
class Person(PersonBase):
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def __init__(self, p_id=None, name=None, image=None, thumb_url=None, gender=None, bio=None, birthdate=None, deathdate=None,
country=None, country_code=None, country_timezone=None, ids=None, homepage=None, social_ids=None,
birthplace=None, url=None, characters=None, height=None, deathplace=None, nicknames=None,
real_name=None, akas=None, **kwargs):
# type: (integer_types, AnyStr, AnyStr, AnyStr, int, AnyStr, datetime.date, datetime.date, AnyStr, AnyStr, AnyStr, Dict, AnyStr, Dict, AnyStr, AnyStr, List[Character], Union[integer_types, float], AnyStr, Set[AnyStr], AnyStr, Set[AnyStr], Dict) -> Person
super(Person, self).__init__(p_id=p_id, name=name, image=image, thumb_url=thumb_url, gender=gender, bio=bio,
birthdate=birthdate, deathdate=deathdate, country=country,
country_code=country_code, country_timezone=country_timezone, ids=ids, **kwargs)
self.credits = [] # type: List
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.homepage = homepage # type: Optional[AnyStr]
self.social_ids = social_ids or {} # type: Dict
self.birthplace = birthplace # type: Optional[AnyStr]
self.deathplace = deathplace # type: Optional[AnyStr]
self.nicknames = nicknames or set() # type: Set[AnyStr]
self.real_name = real_name # type: AnyStr
self.url = url # type: Optional[AnyStr]
self.height = height # type: Optional[Union[integer_types, float]]
self.akas = akas or set() # type: Set[AnyStr]
self.characters = characters or [] # type: List[Character]
def __str__(self):
return '<Person "%s">' % self.name
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__
class Character(PersonBase):
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def __init__(self, person=None, voice=None, plays_self=None, regular=None, show=None, start_year=None,
end_year=None, **kwargs):
# type: (List[Person], bool, bool, bool, TVInfoShow, int, int, Dict) -> Character
super(Character, self).__init__(**kwargs)
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.person = person # type: List[Person]
self.voice = voice # type: Optional[bool]
self.plays_self = plays_self # type: Optional[bool]
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.regular = regular # type: Optional[bool]
self.show = show # type: Optional[TVInfoShow]
self.start_year = start_year # type: Optional[integer_types]
self.end_year = end_year # type: Optional[integer_types]
def __str__(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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
pn = []
if None is not self.person:
for p in self.person:
if getattr(p, 'name', None):
pn.append(p.name)
return '<Character "%s%s">' % (self.name, ('', ' - (%s)' % ', '.join(pn))[bool(pn)])
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__
class RoleTypes(object):
# Actor types
ActorMain = 1
ActorRecurring = 2
ActorGuest = 3
ActorSpecialGuest = 4
# Crew types (int's >= crew_limit)
CrewDirector = 50
CrewWriter = 51
CrewProducer = 52
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
CrewExecutiveProducer = 53
CrewCreator = 60
CrewEditor = 61
CrewCamera = 62
CrewMusic = 63
CrewStylist = 64
CrewMakeup = 65
CrewPhotography = 66
CrewSound = 67
CrewDesigner = 68
CrewDeveloper = 69
CrewAnimation = 70
CrewVisualEffects = 71
CrewOther = 100
reverse = {1: 'Main', 2: 'Recurring', 3: 'Guest', 4: 'Special Guest', 50: 'Director', 51: 'Writer', 52: 'Producer',
53: 'Executive Producer', 60: 'Creator', 61: 'Editor', 62: 'Camera', 63: 'Music', 64: 'Stylist',
65: 'Makeup', 66: 'Photography', 67: 'Sound', 68: 'Designer', 69: 'Developer', 70: 'Animation',
71: 'Visual Effects', 100: 'Other'}
crew_limit = 50
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
crew_type_names = {c.lower(): v for v, c in iteritems(RoleTypes.reverse) if v >= RoleTypes.crew_limit}
class TVInfoBase(object):
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
supported_id_searches = []
supported_person_id_searches = []
def __init__(self, banners=False, posters=False, seasons=False, seasonwides=False, fanart=False, actors=False,
*args, **kwargs):
global TVInfoShowContainer
if self.__class__.__name__ not in TVInfoShowContainer:
TVInfoShowContainer[self.__class__.__name__] = ShowContainer()
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.shows = TVInfoShowContainer[self.__class__.__name__] # type: ShowContainer[integer_types, TVInfoShow]
self.shows.cleanup_old()
self.lang = None # type: Optional[AnyStr]
self.corrections = {} # type: Dict
self.show_not_found = False # type: bool
self.not_found = False # type: bool
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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._old_config = None
self._cachedir = kwargs.get('diskcache_dir') # type: AnyStr
self.diskcache = diskcache.Cache(directory=self._cachedir, disk_pickle_protocol=2) # type: diskcache.Cache
self.cache_expire = 60 * 60 * 18 # type: integer_types
self.config = {
'apikey': '',
'debug_enabled': False,
'custom_ui': None,
'proxy': None,
'cache_enabled': False,
'cache_location': '',
'valid_languages': [],
'langabbv_to_id': {},
'language': 'en',
'base_url': '',
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
'banners_enabled': banners,
'posters_enabled': posters,
'seasons_enabled': seasons,
'seasonwides_enabled': seasonwides,
'fanart_enabled': fanart,
'actors_enabled': actors,
} # type: Dict[AnyStr, Any]
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def _must_load_data(self, sid, load_episodes, banners, posters, seasons, seasonwides, fanart, actors):
# type: (integer_types, bool, bool, bool, bool, bool, bool, bool) -> bool
"""
returns if show data has to be fetched for (extra) data (episodes, images, ...)
or can taken from self.shows cache
:param sid: show id
:param load_episodes: should episodes be loaded
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
:param banners: should load banners
:param posters: should load posters
:param seasons: should load season images
:param seasonwides: should load season wide images
:param fanart: should load fanart
:param actors: should load actors
"""
if sid not in self.shows or None is self.shows[sid].id or \
(load_episodes and not getattr(self.shows[sid], 'ep_loaded', False)):
return True
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
for data_type, en_type, p_type in [(u'poster', 'posters_enabled', posters),
(u'banner', 'banners_enabled', banners),
(u'fanart', 'fanart_enabled', fanart),
(u'season', 'seasons_enabled', seasons),
(u'seasonwide', 'seasonwides_enabled', seasonwides),
(u'actors', 'actors_enabled', actors)]:
if (p_type or self.config.get(en_type, False)) and \
not getattr(self.shows[sid], '%s_loaded' % data_type, False):
return True
return False
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def clear_cache(self):
"""
Clear cache.
"""
try:
with self.diskcache as dc:
dc.clear()
except (BaseException, Exception):
pass
def clean_cache(self):
"""
Remove expired items from cache.
"""
try:
with self.diskcache as dc:
dc.expire()
except (BaseException, Exception):
pass
def check_cache(self):
"""
checks cache
"""
try:
with self.diskcache as dc:
dc.check()
except (BaseException, Exception):
pass
def _get_cache_entry(self, key, retry=False):
# type: (Any, bool) -> Tuple[bool, Any]
"""
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
returns tuple of is_None and value
:param key:
:param retry:
"""
with self.diskcache as dc:
try:
v = dc.get(key)
return 'None' == v, (v, None)['None' == v]
except ValueError as e:
if not retry:
dc.close()
try:
shutil.rmtree(self._cachedir)
except (BaseException, Exception) as e:
log.error(ex(e))
pass
try:
make_dirs(self._cachedir)
except (BaseException, Exception):
pass
return self._get_cache_entry(key, retry=True)
else:
log.error('Error getting %s from cache: %s' % (key, ex(e)))
except (BaseException, Exception) as e:
log.error('Error getting %s from cache: %s' % (key, ex(e)))
return False, None
def _set_cache_entry(self, key, value, tag=None):
# type: (Any, Any, AnyStr) -> None
try:
with self.diskcache as dc:
dc.set(key, (value, 'None')[None is value], expire=self.cache_expire, tag=tag)
except (BaseException, Exception) as e:
log.error('Error setting %s to cache: %s' % (key, ex(e)))
def get_person(self, p_id, get_show_credits=False, get_images=False, **kwargs):
# type: (integer_types, bool, bool, Any) -> Optional[Person]
"""
get person's data for id or list of matching persons for name
:param p_id: persons id
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
:param get_show_credits: get show credits
:param get_images: get images for person
:return: person object
"""
pass
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def _search_person(self, name=None, ids=None):
# type: (AnyStr, Dict[integer_types, integer_types]) -> List[Person]
"""
search for person by name
:param name: name to search for
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
:param ids: dict of ids to search
:return: list of found person's
"""
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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 []
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def search_person(self, name=None, ids=None):
# type: (AnyStr, Dict[integer_types, integer_types]) -> List[Person]
"""
search for person by name
:param name: name to search for
:param ids: dict of ids to search
:return: list of found person's
"""
if not name and not ids:
log.debug('Nothing to search')
raise BaseTVinfoPersonNotFound('Nothing to search')
found_persons = []
if ids:
if not any(1 for i in ids if i in self.supported_person_id_searches) and not name:
log.debug('Id type not supported')
raise BaseTVinfoPersonNotFound('Id type not supported')
found_persons = self._search_person(name=name, ids=ids)
elif name:
found_persons = self._search_person(name=name, ids=ids)
return found_persons
def _get_show_data(self, sid, language, get_ep_info=False, banners=False, posters=False, seasons=False,
seasonwides=False, fanart=False, actors=False, **kwargs):
# type: (integer_types, AnyStr, bool, bool, bool, bool, bool, bool, bool, Optional[Any]) -> bool
"""
internal function that should be overwritten in class to get data for given show id
:param sid: show id
:param language: language
:param get_ep_info: get episodes
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
:param banners: load banners
:param posters: load posters
:param seasons: load seasons
:param seasonwides: load seasonwides
:param fanart: load fanard
:param actors: load actors
"""
pass
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def get_show(self, show_id, load_episodes=True, banners=False, posters=False, seasons=False,
Add UI changes. Changelog --------- Update fancyBox 2.1.6 to 3.5.7 (c4fd903). Update jQ collapser 2.0 → 3.0.1 (c3f95ba). Add glide.js 3.4.0 (e71f8bf) to view-show https://glidejs.com Add object fit image 3.2.4 (f951d2a). Update fanart icon. Change &#34;Import&#34; title to &#34;Path conflict&#34; for clarity. Add when a path conflict occurs during add show, users may enter a new show folder name. Add parsing Kodi show.nfo so import existing page selects any known info source. Change refactor mass_add_table to improve performance, and code clarity. Change find_show_by_id improve performance by iterating less and not using elif after a return. Add a vertical dotted line indication to the final cast slide on view-show. Add glide arrows to view-show. Change improve ui glide panel generally and also on startup. Add dynamic search examples to add show view. Change interface browse cards to new show search. Add search placeholder syntax hints. Add prevent user error on edit-show where &#34;set master&#34; is pending but Update or Cancel Edit is used instead of &#34;Save Changes&#34;. Add rounded borders to cast on view-show. Add character relationship Presenter to Host. Add third person singular pronoun on view show to a character who is portrayed by themself. Add where a character is in multiple shows to the character page. Change display on ui when update cast is in progress and not just queued. Change replace swipe with move event to act on any input type event (e.g. keyboard) for glide. Add click the glide number on view show to change slide times. Add pause to glide. Add cast displayed on view-show is saved whenever the glide is pause. Add restore view-show glide startAt when in pause mode and an image is selected as first to display. Rename from TVMaze &lt; TVmaze in line with their branding. Remove problematic buffering of 20 items on search results. Add 5 mins to Trakt failure retries times. Add spoken height to person. Change improve speed reading for many processes. Fix layout of multiline genre labels on view-show. Change view-show, during adding of a show, cast links will only become links when data is actually ready to be linked to, otherwise, display as textual info. Add new sort option &#34;Combine source&#34; to search show results. Add source provider images to search result items. Fix search box width now that the other select is reinstated. Change correct log messages grammar. Add visual cue of master tv info source to view show. Add new column on manage/Bulk Change for tv info src so that shows can be sorted to isolate a provider for selection. Add to manage/Bulk Change/Edit/TV info source. Add auto redirect from manage/Bulk Change to manage/show-tasks if a TV info source is tasked to change. Change improve manage/Show Tasks html template. Change replace most of inline styles with CSS classes to improve readability and load perf. Change use proper section dividers on manage/Show Tasks. Fix search TVDb links only to contain lang arg, not all. Technical commit messages (combined commits) -------------------------------------------- Add trigger glide count when view-art is clicked as width can change. Fix to restore show_poster due to change that now returns paths to thumbs that may not exist. Fix search box width on Palemoon. Change set initial cast background to full width. Change prevent the case where a cast list of one person will produce one single fixed width 170px box before the view-show js renders the final box width. Fix quotes in actor names breaking data-caption html markup. Add death data to known api attrs, but still not useful yet because cant do multiple actor searches in one call Change refresh font cache for people icon. Fix initialisation of view-show to display overview text where there is no glide cast list. Change improve image captions with text that cannot be copy/pasted in carousel. Fix hash crash when multiple people play a role. Change DRY and skip write nfo if exception from load_cast_from_tvinfo. Change _get_show_data api4 + fallback html complete. Add if SG_DEV_MODE=1 then logs new api4 data keys that can be added. Fix the return and invalid number of #type declarations for the _get_show_data signature in tvdb_api.py. Change more prep to get the request correct for api vs web requests. Change the goal is to make it so that if apikey = &#39;&#39;, the lib will be html sufficient and not use api. Fix closing fb in cases that have less then display items. Fix preventing glide btn from change after fb was closed in paused mode. Fix the pause called when opening glide fb from destroying saved glide position Change wait for fb to init before displaying images. Fix clicking on cloned glider items. Add pause glide when fb is opened Add caption when fb is open. Fix cursor style over glide btn tweak the exclusion case to focus on role surname as that is the false +ve trigger in this instance Fix use role show_obj in cast_characters. Change rename tmpl file. Change tweak glider ui button positions. Change experiment with Cheetah #attr over, it is too shitty to be useful, so reverted it. Fix cast image full image for characters. Add exclusions to person roles relationship builder, and ensure main character presents first. Add glide pinch zoom on mobile devices.. https://github.com/glidejs/glide/issues/507 Fix select top most item by default in info source search results. Fix issues surrounding process to add show that has an existing folder. Add path conflict rename suggest button when adding a show and the folder exists. Fix correctly send tvid:prodid data between find and existing show page. Fix a nasty c_i index exception created by newly added optimisation code. the exception was raised when an existing folder is found and the add btn pressed so that sg would redirect to the existing show path page. If sg was restarted at this point and the page then refreshed in the browser, then fail. Add send slug:value to find show from existing show folder page. Add use info source passed when redirected from existing show to find show. Change improve ui text. Change simplify and improve clarity of the template variables used. Fix passing hash_dir through to massAddTable tmpl as was consumed in webserve parameter functions instead of being passed in kwargs. Change find_show_by_id to be more pythonic in handling falsy values by not crashing if k/v of a dict is Nonetype. Change use helpers md5_for_text instead of hash() function for existing dir path. Change links got too messy, centralise creation into a function to make link params consistent and remove mistakes, from one use to another. Change wherever ui links/images have a ref_id, if id is not original id then include original id in link Change use reference_id for ui where available Change to less volatile ref_id for saving and restoring glide startAt. Change swap order into slowest to fastest for slide time Change move calcSlideCount function to document scope so it can be called on anytime Change call calcSlideCount when livepanel back-art is clicked Fix minor pyc flagged issues in the sql for tv. Change interface browse cards to new search. Changed use of re_imdb in search to helpers and expanded to 10 digits. Add exceptions to cast. Fix view-show episode date for young and restless (and others) cases. Change more tweaking of that ui text until it feels short and sweet. Change data sent to character page, a person is in a `role` playing a character. Change much simplified character logic due to an issue with Patrick Stewart at AD and ST. Change improved about text on character page and add link to characters in related shows. Change move text list processing from template and into backend. Fix crash on get start end year. Change fix and improve wording of ui switching tv info source. Change make sure there is something to glide before even trying to mount it as there is an acknowledged issue that mounting an empty glide can cause 100% browser usage. Change rescale cast images whose width leak out of container in view-show and move js into cast.js Change move ofi.js to inc_top.tmpl Change neaten the edging of person image. Change contain glide to prevent it from interfering where it should not be. Change setupGlide() is reverted as only one setup is needed, and hasGlideMounted is redundant/removed. Change add qTip. Change view-show sanitise startAt incase a switch makes a smaller cast. Change improve glide pause button with multi-click. Fix multi image alignment also fix round corners for wide images. Fix comparison of width for images on person page. More tweaking of css due to incorrect height on view-show. Tidy up glider CSS files locations and remove unused files from repo. Change move displayshow glide css and js to inc_top. Change improve restarting glide after collapse show and hide events. hide event seems to have better continuous flow, but both do at least restart at the correct index now. Add $.dbg var so the output of index can be seen at console level when an event is fired. Add missing arg to calcSlideCount(). Fix for css .. will-change: transform; Change tidy up collapser button, style its anchor instead of the span workaround. Add resize person and character image container if width is smaller then container on modern browsers Tidy up some ui CSS and minimise show airs text and simplify day ranges. Change collapser to remount glide after show/hide. Change put glide mount in try block to prevent it destroying the collapse when hiding. Change position of cast panel to before the overview. Rename js vars from Python to JS camelcase convention. Fix multiple character images. Fix IE compatibility. Fix prevent crash when switch from tvmaze to tdvb and back again, wierd. Change rename templates. Reformat sql so that the multiline statements can be easily copy pasted into a pyc SQL console window for instant execution. Added missing &#39;;&#39; so they copy/paste execute too. Need to drop existing tbl and copy/paste/execute new sql tbl. Change not everything is an error, but everything is a result, therefore, tbl is renamed. Change pushed rollback of renamed tbl. Fix initial sorting of search results. Change text for people queue actions. Fix max age on appearance. Change correct html layout for view source in web browser. Change title for characters in db, and add tip to make explain that a different image can be correctly shown for a different person e.g. animated or multiple people cast like in The Young and Restless - Sandra Nelson (Phyllis Summers). Fix default tvinfo search source for additional source. Change layout of persons. Change make multiple akas easier to read. Fix saving tvmaze in meta .nfo data. Add .nfo scanned once on startup to ensure tvmaze is set up. Change style for cast carousel on view-show. Change style for Cast update button. Change make topbar-notification unified and use for switcher bar. Change correct the indentation to improve maintainability. Change replace the misuse of br with div tags. Change remove spaces that badly affect layout, and use proper layout spacing. Change add confirm action to clear btn and reinstate all clear buttons. Fix Expand/collapse all + include for people queue. Remove redundant spaces. Change hide clear button until table is expanded. Also, move it to the right or expand/collapse btn. Shuffle the html structure around a little to set btn layout horizontally. Fix &#39;More&#39;/&#39;Less&#39; btn on view-show duplicating summary due to cast-holder div tag conflict. Change view-show cast list to display known names before unknown names. Change view-show add placeholder image for cast with no image. Change view-show under indentation used for html of cast block. Add some icon glyphs. Change vertical alignment of cast to be top down to make cast images level. Change cast update icon. Add akas to person. Change reduce find_show_by_id double call into one. Change tidy up get_url.
4 years ago
seasonwides=False, fanart=False, actors=False, old_call=False, **kwargs):
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
# type: (integer_types, bool, bool, bool, bool, bool, bool, bool, bool, Optional[Any]) -> Optional[TVInfoShow]
"""
get data for show id
:param show_id: id of show
:param load_episodes: load episodes
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
:param banners: load banners
:param posters: load posters
:param seasons: load season images
:param seasonwides: load season wide images
:param fanart: load fanart
:param actors: load actors
:param old_call: load legacy call
:return: show object
"""
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
if not old_call and None is self._old_config:
self._old_config = self.config.copy()
self.config.update({'banners_enabled': banners, 'posters_enabled': posters, 'seasons_enabled': seasons,
'seasonwides_enabled': seasonwides, 'fanart_enabled': fanart, 'actors_enabled': actors})
self.shows.lock.acquire()
try:
if show_id not in self.shows:
self.shows[show_id] = TVInfoShow() # type: TVInfoShow
with self.shows[show_id].lock:
self.shows.lock.release()
try:
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
if self._must_load_data(show_id, load_episodes, banners, posters, seasons, seasonwides, fanart,
actors):
self._get_show_data(show_id, self.config['language'], load_episodes, banners, posters, seasons,
seasonwides, fanart, actors)
if None is self.shows[show_id].id:
with self.shows.lock:
del self.shows[show_id]
return None if show_id not in self.shows else copy.deepcopy(self.shows[show_id])
finally:
try:
if None is self.shows[show_id].id:
with self.shows.lock:
del self.shows[show_id]
except (BaseException, Exception):
pass
finally:
try:
self.shows.lock.release()
except RuntimeError:
pass
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
if not old_call and None is not self._old_config:
self.config = self._old_config
self._old_config = None
# noinspection PyMethodMayBeStatic
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def _search_show(self, name=None, ids=None, **kwargs):
# type: (Union[AnyStr, List[AnyStr]], Dict[integer_types, integer_types], Optional[Any]) -> List[Dict]
"""
internal search function to find shows, should be overwritten in class
:param name: name to search for
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
:param ids: dict of ids {tvid: prodid} to search for
"""
return []
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
@staticmethod
def _convert_search_names(name):
if name:
names = ([name], name)[isinstance(name, list)]
for i, n in enumerate(names):
if not isinstance(n, string_types):
names[i] = text_type(n)
names[i] = names[i].lower()
return names
return name
def search_show(self, name=None, ids=None, **kwargs):
# type: (Union[AnyStr, List[AnyStr]], Dict[integer_types, integer_types], Optional[Any]) -> List[Dict]
"""
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
search for series with name(s) or ids
:param name: series name or list of names to search for
:param ids: dict of ids {tvid: prodid} to search for
:return: combined list of series results
"""
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
if not name and not ids:
log.debug('Nothing to search')
raise BaseTVinfoShownotfound('Nothing to search')
name, selected_series = self._convert_search_names(name), []
if ids:
if not name and not any(1 for i in ids if i in self.supported_id_searches):
log.debug('Id type not supported')
raise BaseTVinfoShownotfound('Id type not supported')
selected_series = self._search_show(name=name, ids=ids)
elif name:
selected_series = self._search_show(name)
if isinstance(selected_series, dict):
selected_series = [selected_series]
if not isinstance(selected_series, list) or 0 == len(selected_series):
log.debug('Series result returned zero')
raise BaseTVinfoShownotfound('Show-name search returned zero results (cannot find show on TVDB)')
return selected_series
def _set_item(self, sid, seas, ep, attrib, value):
# type: (integer_types, integer_types, integer_types, integer_types, Any, Any) -> None
"""Creates a new episode, creating Show(), Season() and
Episode()s as required. Called by _get_show_data to populate show
Since the nice-to-use tvinfo[1][24]['name] interface
makes it impossible to do tvinfo[1][24]['name] = "name"
and still be capable of checking if an episode exists
so we can raise tvinfo_shownotfound, we have a slightly
less pretty method of setting items.. but since the API
is supposed to be read-only, this is the best way to
do it!
The problem is that calling tvinfo[1][24]['episodename'] = "name"
calls __getitem__ on tvinfo[1], there is no way to check if
tvinfo.__dict__ should have a key "1" before we auto-create it
"""
# if sid not in self.shows:
# self.shows[sid] = TVInfoShow()
if seas not in self.shows[sid]:
self.shows[sid][seas] = TVInfoSeason(show=self.shows[sid])
self.shows[sid][seas].number = seas
if ep not in self.shows[sid][seas]:
self.shows[sid][seas][ep] = TVInfoEpisode(season=self.shows[sid][seas])
if attrib not in ('cast', 'crew'):
self.shows[sid][seas][ep][attrib] = value
self.shows[sid][seas][ep].__dict__[attrib] = value
def _set_show_data(self, sid, key, value, add=False):
# type: (integer_types, Any, Any, bool) -> None
"""Sets self.shows[sid] to a new Show instance, or sets the data
"""
# if sid not in self.shows:
# self.shows[sid] = TVInfoShow()
if key not in ('cast', 'crew'):
if add and isinstance(self.shows[sid].data, dict) and key in self.shows[sid].data:
self.shows[sid].data[key].update(value)
else:
self.shows[sid].data[key] = value
if '_banners' == key:
p_key = 'banners'
else:
p_key = key
if add and key in self.shows[sid].__dict__ and isinstance(self.shows[sid].__dict__[p_key], dict):
self.shows[sid].__dict__[p_key].update(self.shows[sid].data[key])
else:
self.shows[sid].__dict__[p_key] = self.shows[sid].data[key]
else:
if add and key in self.shows[sid].__dict__ and isinstance(self.shows[sid].__dict__[key], dict):
self.shows[sid].__dict__[key].update(value)
else:
self.shows[sid].__dict__[key] = value
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
def get_updated_shows(self):
# type: (...) -> Dict[integer_types, integer_types]
"""
gets all ids and timestamp of updated shows
returns dict of id: timestamp
"""
return {}
def get_trending(self, result_count=100, **kwargs):
# type: (...) -> List[TVInfoShow]
"""
get trending shows
:param result_count:
"""
return []
def get_popular(self, result_count=100, **kwargs):
# type: (...) -> List[TVInfoShow]
"""
get all popular shows
"""
return []
def get_top_rated(self, result_count=100, **kwargs):
# type: (...) -> List[TVInfoShow]
"""
get all latest shows
"""
return []
def discover(self, result_count=100, **kwargs):
# type: (...) -> List[TVInfoShow]
return []
def __getitem__(self, item):
# type: (Union[AnyStr, integer_types, Tuple[integer_types, bool]]) -> Union[TVInfoShow, List[Dict], None]
"""Legacy handler (use get_show or search_show instead)
Handles class_instance['seriesname'] calls.
The dict index should be the show id
"""
arg = None
if isinstance(item, tuple) and 2 == len(item):
item, arg = item
if not isinstance(arg, bool):
arg = None
if isinstance(item, integer_types):
# Item is integer, treat as show id
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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.get_show(item, (True, arg)[None is not arg], old_call=True)
Add UI changes. Changelog --------- Update fancyBox 2.1.6 to 3.5.7 (c4fd903). Update jQ collapser 2.0 → 3.0.1 (c3f95ba). Add glide.js 3.4.0 (e71f8bf) to view-show https://glidejs.com Add object fit image 3.2.4 (f951d2a). Update fanart icon. Change &#34;Import&#34; title to &#34;Path conflict&#34; for clarity. Add when a path conflict occurs during add show, users may enter a new show folder name. Add parsing Kodi show.nfo so import existing page selects any known info source. Change refactor mass_add_table to improve performance, and code clarity. Change find_show_by_id improve performance by iterating less and not using elif after a return. Add a vertical dotted line indication to the final cast slide on view-show. Add glide arrows to view-show. Change improve ui glide panel generally and also on startup. Add dynamic search examples to add show view. Change interface browse cards to new show search. Add search placeholder syntax hints. Add prevent user error on edit-show where &#34;set master&#34; is pending but Update or Cancel Edit is used instead of &#34;Save Changes&#34;. Add rounded borders to cast on view-show. Add character relationship Presenter to Host. Add third person singular pronoun on view show to a character who is portrayed by themself. Add where a character is in multiple shows to the character page. Change display on ui when update cast is in progress and not just queued. Change replace swipe with move event to act on any input type event (e.g. keyboard) for glide. Add click the glide number on view show to change slide times. Add pause to glide. Add cast displayed on view-show is saved whenever the glide is pause. Add restore view-show glide startAt when in pause mode and an image is selected as first to display. Rename from TVMaze &lt; TVmaze in line with their branding. Remove problematic buffering of 20 items on search results. Add 5 mins to Trakt failure retries times. Add spoken height to person. Change improve speed reading for many processes. Fix layout of multiline genre labels on view-show. Change view-show, during adding of a show, cast links will only become links when data is actually ready to be linked to, otherwise, display as textual info. Add new sort option &#34;Combine source&#34; to search show results. Add source provider images to search result items. Fix search box width now that the other select is reinstated. Change correct log messages grammar. Add visual cue of master tv info source to view show. Add new column on manage/Bulk Change for tv info src so that shows can be sorted to isolate a provider for selection. Add to manage/Bulk Change/Edit/TV info source. Add auto redirect from manage/Bulk Change to manage/show-tasks if a TV info source is tasked to change. Change improve manage/Show Tasks html template. Change replace most of inline styles with CSS classes to improve readability and load perf. Change use proper section dividers on manage/Show Tasks. Fix search TVDb links only to contain lang arg, not all. Technical commit messages (combined commits) -------------------------------------------- Add trigger glide count when view-art is clicked as width can change. Fix to restore show_poster due to change that now returns paths to thumbs that may not exist. Fix search box width on Palemoon. Change set initial cast background to full width. Change prevent the case where a cast list of one person will produce one single fixed width 170px box before the view-show js renders the final box width. Fix quotes in actor names breaking data-caption html markup. Add death data to known api attrs, but still not useful yet because cant do multiple actor searches in one call Change refresh font cache for people icon. Fix initialisation of view-show to display overview text where there is no glide cast list. Change improve image captions with text that cannot be copy/pasted in carousel. Fix hash crash when multiple people play a role. Change DRY and skip write nfo if exception from load_cast_from_tvinfo. Change _get_show_data api4 + fallback html complete. Add if SG_DEV_MODE=1 then logs new api4 data keys that can be added. Fix the return and invalid number of #type declarations for the _get_show_data signature in tvdb_api.py. Change more prep to get the request correct for api vs web requests. Change the goal is to make it so that if apikey = &#39;&#39;, the lib will be html sufficient and not use api. Fix closing fb in cases that have less then display items. Fix preventing glide btn from change after fb was closed in paused mode. Fix the pause called when opening glide fb from destroying saved glide position Change wait for fb to init before displaying images. Fix clicking on cloned glider items. Add pause glide when fb is opened Add caption when fb is open. Fix cursor style over glide btn tweak the exclusion case to focus on role surname as that is the false +ve trigger in this instance Fix use role show_obj in cast_characters. Change rename tmpl file. Change tweak glider ui button positions. Change experiment with Cheetah #attr over, it is too shitty to be useful, so reverted it. Fix cast image full image for characters. Add exclusions to person roles relationship builder, and ensure main character presents first. Add glide pinch zoom on mobile devices.. https://github.com/glidejs/glide/issues/507 Fix select top most item by default in info source search results. Fix issues surrounding process to add show that has an existing folder. Add path conflict rename suggest button when adding a show and the folder exists. Fix correctly send tvid:prodid data between find and existing show page. Fix a nasty c_i index exception created by newly added optimisation code. the exception was raised when an existing folder is found and the add btn pressed so that sg would redirect to the existing show path page. If sg was restarted at this point and the page then refreshed in the browser, then fail. Add send slug:value to find show from existing show folder page. Add use info source passed when redirected from existing show to find show. Change improve ui text. Change simplify and improve clarity of the template variables used. Fix passing hash_dir through to massAddTable tmpl as was consumed in webserve parameter functions instead of being passed in kwargs. Change find_show_by_id to be more pythonic in handling falsy values by not crashing if k/v of a dict is Nonetype. Change use helpers md5_for_text instead of hash() function for existing dir path. Change links got too messy, centralise creation into a function to make link params consistent and remove mistakes, from one use to another. Change wherever ui links/images have a ref_id, if id is not original id then include original id in link Change use reference_id for ui where available Change to less volatile ref_id for saving and restoring glide startAt. Change swap order into slowest to fastest for slide time Change move calcSlideCount function to document scope so it can be called on anytime Change call calcSlideCount when livepanel back-art is clicked Fix minor pyc flagged issues in the sql for tv. Change interface browse cards to new search. Changed use of re_imdb in search to helpers and expanded to 10 digits. Add exceptions to cast. Fix view-show episode date for young and restless (and others) cases. Change more tweaking of that ui text until it feels short and sweet. Change data sent to character page, a person is in a `role` playing a character. Change much simplified character logic due to an issue with Patrick Stewart at AD and ST. Change improved about text on character page and add link to characters in related shows. Change move text list processing from template and into backend. Fix crash on get start end year. Change fix and improve wording of ui switching tv info source. Change make sure there is something to glide before even trying to mount it as there is an acknowledged issue that mounting an empty glide can cause 100% browser usage. Change rescale cast images whose width leak out of container in view-show and move js into cast.js Change move ofi.js to inc_top.tmpl Change neaten the edging of person image. Change contain glide to prevent it from interfering where it should not be. Change setupGlide() is reverted as only one setup is needed, and hasGlideMounted is redundant/removed. Change add qTip. Change view-show sanitise startAt incase a switch makes a smaller cast. Change improve glide pause button with multi-click. Fix multi image alignment also fix round corners for wide images. Fix comparison of width for images on person page. More tweaking of css due to incorrect height on view-show. Tidy up glider CSS files locations and remove unused files from repo. Change move displayshow glide css and js to inc_top. Change improve restarting glide after collapse show and hide events. hide event seems to have better continuous flow, but both do at least restart at the correct index now. Add $.dbg var so the output of index can be seen at console level when an event is fired. Add missing arg to calcSlideCount(). Fix for css .. will-change: transform; Change tidy up collapser button, style its anchor instead of the span workaround. Add resize person and character image container if width is smaller then container on modern browsers Tidy up some ui CSS and minimise show airs text and simplify day ranges. Change collapser to remount glide after show/hide. Change put glide mount in try block to prevent it destroying the collapse when hiding. Change position of cast panel to before the overview. Rename js vars from Python to JS camelcase convention. Fix multiple character images. Fix IE compatibility. Fix prevent crash when switch from tvmaze to tdvb and back again, wierd. Change rename templates. Reformat sql so that the multiline statements can be easily copy pasted into a pyc SQL console window for instant execution. Added missing &#39;;&#39; so they copy/paste execute too. Need to drop existing tbl and copy/paste/execute new sql tbl. Change not everything is an error, but everything is a result, therefore, tbl is renamed. Change pushed rollback of renamed tbl. Fix initial sorting of search results. Change text for people queue actions. Fix max age on appearance. Change correct html layout for view source in web browser. Change title for characters in db, and add tip to make explain that a different image can be correctly shown for a different person e.g. animated or multiple people cast like in The Young and Restless - Sandra Nelson (Phyllis Summers). Fix default tvinfo search source for additional source. Change layout of persons. Change make multiple akas easier to read. Fix saving tvmaze in meta .nfo data. Add .nfo scanned once on startup to ensure tvmaze is set up. Change style for cast carousel on view-show. Change style for Cast update button. Change make topbar-notification unified and use for switcher bar. Change correct the indentation to improve maintainability. Change replace the misuse of br with div tags. Change remove spaces that badly affect layout, and use proper layout spacing. Change add confirm action to clear btn and reinstate all clear buttons. Fix Expand/collapse all + include for people queue. Remove redundant spaces. Change hide clear button until table is expanded. Also, move it to the right or expand/collapse btn. Shuffle the html structure around a little to set btn layout horizontally. Fix &#39;More&#39;/&#39;Less&#39; btn on view-show duplicating summary due to cast-holder div tag conflict. Change view-show cast list to display known names before unknown names. Change view-show add placeholder image for cast with no image. Change view-show under indentation used for html of cast block. Add some icon glyphs. Change vertical alignment of cast to be top down to make cast images level. Change cast update icon. Add akas to person. Change reduce find_show_by_id double call into one. Change tidy up get_url.
4 years ago
# maybe adding this to make callee use showname so that i can bring in the new endpoint
if isinstance(arg, string_types) and 'Tvdb' == self.__class__.__name__:
return self.search_show(item)
return self.search_show(item)
# noinspection PyMethodMayBeStatic
def search(self, series):
# type: (AnyStr) -> List
"""This searches for the series name
and returns the result list
"""
return []
def __str__(self):
return '<TVInfo(%s) (containing: %s)>' % (self.__class__.__name__, text_type(self.shows))
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 &#34;exists in db&#34; 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&#39;t have &#39;scene_url&#39;. 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&#39;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: &#39;new id conflicts with existing show&#39;. 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&#39;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
__repr__ = __str__