diff --git a/sickbeard/common.py b/sickbeard/common.py index a572926d..dcc466f5 100644 --- a/sickbeard/common.py +++ b/sickbeard/common.py @@ -50,15 +50,15 @@ SEASON_RESULT = -2 NOTIFY_SNATCH = 1 NOTIFY_DOWNLOAD = 2 NOTIFY_SUBTITLE_DOWNLOAD = 3 -NOTIFY_SICKRAGE_UPDATE = 4 -NOTIFY_SICKRAGE_UPDATE_TEXT = 5 +NOTIFY_GIT_UPDATE = 4 +NOTIFY_GIT_UPDATE_TEXT = 5 notifyStrings = {} notifyStrings[NOTIFY_SNATCH] = "Started Download" notifyStrings[NOTIFY_DOWNLOAD] = "Download Finished" notifyStrings[NOTIFY_SUBTITLE_DOWNLOAD] = "Subtitle Download Finished" -notifyStrings[NOTIFY_SICKRAGE_UPDATE] = "SickRage Updated" -notifyStrings[NOTIFY_SICKRAGE_UPDATE_TEXT] = "SickRage updated to version: " +notifyStrings[NOTIFY_GIT_UPDATE] = "SickRage Updated" +notifyStrings[NOTIFY_GIT_UPDATE_TEXT] = "SickRage Updated To Commit#: " ### Episode statuses UNKNOWN = -1 # should never happen diff --git a/sickbeard/name_parser/parser.py b/sickbeard/name_parser/parser.py index 055cf9f0..7bcaafc4 100644 --- a/sickbeard/name_parser/parser.py +++ b/sickbeard/name_parser/parser.py @@ -152,9 +152,10 @@ class NameParser(object): if not match: continue + regex_num = int(re.match('^\d{1,2}', cur_regex_name).group(0)) result = ParseResult(name) result.which_regex = [cur_regex_name] - result.score = 0 + result.score = 0 - regex_num named_groups = match.groupdict().keys() diff --git a/sickbeard/notifiers/__init__.py b/sickbeard/notifiers/__init__.py index 702e4100..b8299fb4 100644 --- a/sickbeard/notifiers/__init__.py +++ b/sickbeard/notifiers/__init__.py @@ -11,7 +11,7 @@ # SickRage is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with SickRage. If not, see . @@ -78,7 +78,7 @@ notifiers = [ prowl_notifier, pushover_notifier, boxcar_notifier, - boxcar2_notifier, + boxcar2_notifier, nma_notifier, pushalot_notifier, pushbullet_notifier, @@ -101,8 +101,8 @@ def notify_subtitle_download(ep_name, lang): def notify_snatch(ep_name): for n in notifiers: n.notify_snatch(ep_name) - -def notify_sickrage_update(new_version = ""): - if sickbeard.NOTIFY_ON_UPDATE: - for n in notifiers: - n.notify_sickrage_update(new_version) + + +def notify_git_update(new_version=""): + for n in notifiers: + n.notify_git_update(new_version) diff --git a/sickbeard/notifiers/boxcar.py b/sickbeard/notifiers/boxcar.py index e65b9068..3ac83a2e 100644 --- a/sickbeard/notifiers/boxcar.py +++ b/sickbeard/notifiers/boxcar.py @@ -23,7 +23,7 @@ import time import sickbeard from sickbeard import logger -from sickbeard.common import notifyStrings, NOTIFY_SNATCH, NOTIFY_DOWNLOAD, NOTIFY_SUBTITLE_DOWNLOAD, NOTIFY_SICKRAGE_UPDATE, NOTIFY_SICKRAGE_UPDATE_TEXT +from sickbeard.common import notifyStrings, NOTIFY_SNATCH, NOTIFY_DOWNLOAD, NOTIFY_SUBTITLE_DOWNLOAD, NOTIFY_GIT_UPDATE, NOTIFY_GIT_UPDATE_TEXT from sickbeard.exceptions import ex API_URL = "https://boxcar.io/devices/providers/fWc4sgSmpcN6JujtBmR6/notifications" @@ -123,10 +123,10 @@ class BoxcarNotifier: if sickbeard.BOXCAR_NOTIFY_ONSUBTITLEDOWNLOAD: self._notifyBoxcar(title, ep_name + ": " + lang) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_BOXCAR: - update_text=notifyStrings[NOTIFY_SICKRAGE_UPDATE_TEXT] - title=notifyStrings[NOTIFY_SICKRAGE_UPDATE] + update_text=notifyStrings[NOTIFY_GIT_UPDATE_TEXT] + title=notifyStrings[NOTIFY_GIT_UPDATE] self._notifyBoxcar(title, update_text + new_version) def _notifyBoxcar(self, title, message, username=None, force=False): diff --git a/sickbeard/notifiers/boxcar2.py b/sickbeard/notifiers/boxcar2.py index 0a727f8f..06f13a2f 100755 --- a/sickbeard/notifiers/boxcar2.py +++ b/sickbeard/notifiers/boxcar2.py @@ -24,7 +24,7 @@ import time import sickbeard from sickbeard import logger -from sickbeard.common import notifyStrings, NOTIFY_SNATCH, NOTIFY_DOWNLOAD, NOTIFY_SUBTITLE_DOWNLOAD, NOTIFY_SICKRAGE_UPDATE, NOTIFY_SICKRAGE_UPDATE_TEXT +from sickbeard.common import notifyStrings, NOTIFY_SNATCH, NOTIFY_DOWNLOAD, NOTIFY_SUBTITLE_DOWNLOAD, NOTIFY_GIT_UPDATE, NOTIFY_GIT_UPDATE_TEXT from sickbeard.exceptions import ex API_URL = "https://new.boxcar.io/api/notifications" @@ -97,10 +97,10 @@ class Boxcar2Notifier: if sickbeard.BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD: self._notifyBoxcar2(title, ep_name + ": " + lang) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_BOXCAR2: - update_text=notifyStrings[NOTIFY_SICKRAGE_UPDATE_TEXT] - title=notifyStrings[NOTIFY_SICKRAGE_UPDATE] + update_text=notifyStrings[NOTIFY_GIT_UPDATE_TEXT] + title=notifyStrings[NOTIFY_GIT_UPDATE] self._notifyBoxcar2(title, update_text + new_version) def _notifyBoxcar2(self, title, message, accesstoken=None): diff --git a/sickbeard/notifiers/emailnotify.py b/sickbeard/notifiers/emailnotify.py index 2358d461..92fe267d 100644 --- a/sickbeard/notifiers/emailnotify.py +++ b/sickbeard/notifiers/emailnotify.py @@ -14,7 +14,7 @@ # SickRage is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with SickRage. If not, see . @@ -141,37 +141,10 @@ class EmailNotifier: logger.log("Download notification sent to [%s] for '%s'" % (to, ep_name), logger.DEBUG) else: logger.log("Download notification ERROR: %s" % self.last_err, logger.ERROR) - - - def notify_sickrage_update(self, new_version = "??"): - """ - Send a notification that an updated version of SickRage has been installed - - """ - if sickbeard.USE_EMAIL: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT] - title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] - - to = self._generate_recepients(show) - if len(to) == 0: - logger.log('Skipping email notify because there are no configured recepients', logger.WARNING) - else: - try: - msg = MIMEMultipart('alternative') - msg.attach(MIMEText( - "

