1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 03:22:22 -05:00

Merge branch 'origin/dev'

This commit is contained in:
echel0n 2014-04-22 03:30:33 -07:00
commit f57f771cf4
20 changed files with 34 additions and 29 deletions

View File

@ -108,3 +108,8 @@ class ConvertIndexerToInteger(ConvertSceneNamesToIndexerID):
ql.append(["UPDATE xem_refresh SET indexer = ? WHERE LOWER(indexer) = ?", ["1", "tvdb"]]) ql.append(["UPDATE xem_refresh SET indexer = ? WHERE LOWER(indexer) = ?", ["1", "tvdb"]])
ql.append(["UPDATE xem_refresh SET indexer = ? WHERE LOWER(indexer) = ?", ["2", "tvrage"]]) ql.append(["UPDATE xem_refresh SET indexer = ? WHERE LOWER(indexer) = ?", ["2", "tvrage"]])
self.connection.mass_action(ql) self.connection.mass_action(ql)
class RemoveKeysFromXemNumbering(ConvertIndexerToInteger):
def execute(self):
self.connection.action("ALTER TABLE xem_numbering DROP UNIQUE (indexer, indexer_id, season, episode)")
self.connection.action("ALTER TABLE xem_numbering DROP PRIMARY KEY")

View File

@ -1,5 +1,5 @@
# coding=utf-8 # coding=utf-8
# Author: Dani<EFBFBD>l Heimans # Author: Daniel Heimans
# URL: http://code.google.com/p/sickbeard # URL: http://code.google.com/p/sickbeard
# #
# This file is part of Sick Beard. # This file is part of Sick Beard.
@ -225,7 +225,7 @@ class BTNProvider(generic.TorrentProvider):
if show.air_by_date: if show.air_by_date:
# Search for the year of the air by date show # Search for the year of the air by date show
partial_season_params['name'] = str(season.split('-')[0]) partial_season_params['name'] = str(season).split('-')[0]
else: else:
# Search for any result which has Sxx in the name # Search for any result which has Sxx in the name
partial_season_params['name'] = 'S%02d' % int(season) partial_season_params['name'] = 'S%02d' % int(season)

View File

@ -57,7 +57,7 @@ class DTTProvider(generic.TorrentProvider):
def _dtt_show_id(self, show_name): def _dtt_show_id(self, show_name):
return sanitizeSceneName(show_name).replace('.', '-').lower() return sanitizeSceneName(show_name).replace('.', '-').lower()
def _get_season_search_strings(self, show, season, wantedEp, searchSeason=False): def _get_season_search_strings(self, show, season, wantedEp=None, searchSeason=False):
search_string = [] search_string = []
for show_name in set(show_name_helpers.allPossibleShowNames(show)): for show_name in set(show_name_helpers.allPossibleShowNames(show)):

View File

@ -1,3 +1,4 @@
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca> # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/ # URL: http://code.google.com/p/sickbeard/
# #
@ -308,7 +309,7 @@ class GenericProvider:
searchSeason = True searchSeason = True
for sceneSeason, sceneEpisodes in sceneSeasons.iteritems(): for sceneSeason, sceneEpisodes in sceneSeasons.iteritems():
for curString in self._get_season_search_strings(show, str(sceneSeason), sceneEpisodes, searchSeason): for curString in self._get_season_search_strings(show, sceneSeason, sceneEpisodes, searchSeason):
itemList += self._doSearch(curString) itemList += self._doSearch(curString)
for item in itemList: for item in itemList:

View File

@ -277,7 +277,7 @@ class HDTorrentsProvider(generic.TorrentProvider):
return (title, url) return (title, url)
def getURL(self, url, headers=None): def getURL(self, url, post_data=None, headers=None):
if not self.session: if not self.session:
self._doLogin() self._doLogin()

View File

@ -221,7 +221,7 @@ class IPTorrentsProvider(generic.TorrentProvider):
return (title, url) return (title, url)
def getURL(self, url, headers=None): def getURL(self, url, post_data=None, headers=None):
if not self.session: if not self.session:
self._doLogin() self._doLogin()

View File

