Skip to content

Commit

Permalink
Merge pull request #524 from thezoggy/dev--xbmc_json_cleanup
Browse files Browse the repository at this point in the history
Notifiers: XBMC / Plex - cleanup and update
  • Loading branch information
midgetspy committed Nov 15, 2012
2 parents a469a12 + e40cf04 commit 20a3e18
Show file tree
Hide file tree
Showing 8 changed files with 623 additions and 274 deletions.
19 changes: 12 additions & 7 deletions data/interfaces/default/config_notifications.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<img class="notifier-icon" src="$sbRoot/images/notifiers/xbmc.png" alt="" title="XBMC" />
<h3><a href="http://xbmc.org/" onclick="window.open(this.href, '_blank'); return false;">XBMC</a></h3>
<p>A free and open source cross-platform media center and home entertainment system software with a 10-foot user interface designed for the living-room TV.</p>
<p>For SickBeard to communicate with XBMC you must turn on the <a href="http://wiki.xbmc.org/index.php?title=Webserver" onclick="window.open(this.href, '_blank'); return false;">XBMC Webserver</a>.</p>
</div>
<fieldset class="component-group-list">
<div class="field-pair">
Expand Down Expand Up @@ -55,14 +56,14 @@
<input type="checkbox" name="xbmc_update_library" id="xbmc_update_library" #if $sickbeard.XBMC_UPDATE_LIBRARY then "checked=\"checked\"" else ""# />
<label class="clearfix" for="xbmc_update_library">
<span class="component-title">Update Library</span>
<span class="component-desc">Update XBMC library when we finish a download?</span>
<span class="component-desc">Update library (show's path) when we finish a download?</span>
</label>
</div>
<div class="field-pair">
<input type="checkbox" name="xbmc_update_full" id="xbmc_update_full" #if $sickbeard.XBMC_UPDATE_FULL then "checked=\"checked\"" else ""# />
<label class="clearfix" for="xbmc_update_full">
<span class="component-title">Full Library Update</span>
<span class="component-desc">Do a full library update if per-show fails?</span>
<span class="component-desc">Fall back to a full library update if per-show fails?</span>
</label>
</div>
<div class="field-pair">
Expand All @@ -76,7 +77,7 @@
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">(multiple host strings can be separated by commas)</span>
<span class="component-desc">(multiple host strings must be separated by commas, <br/> the library updates will only be sent to the first host listed)</span>
</label>
</div>
<div class="field-pair">
Expand Down Expand Up @@ -164,6 +165,10 @@
<span class="component-title">&nbsp;</span>
<span class="component-desc">Host running Plex Client (eg. 192.168.1.100:3000)</span>
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">(multiple host strings must be separated by commas)</span>
</label>
</div>
<div class="field-pair">
<label class="nocheck clearfix">
Expand All @@ -186,7 +191,7 @@
</label>
</div>
<div class="testNotification" id="testPLEX-result">Click below to test.</div>
<input type="button" class="btn" value="Test Plex Media Server" id="testPLEX" />
<input type="button" class="btn" value="Test Plex Media Clients" id="testPLEX" />
<input type="submit" class="btn config_submitter" value="Save Changes" />
</div><!-- /content_use_plex -->

Expand Down Expand Up @@ -458,7 +463,7 @@
</div>
<div class="field-pair">
<label class="nocheck clearfix">
<span class="component-title">Prowl priority:</span>
<span class="component-title">Prowl Priority:</span>
<select id="prowl_priority" name="prowl_priority">
<option value="-2" #if $sickbeard.PROWL_PRIORITY == "-2" then 'selected="selected"' else ""#>Very Low</option>
<option value="-1" #if $sickbeard.PROWL_PRIORITY == "-1" then 'selected="selected"' else ""#>Moderate</option>
Expand Down Expand Up @@ -611,7 +616,7 @@
</div>
<div class="field-pair">
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-title">Pushover User Key</span>
<input type="text" name="pushover_userkey" id="pushover_userkey" value="$sickbeard.PUSHOVER_USERKEY" size="35" />
</label>
<label class="nocheck clearfix">
Expand Down Expand Up @@ -713,7 +718,7 @@
</label>
<label class="nocheck clearfix">
<span class="component-title">&nbsp;</span>
<span class="component-desc">Multiple keys must be seperated by a , (comma). Up to a maximum of 5</span>
<span class="component-desc">Multiple keys (maxium of 5) must be seperated by commas</span>
</label>
</div>
<div class="field-pair">
Expand Down
55 changes: 29 additions & 26 deletions sickbeard/notifiers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,61 +20,64 @@

import xbmc
import plex
import nmj
import synoindex
import pytivo

import growl
import prowl
import tweet
from . import libnotify
import notifo
import boxcar
from . import libnotify
import pushover
import nmj
import synoindex
import trakt
import pytivo
import boxcar
import nma

import tweet
import trakt

from sickbeard.common import *

# home theater
xbmc_notifier = xbmc.XBMCNotifier()
plex_notifier = plex.PLEXNotifier()
nmj_notifier = nmj.NMJNotifier()
synoindex_notifier = synoindex.synoIndexNotifier()
pytivo_notifier = pytivo.pyTivoNotifier()
# devices
growl_notifier = growl.GrowlNotifier()
prowl_notifier = prowl.ProwlNotifier()
twitter_notifier = tweet.TwitterNotifier()
notifo_notifier = notifo.NotifoNotifier()
boxcar_notifier = boxcar.BoxcarNotifier()
pushover_notifier = pushover.PushoverNotifier()
libnotify_notifier = libnotify.LibnotifyNotifier()
nmj_notifier = nmj.NMJNotifier()
synoindex_notifier = synoindex.synoIndexNotifier()
trakt_notifier = trakt.TraktNotifier()
pytivo_notifier = pytivo.pyTivoNotifier()
pushover_notifier = pushover.PushoverNotifier()
boxcar_notifier = boxcar.BoxcarNotifier()
nma_notifier = nma.NMA_Notifier()
# online
twitter_notifier = tweet.TwitterNotifier()
trakt_notifier = trakt.TraktNotifier()

notifiers = [
# Libnotify notifier goes first because it doesn't involve blocking on
# network activity.
libnotify_notifier,
libnotify_notifier, # Libnotify notifier goes first because it doesn't involve blocking on network activity.
xbmc_notifier,
plex_notifier,
growl_notifier,
prowl_notifier,
twitter_notifier,
nmj_notifier,
synoindex_notifier,
boxcar_notifier,
pushover_notifier,
trakt_notifier,
pytivo_notifier,
growl_notifier,
prowl_notifier,
notifo_notifier,
pushover_notifier,
boxcar_notifier,
nma_notifier,
twitter_notifier,
trakt_notifier,
]


def notify_download(ep_name):
for n in notifiers:
n.notify_download(ep_name)
notifo_notifier.notify_download(ep_name)


def notify_snatch(ep_name):
for n in notifiers:
n.notify_snatch(ep_name)
notifo_notifier.notify_snatch(ep_name)

3 changes: 2 additions & 1 deletion sickbeard/notifiers/nmj.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def notify_snatch(self, ep_name):
#Not implemented: Start the scanner when snatched does not make any sense

def notify_download(self, ep_name):
self._notifyNMJ()
if sickbeard.USE_NMJ:
self._notifyNMJ()

def test_notify(self, host, database, mount):
return self._sendNMJ(host, database, mount)
Expand Down
Loading

0 comments on commit 20a3e18

Please sign in to comment.