SickRage Notification - " + title + "

\n

" + update_text + new_version + "

\n\n
Powered by SickRage.
", - 'html')) - except: - logger.log("SickRage update notification ERROR: %s" % self.last_err, logger.ERROR) - msg['Subject'] = lang + ' Subtitle Downloaded: ' + ep_name - msg['From'] = sickbeard.EMAIL_FROM - msg['To'] = ','.join(to) - if self._sendmail(sickbeard.EMAIL_HOST, sickbeard.EMAIL_PORT, sickbeard.EMAIL_FROM, sickbeard.EMAIL_TLS, - sickbeard.EMAIL_USER, sickbeard.EMAIL_PASSWORD, to, msg): - logger.log("Download notification sent to [%s] for '%s'" % (to, ep_name), logger.DEBUG) - else: - logger.log("Download notification ERROR: %s" % self.last_err, logger.ERROR) + + def notify_git_update(self, new_version="??"): + pass def _generate_recepients(self, show): addrs = [] @@ -196,7 +169,7 @@ class EmailNotifier: def _sendmail(self, host, port, smtp_from, use_tls, user, pwd, to, msg, smtpDebug=False): logger.log('HOST: %s; PORT: %s; FROM: %s, TLS: %s, USER: %s, PWD: %s, TO: %s' % ( - host, port, smtp_from, use_tls, user, pwd, to), logger.DEBUG) + host, port, smtp_from, use_tls, user, pwd, to), logger.DEBUG) srv = smtplib.SMTP(host, int(port)) if smtpDebug: srv.set_debuglevel(1) diff --git a/sickbeard/notifiers/growl.py b/sickbeard/notifiers/growl.py index 08ff6776..4f151ae1 100644 --- a/sickbeard/notifiers/growl.py +++ b/sickbeard/notifiers/growl.py @@ -44,10 +44,10 @@ class GrowlNotifier: if sickbeard.GROWL_NOTIFY_ONSUBTITLEDOWNLOAD: self._sendGrowl(common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD], ep_name + ": " + lang) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_GROWL: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT] - title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] + update_text=common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT] + title=common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._sendGrowl(title, update_text + new_version) def _send_growl(self, options, message=None): diff --git a/sickbeard/notifiers/libnotify.py b/sickbeard/notifiers/libnotify.py index c4c72499..5f8b96f9 100644 --- a/sickbeard/notifiers/libnotify.py +++ b/sickbeard/notifiers/libnotify.py @@ -93,9 +93,9 @@ class LibnotifyNotifier: if sickbeard.LIBNOTIFY_NOTIFY_ONSUBTITLEDOWNLOAD: self._notify(common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD], ep_name + ": " + lang) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_LIBNOTIFY: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT], title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] + update_text=common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT], title=common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._notify(title, update_text + new_version) def test_notify(self): diff --git a/sickbeard/notifiers/nma.py b/sickbeard/notifiers/nma.py index 25f7d5a6..00cf65ab 100644 --- a/sickbeard/notifiers/nma.py +++ b/sickbeard/notifiers/nma.py @@ -24,10 +24,10 @@ class NMA_Notifier: self._sendNMA(nma_api=None, nma_priority=None, event=common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD], message=ep_name + ": " + lang) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_NMA: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT] - title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] + update_text=common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT] + title=common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._sendNMA(nma_api=None, nma_priority=None, event=title, message=update_text + new_version) def _sendNMA(self, nma_api=None, nma_priority=None, event=None, message=None, force=False): diff --git a/sickbeard/notifiers/nmj.py b/sickbeard/notifiers/nmj.py index 807b36bd..78677859 100644 --- a/sickbeard/notifiers/nmj.py +++ b/sickbeard/notifiers/nmj.py @@ -97,7 +97,7 @@ class NMJNotifier: if sickbeard.USE_NMJ: self._notifyNMJ() - def notify_sickrage_update(self, new_version): + def notify_git_update(self, new_version): return False # Not implemented, no reason to start scanner. diff --git a/sickbeard/notifiers/nmjv2.py b/sickbeard/notifiers/nmjv2.py index fc2f16a0..74323e7e 100644 --- a/sickbeard/notifiers/nmjv2.py +++ b/sickbeard/notifiers/nmjv2.py @@ -43,7 +43,7 @@ class NMJv2Notifier: def notify_subtitle_download(self, ep_name, lang): self._notifyNMJ() - def notify_sickrage_update(self, new_version): + def notify_git_update(self, new_version): return False # Not implemented, no reason to start scanner. diff --git a/sickbeard/notifiers/plex.py b/sickbeard/notifiers/plex.py index f5be0ba4..f3d51c9f 100644 --- a/sickbeard/notifiers/plex.py +++ b/sickbeard/notifiers/plex.py @@ -11,7 +11,7 @@ # SickRage is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with SickRage. If not, see . @@ -35,10 +35,10 @@ from xml.dom import minidom class PLEXNotifier(XBMCNotifier): def _notify_pmc(self, message, title="SickRage", host=None, username=None, password=None, force=False): - # fill in omitted parameters + # fill in omitted parameters if not host: if sickbeard.PLEX_HOST: - host = sickbeard.PLEX_HOST # Use the default Plex host + host = sickbeard.PLEX_HOST # Use the default Plex host else: logger.log(u"No Plex host specified, check your settings", logger.DEBUG) return False @@ -52,7 +52,8 @@ class PLEXNotifier(XBMCNotifier): logger.log("Notification for Plex not enabled, skipping this notification", logger.DEBUG) return False - return self._notify_xbmc(message=message, title=title, host=host, username=username, password=password, force=True) + return self._notify_xbmc(message=message, title=title, host=host, username=username, password=password, + force=True) def notify_snatch(self, ep_name): if sickbeard.PLEX_NOTIFY_ONSNATCH: @@ -65,11 +66,11 @@ class PLEXNotifier(XBMCNotifier): def notify_subtitle_download(self, ep_name, lang): if sickbeard.PLEX_NOTIFY_ONSUBTITLEDOWNLOAD: self._notify_pmc(ep_name + ": " + lang, common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD]) - - def notify_sickrage_update(self, new_version = "??"): + + def notify_git_update(self, new_version="??"): if sickbeard.USE_PLEX: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT] - title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] + update_text = common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT] + title = common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._notify_pmc(update_text + new_version, title) def test_notify(self, host, username, password): @@ -117,4 +118,5 @@ class PLEXNotifier(XBMCNotifier): return True + notifier = PLEXNotifier diff --git a/sickbeard/notifiers/prowl.py b/sickbeard/notifiers/prowl.py index 19355839..9ef85c54 100644 --- a/sickbeard/notifiers/prowl.py +++ b/sickbeard/notifiers/prowl.py @@ -52,10 +52,10 @@ class ProwlNotifier: self._sendProwl(prowl_api=None, prowl_priority=None, event=common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD], message=ep_name + ": " + lang) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_PROWL: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT] - title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] + update_text=common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT] + title=common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._sendProwl(prowl_api=None, prowl_priority=None, event=title, message=update_text + new_version) diff --git a/sickbeard/notifiers/pushalot.py b/sickbeard/notifiers/pushalot.py index e0003b49..40515564 100644 --- a/sickbeard/notifiers/pushalot.py +++ b/sickbeard/notifiers/pushalot.py @@ -46,10 +46,10 @@ class PushalotNotifier: event=common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD], message=ep_name + ": " + lang) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_PUSHALOT: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT] - title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] + update_text=common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT] + title=common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._sendPushalot(pushalot_authorizationtoken=None, event=title, message=update_text + new_version) diff --git a/sickbeard/notifiers/pushbullet.py b/sickbeard/notifiers/pushbullet.py index 4c0bd84e..81c51bc5 100644 --- a/sickbeard/notifiers/pushbullet.py +++ b/sickbeard/notifiers/pushbullet.py @@ -49,10 +49,10 @@ class PushbulletNotifier: self._sendPushbullet(pushbullet_api=None, event=common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD] + " : " + ep_name + " : " + lang, message=ep_name + ": " + lang, notificationType="note", method="POST") - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_PUSHBULLET: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT] - title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] + update_text=common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT] + title=common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._sendPushbullet(pushbullet_api=None, event=title, message=update_text + new_version, method="POST") def _sendPushbullet(self, pushbullet_api=None, pushbullet_device=None, event=None, message=None, diff --git a/sickbeard/notifiers/pushover.py b/sickbeard/notifiers/pushover.py index 9458b18f..19dde0d6 100644 --- a/sickbeard/notifiers/pushover.py +++ b/sickbeard/notifiers/pushover.py @@ -23,7 +23,7 @@ import time import sickbeard from sickbeard import logger -from sickbeard.common import notifyStrings, NOTIFY_SNATCH, NOTIFY_DOWNLOAD, NOTIFY_SUBTITLE_DOWNLOAD, NOTIFY_SICKRAGE_UPDATE, NOTIFY_SICKRAGE_UPDATE_TEXT +from sickbeard.common import notifyStrings, NOTIFY_SNATCH, NOTIFY_DOWNLOAD, NOTIFY_SUBTITLE_DOWNLOAD, NOTIFY_GIT_UPDATE, NOTIFY_GIT_UPDATE_TEXT from sickbeard.exceptions import ex API_URL = "https://api.pushover.net/1/messages.json" @@ -120,10 +120,10 @@ class PushoverNotifier: if sickbeard.PUSHOVER_NOTIFY_ONSUBTITLEDOWNLOAD: self._notifyPushover(title, ep_name + ": " + lang) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_PUSHOVER: - update_text=notifyStrings[NOTIFY_SICKRAGE_UPDATE_TEXT] - title=notifyStrings[NOTIFY_SICKRAGE_UPDATE] + update_text=notifyStrings[NOTIFY_GIT_UPDATE_TEXT] + title=notifyStrings[NOTIFY_GIT_UPDATE] self._notifyPushover(title, update_text + new_version) def _notifyPushover(self, title, message, userKey=None, apiKey=None, force=False): diff --git a/sickbeard/notifiers/pytivo.py b/sickbeard/notifiers/pytivo.py index 14a60268..a38accb2 100644 --- a/sickbeard/notifiers/pytivo.py +++ b/sickbeard/notifiers/pytivo.py @@ -37,7 +37,7 @@ class pyTivoNotifier: def notify_subtitle_download(self, ep_name, lang): pass - def notify_sickrage_update(self, new_version): + def notify_git_update(self, new_version): pass def update_library(self, ep_obj): diff --git a/sickbeard/notifiers/synoindex.py b/sickbeard/notifiers/synoindex.py index 10c46636..626c0771 100644 --- a/sickbeard/notifiers/synoindex.py +++ b/sickbeard/notifiers/synoindex.py @@ -38,7 +38,7 @@ class synoIndexNotifier: def notify_subtitle_download(self, ep_name, lang): pass - def notify_sickrage_update(self, new_version): + def notify_git_update(self, new_version): pass def moveFolder(self, old_path, new_path): diff --git a/sickbeard/notifiers/synologynotifier.py b/sickbeard/notifiers/synologynotifier.py index cb722e85..a67c769f 100644 --- a/sickbeard/notifiers/synologynotifier.py +++ b/sickbeard/notifiers/synologynotifier.py @@ -41,10 +41,10 @@ class synologyNotifier: if sickbeard.SYNOLOGYNOTIFIER_NOTIFY_ONSUBTITLEDOWNLOAD: self._send_synologyNotifier(ep_name + ": " + lang, common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD]) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_SYNOLOGYNOTIFIER: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT] - title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] + update_text=common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT] + title=common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._send_synologyNotifier(update_text + new_version, title) def _send_synologyNotifier(self, message, title): diff --git a/sickbeard/notifiers/trakt.py b/sickbeard/notifiers/trakt.py index 890856a6..a6c0946a 100644 --- a/sickbeard/notifiers/trakt.py +++ b/sickbeard/notifiers/trakt.py @@ -35,7 +35,7 @@ class TraktNotifier: def notify_subtitle_download(self, ep_name, lang): pass - def notify_sickrage_update(self, new_version): + def notify_git_update(self, new_version): pass def update_library(self, ep_obj): diff --git a/sickbeard/notifiers/tweet.py b/sickbeard/notifiers/tweet.py index ebfd2251..b12c4219 100644 --- a/sickbeard/notifiers/tweet.py +++ b/sickbeard/notifiers/tweet.py @@ -52,10 +52,10 @@ class TwitterNotifier: if sickbeard.TWITTER_NOTIFY_ONSUBTITLEDOWNLOAD: self._notifyTwitter(common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD] + ' ' + ep_name + ": " + lang) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_TWITTER: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT] - title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] + update_text=common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT] + title=common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._notifyTwitter(title + " - " + update_text + new_version) def test_notify(self): diff --git a/sickbeard/notifiers/xbmc.py b/sickbeard/notifiers/xbmc.py index a433402b..a48be434 100644 --- a/sickbeard/notifiers/xbmc.py +++ b/sickbeard/notifiers/xbmc.py @@ -513,10 +513,10 @@ class XBMCNotifier: if sickbeard.XBMC_NOTIFY_ONSUBTITLEDOWNLOAD: self._notify_xbmc(ep_name + ": " + lang, common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD]) - def notify_sickrage_update(self, new_version = "??"): + def notify_git_update(self, new_version = "??"): if sickbeard.USE_XBMC: - update_text=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE_TEXT] - title=common.notifyStrings[common.NOTIFY_SICKRAGE_UPDATE] + update_text=common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT] + title=common.notifyStrings[common.NOTIFY_GIT_UPDATE] self._notify_xbmc(update_text + new_version, title) def test_notify(self, host, username, password): diff --git a/sickbeard/show_name_helpers.py b/sickbeard/show_name_helpers.py index e99ac8bd..c1d6d118 100644 --- a/sickbeard/show_name_helpers.py +++ b/sickbeard/show_name_helpers.py @@ -265,29 +265,30 @@ def allPossibleShowNames(show, season=-1): if season in [-1, 1]: showNames.append(show.name) - newShowNames = [] - - country_list = common.countryList - country_list.update(dict(zip(common.countryList.values(), common.countryList.keys()))) - - # if we have "Show Name Australia" or "Show Name (Australia)" this will add "Show Name (AU)" for - # any countries defined in common.countryList - # (and vice versa) if not show.is_anime: + newShowNames = [] + country_list = common.countryList + country_list.update(dict(zip(common.countryList.values(), common.countryList.keys()))) for curName in set(showNames): if not curName: continue + + # if we have "Show Name Australia" or "Show Name (Australia)" this will add "Show Name (AU)" for + # any countries defined in common.countryList + # (and vice versa) for curCountry in country_list: if curName.endswith(' ' + curCountry): newShowNames.append(curName.replace(' ' + curCountry, ' (' + country_list[curCountry] + ')')) elif curName.endswith(' (' + curCountry + ')'): newShowNames.append(curName.replace(' (' + curCountry + ')', ' (' + country_list[curCountry] + ')')) + # if we have "Show Name (2013)" this will strip the (2013) show year from the show name + #newShowNames.append(re.sub('\(\d{4}\)','',curName)) + showNames += newShowNames return showNames - def determineReleaseName(dir_name=None, nzb_name=None): """Determine a release name from an nzb and/or folder name""" diff --git a/sickbeard/versionChecker.py b/sickbeard/versionChecker.py index 2aea8e25..4e9e60dc 100644 --- a/sickbeard/versionChecker.py +++ b/sickbeard/versionChecker.py @@ -262,7 +262,7 @@ class WindowsUpdateManager(UpdateManager): shutil.move(old_update_path, new_update_path) # Notify update successful - notifiers.notify_sickrage_update(sickbeard.NEWEST_VERSION_STRING) + notifiers.notify_git_update(sickbeard.NEWEST_VERSION_STRING) except Exception, e: logger.log(u"Error while trying to update: " + ex(e), logger.ERROR) @@ -513,7 +513,8 @@ class GitUpdateManager(UpdateManager): if exit_status == 0: # Notify update successful - notifiers.notify_sickrage_update(self._newest_commit_hash[:10]) + if sickbeard.NOTIFY_ON_UPDATE: + notifiers.notify_git_update(self._newest_commit_hash[:10]) return True return False @@ -720,6 +721,6 @@ class SourceUpdateManager(UpdateManager): return False # Notify update successful - notifiers.notify_sickrage_update(sickbeard.NEWEST_VERSION_STRING) + notifiers.notify_git_update(sickbeard.NEWEST_VERSION_STRING) return True