@ -1,3 +1,4 @@
# coding=utf-8
# Author: Mr_Orange <mr_orange@hotmail.it> # Author: Mr_Orange <mr_orange@hotmail.it>
# URL: http://code.google.com/p/sickbeard/ # URL: http://code.google.com/p/sickbeard/
# #
@ -174,8 +175,7 @@ class KATProvider(generic.TorrentProvider):
if searchSeason: if searchSeason:
search_string = {'Season': [], 'Episode': []} search_string = {'Season': [], 'Episode': []}
for show_name in set(allPossibleShowNames(show)): for show_name in set(allPossibleShowNames(show)):
ep_string = show_name + ' S%02d' % int(season) + ' -S%02d' % int( ep_string = show_name + ' S%02d' % int(season) + ' -S%02d' % int(season) + 'E' + ' category:tv' #1) ShowName SXX -SXXE
season) + 'E' + ' category:tv' #1) ShowName SXX -SXXE
search_string['Season'].append(ep_string) search_string['Season'].append(ep_string)
ep_string = show_name + ' Season ' + str(season) + ' -Ep*' + ' category:tv' #2) ShowName Season X ep_string = show_name + ' Season ' + str(season) + ' -Ep*' + ' category:tv' #2) ShowName Season X
@ -305,7 +305,7 @@ class KATProvider(generic.TorrentProvider):
return (title, url) return (title, url)
def getURL(self, url, headers=None): def getURL(self, url, post_data=None, headers=None):
try: try:
# Remove double-slashes from url # Remove double-slashes from url

View File

@ -99,11 +99,11 @@ class NewznabProvider(generic.NZBProvider):
# air-by-date means &season=2010&q=2010.03, no other way to do it atm # air-by-date means &season=2010&q=2010.03, no other way to do it atm
if show.air_by_date: if show.air_by_date:
cur_params['season'] = season.split('-')[0] cur_params['season'] = str(season).split('-')[0]
if 'q' in cur_params: if 'q' in cur_params:
cur_params['q'] += '.' + season.replace('-', '.') cur_params['q'] += '.' + str(season).replace('-', '.')
else: else:
cur_params['q'] = season.replace('-', '.') cur_params['q'] = str(season).replace('-', '.')
else: else:
cur_params['season'] = str(season) cur_params['season'] = str(season)

View File

@ -265,7 +265,7 @@ class NextGenProvider(generic.TorrentProvider):
return title, url return title, url
def getURL(self, url, headers=None): def getURL(self, url, post_data=None, headers=None):
if not self.session: if not self.session:
self._doLogin() self._doLogin()

View File

@ -59,7 +59,7 @@ class NyaaProvider(generic.TorrentProvider):
def getQuality(self, item, anime=False): def getQuality(self, item, anime=False):
self.debug() self.debug()
title = helpers.get_xml_text(item.getElementsByTagName('title')[0]).replace("/", " ") title = helpers.get_xml_text(item.getElementsByTagName('title')[0]).replace("/", " ")
quality = Quality.sceneQuality(title, anime) quality = Quality.sceneQuality(title)
return quality return quality
def findSeasonResults(self, show, season): def findSeasonResults(self, show, season):
@ -69,7 +69,7 @@ class NyaaProvider(generic.TorrentProvider):
return results return results
def _get_season_search_strings(self, show, season, wantedEp, searchSeason=False): def _get_season_search_strings(self, show, season, wantedEp=None, searchSeason=False):
names = [] names = []
names.extend(show_name_helpers.makeSceneShowSearchStrings(show)) names.extend(show_name_helpers.makeSceneShowSearchStrings(show))
return names return names

View File

@ -204,7 +204,7 @@ class PublicHDProvider(generic.TorrentProvider):
return (title, url) return (title, url)
def getURL(self, url, headers=None): def getURL(self, url, post_data=None, headers=None):
try: try:
# Remove double-slashes from url # Remove double-slashes from url

View File

@ -51,8 +51,7 @@ class TorrentRssProvider(generic.TorrentProvider):
return self.name + '|' + self.url + '|' + str(int(self.enabled)) return self.name + '|' + self.url + '|' + str(int(self.enabled))
def imageName(self): def imageName(self):
if ek.ek(os.path.isfile, if ek.ek(os.path.isfile, ek.ek(os.path.join, sickbeard.PROG_DIR, 'data', 'images', 'providers', self.getID() + '.png')):
ek.ek(os.path.join, sickbeard.PROG_DIR, 'data', 'images', 'providers', self.getID() + '.png')):
return self.getID() + '.png' return self.getID() + '.png'
return 'torrentrss.png' return 'torrentrss.png'
@ -114,7 +113,6 @@ class TorrentRssProvider(generic.TorrentProvider):
if url.startswith('magnet:') and re.search('urn:btih:([\w]{32,40})', url): if url.startswith('magnet:') and re.search('urn:btih:([\w]{32,40})', url):
return (True, 'RSS feed Parsed correctly') return (True, 'RSS feed Parsed correctly')
else: else:
torrent_file = self.getURL(url) torrent_file = self.getURL(url)
try: try:
bdecode(torrent_file) bdecode(torrent_file)

