1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -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) = ?", ["2", "tvrage"]])
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
# Author: Dani<EFBFBD>l Heimans
# Author: Daniel Heimans
# URL: http://code.google.com/p/sickbeard
#
# This file is part of Sick Beard.
@ -225,7 +225,7 @@ class BTNProvider(generic.TorrentProvider):
if show.air_by_date:
# 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:
# Search for any result which has Sxx in the name
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):
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 = []
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>
# URL: http://code.google.com/p/sickbeard/
#
@ -308,7 +309,7 @@ class GenericProvider:
searchSeason = True
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)
for item in itemList:

View File

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

View File

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

View File

@ -1,3 +1,4 @@
# coding=utf-8
# Author: Mr_Orange <mr_orange@hotmail.it>
# URL: http://code.google.com/p/sickbeard/
#
@ -174,8 +175,7 @@ class KATProvider(generic.TorrentProvider):
if searchSeason:
search_string = {'Season': [], 'Episode': []}
for show_name in set(allPossibleShowNames(show)):
ep_string = show_name + ' S%02d' % int(season) + ' -S%02d' % int(
season) + 'E' + ' category:tv' #1) ShowName SXX -SXXE
ep_string = show_name + ' S%02d' % int(season) + ' -S%02d' % int(season) + 'E' + ' category:tv' #1) ShowName SXX -SXXE
search_string['Season'].append(ep_string)
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)
def getURL(self, url, headers=None):
def getURL(self, url, post_data=None, headers=None):
try:
# 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
if show.air_by_date:
cur_params['season'] = season.split('-')[0]
cur_params['season'] = str(season).split('-')[0]
if 'q' in cur_params:
cur_params['q'] += '.' + season.replace('-', '.')
cur_params['q'] += '.' + str(season).replace('-', '.')
else:
cur_params['q'] = season.replace('-', '.')
cur_params['q'] = str(season).replace('-', '.')
else:
cur_params['season'] = str(season)

View File

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

View File

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

View File

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

View File

@ -51,8 +51,7 @@ class TorrentRssProvider(generic.TorrentProvider):
return self.name + '|' + self.url + '|' + str(int(self.enabled))
def imageName(self):
if ek.ek(os.path.isfile,
ek.ek(os.path.join, sickbeard.PROG_DIR, 'data', 'images', 'providers', self.getID() + '.png')):
if ek.ek(os.path.isfile, ek.ek(os.path.join, sickbeard.PROG_DIR, 'data', 'images', 'providers', self.getID() + '.png')):
return self.getID() + '.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):
return (True, 'RSS feed Parsed correctly')
else:
torrent_file = self.getURL(url)
try:
bdecode(torrent_file)

View File

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

View File

@ -33,6 +33,7 @@ from sickbeard import classes
from sickbeard import logger
from sickbeard import tvcache
from sickbeard import helpers
from sickbeard import clients
from sickbeard.show_name_helpers import allPossibleShowNames, sanitizeSceneName
from sickbeard.common import Overview
from sickbeard.exceptions import ex
@ -296,7 +297,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
return (title, url)
def getURL(self, url, headers=None):
def getURL(self, url, post_data=None, headers=None):
if not headers:
headers = {}
@ -316,7 +317,7 @@ class ThePirateBayProvider(generic.TorrentProvider):
if r.status_code != 200:
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 r.content

View File

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

View File

@ -218,7 +218,7 @@ class TorrentLeechProvider(generic.TorrentProvider):
return (title, url)
def getURL(self, url, headers=None):
def getURL(self, url, post_data=None, headers=None):
if not self.session:
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.
#
@ -34,7 +36,6 @@ from sickbeard import db
from sickbeard import helpers
from sickbeard.exceptions import ex
from lib import requests
from lib.requests import exceptions
MAX_XEM_AGE_SECS = 86400 # 1 day

View File

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

View File

@ -136,7 +136,7 @@ class TVShow(object):
if not self.air_by_date:
sql_selection = sql_selection + " AND season = " + str(season)
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)
# 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()
else:
newProvider = rsstorrent.TorrentRssProvider(name, url)
sickbeard.TorrentRssProviderList.append(newProvider)
sickbeard.torrentRssProviderList.append(newProvider)
return newProvider.getID() + '|' + newProvider.configStr()
@cherrypy.expose