本文整理汇总了Python中sickbeard.tvcache.TVCache._get_db方法的典型用法代码示例。如果您正苦于以下问题:Python TVCache._get_db方法的具体用法?Python TVCache._get_db怎么用?Python TVCache._get_db使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sickbeard.tvcache.TVCache
的用法示例。
在下文中一共展示了TVCache._get_db方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GenericProvider
# 需要导入模块: from sickbeard.tvcache import TVCache [as 别名]
# 或者: from sickbeard.tvcache.TVCache import _get_db [as 别名]
#.........这里部分代码省略.........
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
result.size = self._get_size(item)
if len(episode_object) == 1:
episode_number = episode_object[0].episode
logger.log('Single episode result.', logger.DEBUG)
elif len(episode_object) > 1:
episode_number = MULTI_EP_RESULT
logger.log('Separating multi-episode result to check for later - result contains episodes: {0}'.format(
parse_result.episode_numbers), logger.DEBUG)
elif len(episode_object) == 0:
episode_number = SEASON_RESULT
logger.log('Separating full season result to check for later', logger.DEBUG)
if episode_number not in results:
results[episode_number] = [result]
else:
results[episode_number].append(result)
if cl:
# pylint: disable=protected-access
# Access to a protected member of a client class
cache_db = self.cache._get_db()
cache_db.mass_action(cl)
return results
def get_id(self, suffix=''):
return GenericProvider.make_id(self.name) + six.text_type(suffix)
def get_quality(self, item, anime=False):
(title, url_) = self._get_title_and_url(item)
quality = Quality.scene_quality(title, anime)
return quality
def get_result(self, episodes):
result = self._get_result(episodes)
result.provider = self
return result
@staticmethod
def get_url_hook(response, **kwargs_):
if response:
logger.log('{0} URL: {1} [Status: {2}]'.format
(response.request.method, response.request.url, response.status_code), logger.DEBUG)
if response.request.method == 'POST':
logger.log('With post data: {0}'.format(response.request.body), logger.DEBUG)
def get_url(self, url, post_data=None, params=None, timeout=30, **kwargs): # pylint: disable=too-many-arguments,
kwargs['hooks'] = {'response': self.get_url_hook}
return getURL(url, post_data, params, self.headers, timeout, self.session, **kwargs)
示例2: GenericProvider
# 需要导入模块: from sickbeard.tvcache import TVCache [as 别名]
# 或者: from sickbeard.tvcache.TVCache import _get_db [as 别名]
#.........这里部分代码省略.........
result = self.get_result(episode_object)
result.show = show_object
result.url = url
result.seeders = seeders
result.leechers = leechers
result.name = title
result.quality = quality
result.release_group = release_group
result.version = version
result.content = None
result.size = self._get_size(item)
result.pubdate = self._get_pubdate(item)
result.hash = self._get_hash(item)
if not episode_object:
episode_number = SEASON_RESULT
logger.log('Separating full season result to check for later', logger.DEBUG)
elif len(episode_object) == 1:
episode_number = episode_object[0].episode
logger.log('Single episode result.', logger.DEBUG)
else:
episode_number = MULTI_EP_RESULT
logger.log('Separating multi-episode result to check for later - result contains episodes: %s' % str(
parse_result.episode_numbers), logger.DEBUG)
if episode_number not in results:
results[episode_number] = [result]
else:
results[episode_number].append(result)
if cl:
# pylint: disable=protected-access
# Access to a protected member of a client class
db = self.cache._get_db()
db.mass_action(cl)
return results
def get_id(self):
return GenericProvider.make_id(self.name)
def get_quality(self, item, anime=False):
(title, _) = self._get_title_and_url(item)
quality = Quality.scene_quality(title, anime)
return quality
def get_result(self, episodes):
result = self._get_result(episodes)
result.provider = self
return result
@staticmethod
def get_url_hook(response, **kwargs):
logger.log('{} URL: {} [Status: {}]'.format
(response.request.method, response.request.url, response.status_code), logger.DEBUG)
if response.request.method == 'POST':
logger.log('With post data: {}'.format(response.request.body), logger.DEBUG)
def get_url(self, url, post_data=None, params=None, timeout=30, **kwargs): # pylint: disable=too-many-arguments,
kwargs['hooks'] = {'response': self.get_url_hook}
return getURL(url, post_data, params, self.headers, timeout, self.session, **kwargs)
def image_name(self):