View File

@ -224,7 +224,7 @@ class SCCProvider(generic.TorrentProvider):
return (title, url) return (title, url)
def getURL(self, url, headers=None): def getURL(self, url, post_data=None, headers=None):
if not self.session: if not self.session:
self._doLogin() self._doLogin()

View File

@ -33,6 +33,7 @@ from sickbeard import classes
from sickbeard import logger from sickbeard import logger
from sickbeard import tvcache from sickbeard import tvcache
from sickbeard import helpers from sickbeard import helpers
from sickbeard import clients
from sickbeard.show_name_helpers import allPossibleShowNames, sanitizeSceneName from sickbeard.show_name_helpers import allPossibleShowNames, sanitizeSceneName
from sickbeard.common import Overview from sickbeard.common import Overview
from sickbeard.exceptions import ex from sickbeard.exceptions import ex
@ -296,7 +297,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
return (title, url) return (title, url)
def getURL(self, url, headers=None): def getURL(self, url, post_data=None, headers=None):
if not headers: if not headers:
headers = {} headers = {}
@ -316,7 +317,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
if r.status_code != 200: if r.status_code != 200:
logger.log(self.name + u" page requested with url " + url + " returned status code is " + str( logger.log(self.name + u" page requested with url " + url + " returned status code is " + str(
r.status_code) + ': ' + requests.clients.http_error_code[r.status_code], logger.WARNING) r.status_code) + ': ' + clients.http_error_code[r.status_code], logger.WARNING)
return None return None
return r.content return r.content

View File

@ -218,7 +218,7 @@ class TorrentDayProvider(generic.TorrentProvider):
return (title, url) return (title, url)
def getURL(self, url, headers=None): def getURL(self, url, post_data=None, headers=None):
if not self.session: if not self.session:
self._doLogin() self._doLogin()

View File

@ -218,7 +218,7 @@ class TorrentLeechProvider(generic.TorrentProvider):
return (title, url) return (title, url)
def getURL(self, url, headers=None): def getURL(self, url, post_data=None, headers=None):
if not self.session: if not self.session:
self._doLogin() self._doLogin()

View File

@ -1,3 +1,5 @@
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
# #
# This file is part of Sick Beard. # This file is part of Sick Beard.
# #
@ -34,7 +36,6 @@ from sickbeard import db
from sickbeard import helpers from sickbeard import helpers
from sickbeard.exceptions import ex from sickbeard.exceptions import ex
from lib import requests from lib import requests
from lib.requests import exceptions
MAX_XEM_AGE_SECS = 86400 # 1 day MAX_XEM_AGE_SECS = 86400 # 1 day

View File

@ -133,7 +133,7 @@ def makeSceneSeasonSearchString(show, segment, extraSearchType=None):
[show.indexerid]) [show.indexerid])
numseasons = int(numseasonsSQlResult[0][0]) numseasons = int(numseasonsSQlResult[0][0])
seasonStrings = ["S%02d" % segment] seasonStrings = ["S%02d" % int(segment)]
showNames = set(makeSceneShowSearchStrings(show)) showNames = set(makeSceneShowSearchStrings(show))

View File

@ -136,7 +136,7 @@ class TVShow(object):
if not self.air_by_date: if not self.air_by_date:
sql_selection = sql_selection + " AND season = " + str(season) sql_selection = sql_selection + " AND season = " + str(season)
else: else:
segment_year, segment_month = map(int, season.split('-')) segment_year, segment_month = map(int, str(season).split('-'))
min_date = datetime.date(segment_year, segment_month, 1) min_date = datetime.date(segment_year, segment_month, 1)
# it's easier to just hard code this than to worry about rolling the year over or making a month length map # it's easier to just hard code this than to worry about rolling the year over or making a month length map

View File

@ -1364,9 +1364,8 @@ class ConfigProviders:
return providerDict[name].getID() + '|' + providerDict[name].configStr() return providerDict[name].getID() + '|' + providerDict[name].configStr()
else: else:
newProvider = rsstorrent.TorrentRssProvider(name, url) newProvider = rsstorrent.TorrentRssProvider(name, url)
sickbeard.TorrentRssProviderList.append(newProvider) sickbeard.torrentRssProviderList.append(newProvider)
return newProvider.getID() + '|' + newProvider.configStr() return newProvider.getID() + '|' + newProvider.configStr()
@cherrypy.expose @cherrypy.expose