本文整理匯總了Python中sickbeard.tvcache.TVCache._add_cache_entry方法的典型用法代碼示例。如果您正苦於以下問題:Python TVCache._add_cache_entry方法的具體用法?Python TVCache._add_cache_entry怎麽用?Python TVCache._add_cache_entry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sickbeard.tvcache.TVCache
的用法示例。
在下文中一共展示了TVCache._add_cache_entry方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: GenericProvider
# 需要導入模塊: from sickbeard.tvcache import TVCache [as 別名]
# 或者: from sickbeard.tvcache.TVCache import _add_cache_entry [as 別名]
#.........這裏部分代碼省略.........
logger.DEBUG)
add_cache_entry = True
else:
air_date = parse_result.air_date.toordinal()
db = DBConnection()
sql_results = db.select(
'SELECT season, episode FROM tv_episodes WHERE showid = ? AND airdate = ?',
[show_object.indexerid, air_date]
)
if len(sql_results) == 2:
if int(sql_results[0][b'season']) == 0 and int(sql_results[1][b'season']) != 0:
actual_season = int(sql_results[1][b'season'])
actual_episodes = [int(sql_results[1][b'episode'])]
same_day_special = True
elif int(sql_results[1][b'season']) == 0 and int(sql_results[0][b'season']) != 0:
actual_season = int(sql_results[0][b'season'])
actual_episodes = [int(sql_results[0][b'episode'])]
same_day_special = True
elif len(sql_results) != 1:
logger.log(
'Tried to look up the date for the episode {0} but the database didn\'t give proper results, skipping it'.format(title),
logger.WARNING)
add_cache_entry = True
if not add_cache_entry and not same_day_special:
actual_season = int(sql_results[0][b'season'])
actual_episodes = [int(sql_results[0][b'episode'])]
if add_cache_entry:
logger.log('Adding item from search to cache: {0}'.format(title), logger.DEBUG)
# pylint: disable=protected-access
# Access to a protected member of a client class
ci = self.cache._add_cache_entry(title, url, parse_result=parse_result)
if ci is not None:
cl.append(ci)
continue
episode_wanted = True
for episode_number in actual_episodes:
if not show_object.wantEpisode(actual_season, episode_number, quality, manual_search,
download_current_quality):
episode_wanted = False
break
if not episode_wanted:
logger.log('Ignoring result {0}.'.format(title), logger.DEBUG)
continue
logger.log('Found result {0} at {1}'.format(title, url), logger.DEBUG)
episode_object = []
for current_episode in actual_episodes:
episode_object.append(show_object.getEpisode(actual_season, current_episode))
result = self.get_result(episode_object)
result.show = show_object
result.url = url
result.name = title
result.quality = quality
result.release_group = release_group
result.version = version
result.content = None