Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Implementation of pyTivo notification #268

Closed
wants to merge 2 commits into from

7 participants

gordonturner kbgators thezoggy Antoine Bertin Nobrumski lwpack Nic Wolfe
gordonturner

Notifier for pyTivo to allow automatic uploading of shows to a TiVo. Requires a working install of pyTivo.

Implementation of pyTivo notification
Notifier for pyTivo to allow automatic uploading of shows to a TiVo.  Requires a working install of pyTivo.
b494323
kbgators

Thanks for all your work!

thezoggy

not sure why you modified boxcar and trakt lines...

gordonturner

@thezoggy End of line character change, side effect of using Lion FileMerge tool.

@kbgators Thanks!

gordonturner

Is there anything else I can do to get this accepted into Sick-Beard?

Antoine Bertin

Wait more

gordonturner

Don't have a Premiere to test with, so don't know what the update has changed.

Hopefully they wouldn't break the HMO and GoBack server functionality.

This notifier calls pytivo which is based on TiVo's own upload functionality used by their desktop software.

Nobrumski

The TiVo update has changed the way some metadata is handled on the Premiere but PyTiVo still works fine with the update. Also the main fork of PyTiVo is updated pretty consistently, https://github.com/wmcbrine/pytivo

lwpack

When is this going to get into Sickbeard? I don't understand the reluctance to incorporate this. For those of us with a Tivo, this is much needed functionality.

kbgators

yes, same question here. Just waiting.

Nic Wolfe
Owner

Bad line endings are currently preventing this from being pulled automatically - I would have to pull, fix it myself, and then test which I Haven't had time to do.

gordonturner

K, didn't realize the line endings were preventing automatic pull, will correct tomorrow.

gordonturner

Had a family emergency over the weekend, will try and fix this asap.

kbgators

Thanks. Btw this is working with my TiVo Premier

gordonturner gordonturner closed this February 05, 2012
gordonturner

New pull request here: #291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Jan 01, 2012
Implementation of pyTivo notification
Notifier for pyTivo to allow automatic uploading of shows to a TiVo.  Requires a working install of pyTivo.
b494323
Feb 05, 2012
Merge branch 'master' of https://github.com/midgetspy/Sick-Beard into…
… pytivo_notification
bee6463
This page is out of date. Refresh to see the latest.
BIN  data/images/notifiers/pytivo.gif
65  data/interfaces/default/config_notifications.tmpl
@@ -733,6 +733,71 @@
733 733
                     </fieldset>
734 734
                 </div><!-- /component-group //-->
735 735
 
  736
+
  737
+                <div id="core-component-group10" class="component-group clearfix">
  738
+                
  739
+                    <div class="component-group-desc">
  740
+                        <h3><a href="http://pytivo.sourceforge.net/wiki/index.php/PyTivo" onclick="window.open(this.href, '_blank'); return false;"><img src="$sbRoot/images/notifiers/pytivo.gif" alt="pyTivo" title="pyTivo" width="16" height="16" />pyTivo</a></h3>
  741
+                        <p>pyTivo is both an HMO and GoBack server.  This notifier will load the completed downloads to your Tivo.</p>
  742
+                    </div>
  743
+
  744
+                    <fieldset class="component-group-list">
  745
+                        <div class="field-pair">
  746
+                            <input type="checkbox" class="enabler" name="use_pytivo" id="use_pytivo" #if $sickbeard.USE_PYTIVO then "checked=\"checked\"" else ""# /> 
  747
+                            <label class="clearfix" for="use_pytivo">
  748
+                                <span class="component-title">Enable</span>
  749
+                                <span class="component-desc">Should Sick Beard send notifications to pyTivo?</span>
  750
+                            </label>
  751
+                            <label class="nocheck clearfix" for="use_pytivo">
  752
+                                <span class="component-title">&nbsp;</span>
  753
+                                <span class="component-desc">Note: Requires the downloaded files to be accessible to pyTivo, eg on same server.</span>
  754
+                            </label>
  755
+                        </div>
  756
+						
  757
+                        <div id="content_use_pytivo">
  758
+                        
  759
+							<div class="field-pair">
  760
+								<label class="nocheck clearfix">
  761
+									<span class="component-title">pyTivo IP:Port</span>
  762
+									<input type="text" name="pytivo_host" id="pytivo_host" value="$sickbeard.PYTIVO_HOST" size="35" />
  763
+								</label>
  764
+								<label class="nocheck clearfix">
  765
+									<span class="component-title">&nbsp;</span>
  766
+									<span class="component-desc">Host running pyTivo (eg. 192.168.1.1:9032)</span>
  767
+								</label>
  768
+							</div>
  769
+
  770
+							<div class="field-pair">
  771
+								<label class="nocheck clearfix">
  772
+									<span class="component-title">pyTivo Share name</span>
  773
+									<input type="text" name="pytivo_share_name" id="pytivo_share_name" value="$sickbeard.PYTIVO_SHARE_NAME" size="35" />
  774
+								</label>
  775
+								<label class="nocheck clearfix">
  776
+									<span class="component-title">&nbsp;</span>
  777
+									<span class="component-desc">Value used in pyTivo Web Configuration to name the share.</span>
  778
+								</label>
  779
+							</div>
  780
+
  781
+
  782
+							<div class="field-pair">
  783
+								<label class="nocheck clearfix">
  784
+									<span class="component-title">Tivo Name</span>
  785
+									<input type="text" name="pytivo_tivo_name" id="pytivo_tivo_name" value="$sickbeard.PYTIVO_TIVO_NAME" size="35" />
  786
+								</label>
  787
+								<label class="nocheck clearfix">
  788
+									<span class="component-title">&nbsp;</span>
  789
+									<span class="component-desc">Messages & Settings > Account & System Information > System Information > DVR name</span>
  790
+								</label>
  791
+							</div>
  792
+							
  793
+							<input type="submit" class="config_submitter" value="Save Changes" />
  794
+                        </div><!-- /enabler_pytivo //-->
  795
+                        
  796
+                    </fieldset>
  797
+                </div><!-- /component-group //-->
  798
+
  799
+
  800
+
736 801
             <br/><input type="submit" class="config_submitter" value="Save Changes" /><br/>
737 802
 
738 803
             </div><!-- /config-components //-->
112  sickbeard/__init__.py
@@ -197,10 +197,10 @@
197 197
 XBMC_USERNAME = None
198 198
 XBMC_PASSWORD = None
199 199
 
200  
-USE_PLEX = False
  200
+USE_PLEX = False
201 201
 PLEX_NOTIFY_ONSNATCH = False
202 202
 PLEX_NOTIFY_ONDOWNLOAD = False
203  
-PLEX_UPDATE_LIBRARY = False
  203
+PLEX_UPDATE_LIBRARY = False
204 204
 PLEX_SERVER_HOST = None
205 205
 PLEX_HOST = None
206 206
 PLEX_USERNAME = None
@@ -231,13 +231,13 @@
231 231
 NOTIFO_USERNAME = None
232 232
 NOTIFO_APISECRET = None
233 233
 NOTIFO_PREFIX = None
234  
-
235  
-USE_BOXCAR = False
236  
-BOXCAR_NOTIFY_ONSNATCH = False
237  
-BOXCAR_NOTIFY_ONDOWNLOAD = False
238  
-BOXCAR_USERNAME = None
239  
-BOXCAR_PASSWORD = None
240  
-BOXCAR_PREFIX = None
  234
+
  235
+USE_BOXCAR = False
  236
+BOXCAR_NOTIFY_ONSNATCH = False
  237
+BOXCAR_NOTIFY_ONDOWNLOAD = False
  238
+BOXCAR_USERNAME = None
  239
+BOXCAR_PASSWORD = None
  240
+BOXCAR_PREFIX = None
241 241
 
242 242
 USE_LIBNOTIFY = False
243 243
 LIBNOTIFY_NOTIFY_ONSNATCH = False
@@ -253,7 +253,15 @@
253 253
 USE_TRAKT = False
254 254
 TRAKT_USERNAME = None
255 255
 TRAKT_PASSWORD = None
256  
-TRAKT_API = ''
  256
+TRAKT_API = ''
  257
+
  258
+USE_PYTIVO = False
  259
+PYTIVO_NOTIFY_ONSNATCH = False
  260
+PYTIVO_NOTIFY_ONDOWNLOAD = False
  261
+PYTIVO_UPDATE_LIBRARY = False
  262
+PYTIVO_HOST = ''
  263
+PYTIVO_SHARE_NAME = ''
  264
+PYTIVO_TIVO_NAME = ''
257 265
 
258 266
 COMING_EPS_LAYOUT = None
259 267
 COMING_EPS_DISPLAY_PAUSED = None
@@ -359,8 +367,8 @@ def initialize(consoleLogging=True):
359 367
                 SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_HOST, \
360 368
                 NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_HOST, currentSearchScheduler, backlogSearchScheduler, \
361 369
                 USE_XBMC, XBMC_NOTIFY_ONSNATCH, XBMC_NOTIFY_ONDOWNLOAD, XBMC_UPDATE_FULL, \
362  
-                XBMC_UPDATE_LIBRARY, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, \
363  
-                USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, \
  370
+                XBMC_UPDATE_LIBRARY, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, \
  371
+                USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, \
364 372
                 USE_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_UPDATE_LIBRARY, \
365 373
                 PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, \
366 374
                 showUpdateScheduler, __INITIALIZED__, LAUNCH_BROWSER, showList, loadingShowList, \
@@ -369,6 +377,7 @@ def initialize(consoleLogging=True):
369 377
                 QUALITY_DEFAULT, SEASON_FOLDERS_FORMAT, SEASON_FOLDERS_DEFAULT, STATUS_DEFAULT, \
370 378
                 GROWL_NOTIFY_ONSNATCH, GROWL_NOTIFY_ONDOWNLOAD, TWITTER_NOTIFY_ONSNATCH, TWITTER_NOTIFY_ONDOWNLOAD, \
371 379
                 USE_GROWL, GROWL_HOST, GROWL_PASSWORD, USE_PROWL, PROWL_NOTIFY_ONSNATCH, PROWL_NOTIFY_ONDOWNLOAD, PROWL_API, PROWL_PRIORITY, PROG_DIR, NZBMATRIX, NZBMATRIX_USERNAME, \
  380
+                USE_PYTIVO, PYTIVO_NOTIFY_ONSNATCH, PYTIVO_NOTIFY_ONDOWNLOAD, PYTIVO_UPDATE_LIBRARY, PYTIVO_HOST, PYTIVO_SHARE_NAME, PYTIVO_TIVO_NAME, \
372 381
                 NZBMATRIX_APIKEY, versionCheckScheduler, VERSION_NOTIFY, PROCESS_AUTOMATICALLY, \
373 382
                 KEEP_PROCESSED_DIR, TV_DOWNLOAD_DIR, TVDB_BASE_URL, MIN_SEARCH_FREQUENCY, \
374 383
                 showQueueScheduler, searchQueueScheduler, ROOT_DIRS, \
@@ -378,7 +387,7 @@ def initialize(consoleLogging=True):
378 387
                 NZBSRUS, NZBSRUS_UID, NZBSRUS_HASH, NAMING_QUALITY, providerList, newznabProviderList, \
379 388
                 NAMING_DATES, EXTRA_SCRIPTS, USE_TWITTER, TWITTER_USERNAME, TWITTER_PASSWORD, TWITTER_PREFIX, \
380 389
                 USE_NOTIFO, NOTIFO_USERNAME, NOTIFO_APISECRET, NOTIFO_NOTIFY_ONDOWNLOAD, NOTIFO_NOTIFY_ONSNATCH, \
381  
-                USE_BOXCAR, BOXCAR_USERNAME, BOXCAR_PASSWORD, BOXCAR_NOTIFY_ONDOWNLOAD, BOXCAR_NOTIFY_ONSNATCH, \
  390
+                USE_BOXCAR, BOXCAR_USERNAME, BOXCAR_PASSWORD, BOXCAR_NOTIFY_ONDOWNLOAD, BOXCAR_NOTIFY_ONSNATCH, \
382 391
                 USE_LIBNOTIFY, LIBNOTIFY_NOTIFY_ONSNATCH, LIBNOTIFY_NOTIFY_ONDOWNLOAD, USE_NMJ, NMJ_HOST, NMJ_DATABASE, NMJ_MOUNT, USE_SYNOINDEX, \
383 392
                 USE_BANNER, USE_LISTVIEW, METADATA_XBMC, METADATA_MEDIABROWSER, METADATA_PS3, metadata_provider_dict, \
384 393
                 NEWZBIN, NEWZBIN_USERNAME, NEWZBIN_PASSWORD, GIT_PATH, MOVE_ASSOCIATED_FILES, \
@@ -395,12 +404,13 @@ def initialize(consoleLogging=True):
395 404
         CheckSection('SABnzbd')
396 405
         CheckSection('NZBget')
397 406
         CheckSection('XBMC')
398  
-        CheckSection('PLEX')
  407
+        CheckSection('PLEX')
399 408
         CheckSection('Growl')
400 409
         CheckSection('Prowl')
401 410
         CheckSection('Twitter')
402 411
         CheckSection('NMJ')
403 412
         CheckSection('Synology')
  413
+        CheckSection('pyTivo')
404 414
 
405 415
         LOG_DIR = check_setting_str(CFG, 'General', 'log_dir', 'Logs')
406 416
         if not helpers.makeDir(LOG_DIR):
@@ -549,10 +559,10 @@ def initialize(consoleLogging=True):
549 559
         XBMC_USERNAME = check_setting_str(CFG, 'XBMC', 'xbmc_username', '')
550 560
         XBMC_PASSWORD = check_setting_str(CFG, 'XBMC', 'xbmc_password', '')
551 561
 
552  
-        USE_PLEX = bool(check_setting_int(CFG, 'Plex', 'use_plex', 0))
  562
+        USE_PLEX = bool(check_setting_int(CFG, 'Plex', 'use_plex', 0))
553 563
         PLEX_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Plex', 'plex_notify_onsnatch', 0))
554 564
         PLEX_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Plex', 'plex_notify_ondownload', 0))
555  
-        PLEX_UPDATE_LIBRARY = bool(check_setting_int(CFG, 'Plex', 'plex_update_library', 0))
  565
+        PLEX_UPDATE_LIBRARY = bool(check_setting_int(CFG, 'Plex', 'plex_update_library', 0))
556 566
         PLEX_SERVER_HOST = check_setting_str(CFG, 'Plex', 'plex_server_host', '')
557 567
         PLEX_HOST = check_setting_str(CFG, 'Plex', 'plex_host', '')
558 568
         PLEX_USERNAME = check_setting_str(CFG, 'Plex', 'plex_username', '')
@@ -582,11 +592,11 @@ def initialize(consoleLogging=True):
582 592
         NOTIFO_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Notifo', 'notifo_notify_ondownload', 0))
583 593
         NOTIFO_USERNAME = check_setting_str(CFG, 'Notifo', 'notifo_username', '')
584 594
         NOTIFO_APISECRET = check_setting_str(CFG, 'Notifo', 'notifo_apisecret', '')
585  
-
586  
-        USE_BOXCAR = bool(check_setting_int(CFG, 'Boxcar', 'use_boxcar', 0))
587  
-        BOXCAR_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Boxcar', 'boxcar_notify_onsnatch', 0))
588  
-        BOXCAR_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Boxcar', 'boxcar_notify_ondownload', 0))
589  
-        BOXCAR_USERNAME = check_setting_str(CFG, 'Boxcar', 'boxcar_username', '')
  595
+
  596
+        USE_BOXCAR = bool(check_setting_int(CFG, 'Boxcar', 'use_boxcar', 0))
  597
+        BOXCAR_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Boxcar', 'boxcar_notify_onsnatch', 0))
  598
+        BOXCAR_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'Boxcar', 'boxcar_notify_ondownload', 0))
  599
+        BOXCAR_USERNAME = check_setting_str(CFG, 'Boxcar', 'boxcar_username', '')
590 600
 
591 601
         USE_LIBNOTIFY = bool(check_setting_int(CFG, 'Libnotify', 'use_libnotify', 0))
592 602
         LIBNOTIFY_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Libnotify', 'libnotify_notify_onsnatch', 0))
@@ -597,12 +607,21 @@ def initialize(consoleLogging=True):
597 607
         NMJ_DATABASE = check_setting_str(CFG, 'NMJ', 'nmj_database', '')
598 608
         NMJ_MOUNT = check_setting_str(CFG, 'NMJ', 'nmj_mount', '')
599 609
 
600  
-        USE_SYNOINDEX = bool(check_setting_int(CFG, 'Synology', 'use_synoindex', 0))
601  
-
602  
-        USE_TRAKT = bool(check_setting_int(CFG, 'Trakt', 'use_trakt', 0))
603  
-        TRAKT_USERNAME = check_setting_str(CFG, 'Trakt', 'trakt_username', '')
604  
-        TRAKT_PASSWORD = check_setting_str(CFG, 'Trakt', 'trakt_password', '')
  610
+        USE_SYNOINDEX = bool(check_setting_int(CFG, 'Synology', 'use_synoindex', 0))
  611
+
  612
+        USE_TRAKT = bool(check_setting_int(CFG, 'Trakt', 'use_trakt', 0))
  613
+        TRAKT_USERNAME = check_setting_str(CFG, 'Trakt', 'trakt_username', '')
  614
+        TRAKT_PASSWORD = check_setting_str(CFG, 'Trakt', 'trakt_password', '')
605 615
         TRAKT_API = check_setting_str(CFG, 'Trakt', 'trakt_api', '')
  616
+        USE_SYNOINDEX = bool(check_setting_int(CFG, 'Synology', 'use_synoindex', 0))
  617
+        
  618
+        USE_PYTIVO = bool(check_setting_int(CFG, 'pyTivo', 'use_pytivo', 0))
  619
+        PYTIVO_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'pyTivo', 'pytivo_notify_onsnatch', 0))
  620
+        PYTIVO_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'pyTivo', 'pytivo_notify_ondownload', 0))
  621
+        PYTIVO_UPDATE_LIBRARY = bool(check_setting_int(CFG, 'pyTivo', 'pyTivo_update_library', 0))
  622
+        PYTIVO_HOST = check_setting_str(CFG, 'pyTivo', 'pytivo_host', '')
  623
+        PYTIVO_SHARE_NAME = check_setting_str(CFG, 'pyTivo', 'pytivo_share_name', '')
  624
+        PYTIVO_TIVO_NAME = check_setting_str(CFG, 'pyTivo', 'pytivo_tivo_name', '')
606 625
 
607 626
         GIT_PATH = check_setting_str(CFG, 'General', 'git_path', '')
608 627
 
@@ -1050,12 +1069,12 @@ def save_config():
1050 1069
     new_config['XBMC']['xbmc_host'] = XBMC_HOST
1051 1070
     new_config['XBMC']['xbmc_username'] = XBMC_USERNAME
1052 1071
     new_config['XBMC']['xbmc_password'] = XBMC_PASSWORD
1053  
-
1054  
-    new_config['Plex'] = {}
1055  
-    new_config['Plex']['use_plex'] = int(USE_PLEX)
  1072
+
  1073
+    new_config['Plex'] = {}
  1074
+    new_config['Plex']['use_plex'] = int(USE_PLEX)
1056 1075
     new_config['Plex']['plex_notify_onsnatch'] = int(PLEX_NOTIFY_ONSNATCH)
1057 1076
     new_config['Plex']['plex_notify_ondownload'] = int(PLEX_NOTIFY_ONDOWNLOAD)
1058  
-    new_config['Plex']['plex_update_library'] = int(PLEX_UPDATE_LIBRARY)
  1077
+    new_config['Plex']['plex_update_library'] = int(PLEX_UPDATE_LIBRARY)
1059 1078
     new_config['Plex']['plex_server_host'] = PLEX_SERVER_HOST
1060 1079
     new_config['Plex']['plex_host'] = PLEX_HOST
1061 1080
     new_config['Plex']['plex_username'] = PLEX_USERNAME
@@ -1089,12 +1108,12 @@ def save_config():
1089 1108
     new_config['Notifo']['notifo_notify_ondownload'] = int(NOTIFO_NOTIFY_ONDOWNLOAD)
1090 1109
     new_config['Notifo']['notifo_username'] = NOTIFO_USERNAME
1091 1110
     new_config['Notifo']['notifo_apisecret'] = NOTIFO_APISECRET
1092  
-
1093  
-    new_config['Boxcar'] = {}
1094  
-    new_config['Boxcar']['use_boxcar'] = int(USE_BOXCAR)
1095  
-    new_config['Boxcar']['boxcar_notify_onsnatch'] = int(BOXCAR_NOTIFY_ONSNATCH)
1096  
-    new_config['Boxcar']['boxcar_notify_ondownload'] = int(BOXCAR_NOTIFY_ONDOWNLOAD)
1097  
-    new_config['Boxcar']['boxcar_username'] = BOXCAR_USERNAME
  1111
+
  1112
+    new_config['Boxcar'] = {}
  1113
+    new_config['Boxcar']['use_boxcar'] = int(USE_BOXCAR)
  1114
+    new_config['Boxcar']['boxcar_notify_onsnatch'] = int(BOXCAR_NOTIFY_ONSNATCH)
  1115
+    new_config['Boxcar']['boxcar_notify_ondownload'] = int(BOXCAR_NOTIFY_ONDOWNLOAD)
  1116
+    new_config['Boxcar']['boxcar_username'] = BOXCAR_USERNAME
1098 1117
 
1099 1118
     new_config['Libnotify'] = {}
1100 1119
     new_config['Libnotify']['use_libnotify'] = int(USE_LIBNOTIFY)
@@ -1108,14 +1127,23 @@ def save_config():
1108 1127
     new_config['NMJ']['nmj_mount'] = NMJ_MOUNT
1109 1128
 
1110 1129
     new_config['Synology'] = {}
1111  
-    new_config['Synology']['use_synoindex'] = int(USE_SYNOINDEX)
1112  
-
1113  
-    new_config['Trakt'] = {}
1114  
-    new_config['Trakt']['use_trakt'] = int(USE_TRAKT)
1115  
-    new_config['Trakt']['trakt_username'] = TRAKT_USERNAME
1116  
-    new_config['Trakt']['trakt_password'] = TRAKT_PASSWORD
  1130
+    new_config['Synology']['use_synoindex'] = int(USE_SYNOINDEX)
  1131
+
  1132
+    new_config['Trakt'] = {}
  1133
+    new_config['Trakt']['use_trakt'] = int(USE_TRAKT)
  1134
+    new_config['Trakt']['trakt_username'] = TRAKT_USERNAME
  1135
+    new_config['Trakt']['trakt_password'] = TRAKT_PASSWORD
1117 1136
     new_config['Trakt']['trakt_api'] = TRAKT_API
1118 1137
 
  1138
+    new_config['pyTivo'] = {}
  1139
+    new_config['pyTivo']['use_pytivo'] = int(USE_PYTIVO)
  1140
+    new_config['pyTivo']['pytivo_notify_onsnatch'] = int(PYTIVO_NOTIFY_ONSNATCH)
  1141
+    new_config['pyTivo']['pytivo_notify_ondownload'] = int(PYTIVO_NOTIFY_ONDOWNLOAD)
  1142
+    new_config['pyTivo']['pyTivo_update_library'] = int(PYTIVO_UPDATE_LIBRARY)
  1143
+    new_config['pyTivo']['pytivo_host'] = PYTIVO_HOST
  1144
+    new_config['pyTivo']['pytivo_share_name'] = PYTIVO_SHARE_NAME
  1145
+    new_config['pyTivo']['pytivo_tivo_name'] = PYTIVO_TIVO_NAME
  1146
+
1119 1147
     new_config['Newznab'] = {}
1120 1148
     new_config['Newznab']['newznab_data'] = '!!!'.join([x.configStr() for x in newznabProviderList])
1121 1149
 
5  sickbeard/metadata/tivo.py 100644 → 100755
@@ -26,6 +26,7 @@
26 26
 from sickbeard import logger, exceptions, helpers
27 27
 from sickbeard.metadata import generic
28 28
 from sickbeard import encodingKludge as ek
  29
+from sickbeard import config
29 30
 
30 31
 from lib.tvdb_api import tvdb_api, tvdb_exceptions
31 32
 
@@ -174,7 +175,9 @@ def _ep_data(self, ep_obj):
174 175
             
175 176
             # Title of the episode (Pilot, Homer's Night Out, Episode 02, etc.) Should be included for episodic shows. 
176 177
             # Leave blank or omit for movies.
177  
-            data += ("episodeTitle : " + curEpToWrite.name + "\n")
  178
+            #
  179
+            # Added season episode to title, so that the shows will sort correctly, as often the date information is wrong.
  180
+            data += ("episodeTitle : " + config.naming_ep_type[sickbeard.NAMING_EP_TYPE] % {'seasonnumber': curEpToWrite.season, 'episodenumber': curEpToWrite.episode}  + " " + curEpToWrite.name + "\n")
178 181
             
179 182
             
180 183
             # This should be entered for episodic shows and omitted for movies. The standard tivo format is to enter 
31  sickbeard/notifiers/__init__.py
@@ -18,54 +18,57 @@
18 18
 
19 19
 import sickbeard
20 20
 
21  
-import xbmc
22  
-import plex
  21
+import xbmc
  22
+import plex
23 23
 import growl
24 24
 import prowl
25 25
 import tweet
26 26
 from . import libnotify
27 27
 import notifo
28  
-import boxcar
  28
+import boxcar
29 29
 import nmj
30 30
 import synoindex
31 31
 import trakt
  32
+import pytivo
32 33
 
33 34
 from sickbeard.common import *
34 35
 
35  
-xbmc_notifier = xbmc.XBMCNotifier()
36  
-plex_notifier = plex.PLEXNotifier()
  36
+xbmc_notifier = xbmc.XBMCNotifier()
  37
+plex_notifier = plex.PLEXNotifier()
37 38
 growl_notifier = growl.GrowlNotifier()
38 39
 prowl_notifier = prowl.ProwlNotifier()
39 40
 twitter_notifier = tweet.TwitterNotifier()
40 41
 notifo_notifier = notifo.NotifoNotifier()
41  
-boxcar_notifier = boxcar.BoxcarNotifier()
  42
+boxcar_notifier = boxcar.BoxcarNotifier()
42 43
 libnotify_notifier = libnotify.LibnotifyNotifier()
43 44
 nmj_notifier = nmj.NMJNotifier()
44 45
 synoindex_notifier = synoindex.synoIndexNotifier()
45 46
 trakt_notifier = trakt.TraktNotifier()
  47
+pytivo_notifier = pytivo.pyTivoNotifier()
46 48
 
47 49
 notifiers = [
48  
-    # Libnotify notifier goes first because it doesn't involve blocking on
49  
-    # network activity.
  50
+    # Libnotify notifier goes first because it doesn't involve blocking on
  51
+    # network activity.
50 52
     libnotify_notifier,
51  
-    xbmc_notifier,
52  
-    plex_notifier,
  53
+    xbmc_notifier,
  54
+    plex_notifier,
53 55
     growl_notifier,
54  
-    prowl_notifier,
  56
+    prowl_notifier,
55 57
     twitter_notifier,
56 58
     nmj_notifier,
57 59
     synoindex_notifier,
58 60
     boxcar_notifier,
59 61
     trakt_notifier,
  62
+    pytivo_notifier,
60 63
 ]
61 64
 
62 65
 def notify_download(ep_name):
63 66
     for n in notifiers:
64 67
         n.notify_download(ep_name)
65  
-    notifo_notifier.notify_download(ep_name)
  68
+    notifo_notifier.notify_download(ep_name)
66 69
 
67 70
 def notify_snatch(ep_name):
68 71
     for n in notifiers:
69 72
         n.notify_snatch(ep_name)
70  
-    notifo_notifier.notify_snatch(ep_name)
71  
-
  73
+    notifo_notifier.notify_snatch(ep_name)
  74
+
112  sickbeard/notifiers/pytivo.py
... ...
@@ -0,0 +1,112 @@
  1
+# Author: Nic Wolfe <nic@wolfeden.ca>
  2
+# URL: http://code.google.com/p/sickbeard/
  3
+#
  4
+# This file is part of Sick Beard.
  5
+#
  6
+# Sick Beard is free software: you can redistribute it and/or modify
  7
+# it under the terms of the GNU General Public License as published by
  8
+# the Free Software Foundation, either version 3 of the License, or
  9
+# (at your option) any later version.
  10
+#
  11
+# Sick Beard is distributed in the hope that it will be useful,
  12
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
  13
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14
+# GNU General Public License for more details.
  15
+#
  16
+# You should have received a copy of the GNU General Public License
  17
+# along with Sick Beard.  If not, see <http://www.gnu.org/licenses/>.
  18
+
  19
+
  20
+
  21
+import os
  22
+import subprocess
  23
+import sickbeard
  24
+
  25
+from urllib import urlencode
  26
+from urllib2 import Request, urlopen, URLError
  27
+
  28
+from sickbeard import logger
  29
+from sickbeard import encodingKludge as ek
  30
+from sickbeard.exceptions import ex
  31
+
  32
+from httplib import HTTPSConnection
  33
+
  34
+class pyTivoNotifier:
  35
+
  36
+    def notify_snatch(self, ep_name):
  37
+        pass
  38
+
  39
+    def notify_download(self, ep_name):
  40
+        pass
  41
+
  42
+    def update_library(self, ep_obj):
  43
+
  44
+        # Values from config
  45
+        
  46
+        host = sickbeard.PYTIVO_HOST
  47
+        shareName = sickbeard.PYTIVO_SHARE_NAME
  48
+        tsn = sickbeard.PYTIVO_TIVO_NAME
  49
+        
  50
+        # There are two more values required, the container and file.
  51
+        # 
  52
+        # container: The share name, show name and season
  53
+        #
  54
+        # file: The file name
  55
+        # 
  56
+        # Some slicing and dicing of variables is required to get at these values.
  57
+        #
  58
+        # There might be better ways to arrive at the values, but this is the best I have been able to 
  59
+        # come up with.
  60
+        #
  61
+        
  62
+        
  63
+        # Calculated values
  64
+        
  65
+        showPath = ep_obj.show.location
  66
+        showName = ep_obj.show.name
  67
+        rootShowAndSeason = ek.ek(os.path.dirname, ep_obj.location)      
  68
+        absPath = ep_obj.location
  69
+        
  70
+        # Some show names have colons in them which are illegal in a path location, so strip them out.
  71
+        # (Are there other characters?)
  72
+        showName = showName.replace(":","")
  73
+        
  74
+        root = showPath.replace(showName, "")
  75
+        showAndSeason = rootShowAndSeason.replace(root, "")
  76
+        
  77
+        
  78
+        #logger.log(u"showPath:          " + showPath )
  79
+        #logger.log(u"showName:          " + showName )
  80
+        #logger.log(u"rootShowAndSeason: " + rootShowAndSeason )
  81
+        #logger.log(u"absPath:           " + absPath )
  82
+        #logger.log(u"root:              " + root )
  83
+
  84
+
  85
+        container = shareName + "/" + showAndSeason
  86
+        file = "/" + absPath.replace(root, "")
  87
+        
  88
+        
  89
+        # Finally create the url and make request
  90
+        
  91
+        requestUrl = "http://" + host + "/TiVoConnect?" + urlencode( {'Command':'Push', 'Container':container, 'File':file, 'tsn':tsn} )
  92
+               
  93
+        logger.log(u"pyTivo notification: Requesting " + requestUrl)
  94
+        
  95
+        request = Request( requestUrl )
  96
+
  97
+        try:
  98
+            response = urlopen(request)      
  99
+        except URLError, e:
  100
+            if hasattr(e, 'reason'):
  101
+                logger.log(u"pyTivo notification: Error, failed to reach a server")
  102
+                logger.log(u"'Error reason: " + e.reason)
  103
+                return False
  104
+            elif hasattr(e, 'code'):
  105
+                logger.log(u"pyTivo notification: Error, the server couldn't fulfill the request")
  106
+                logger.log(u"Error code: " + e.code)
  107
+                return False
  108
+        else:
  109
+            logger.log(u"pyTivo notification: Successfully requested transfer of file")
  110
+            return True
  111
+
  112
+notifier = pyTivoNotifier
24  sickbeard/postProcessor.py
@@ -708,19 +708,21 @@ def process(self):
708 708
         ep_obj.createMetaFiles()
709 709
         ep_obj.saveToDB()
710 710
 
711  
-        # do the library update
712  
-        notifiers.xbmc_notifier.update_library(ep_obj.show.name)
713  
-
714  
-        # do the library update for Plex Media Server
715  
-        notifiers.plex_notifier.update_library()
716  
-
  711
+        # do the library update
  712
+        notifiers.xbmc_notifier.update_library(ep_obj.show.name)
  713
+        
  714
+        # do the library update for Plex Media Server
  715
+        notifiers.plex_notifier.update_library()
  716
+        
717 717
         # do the library update for synoindex
718  
-        notifiers.synoindex_notifier.update_library(ep_obj)
719  
-
720  
-        # do the library update for trakt
  718
+        notifiers.synoindex_notifier.update_library(ep_obj)
  719
+        
  720
+        # do the library update for trakt
721 721
         notifiers.trakt_notifier.update_library(ep_obj)
722  
-
723  
-        # run extra_scripts
  722
+        
  723
+        # do the library update for pyTivo
  724
+        notifiers.pytivo_notifier.update_library(ep_obj)
  725
+        
724 726
         self._run_extra_scripts(ep_obj)
725 727
 
726 728
         return True
193  sickbeard/webserve.py
@@ -1174,10 +1174,12 @@ def saveNotifications(self, use_xbmc=None, xbmc_notify_onsnatch=None, xbmc_notif
1174 1174
                           use_prowl=None, prowl_notify_onsnatch=None, prowl_notify_ondownload=None, prowl_api=None, prowl_priority=0, 
1175 1175
                           use_twitter=None, twitter_notify_onsnatch=None, twitter_notify_ondownload=None, 
1176 1176
                           use_notifo=None, notifo_notify_onsnatch=None, notifo_notify_ondownload=None, notifo_username=None, notifo_apisecret=None,
1177  
-                          use_boxcar=None, boxcar_notify_onsnatch=None, boxcar_notify_ondownload=None, boxcar_username=None,
  1177
+                          use_boxcar=None, boxcar_notify_onsnatch=None, boxcar_notify_ondownload=None, boxcar_username=None,
1178 1178
                           use_libnotify=None, libnotify_notify_onsnatch=None, libnotify_notify_ondownload=None,
1179  
-                          use_nmj=None, nmj_host=None, nmj_database=None, nmj_mount=None, use_synoindex=None,
1180  
-                          use_trakt=None, trakt_username=None, trakt_password=None, trakt_api=None):
  1179
+                          use_nmj=None, nmj_host=None, nmj_database=None, nmj_mount=None, use_synoindex=None,
  1180
+                          use_trakt=None, trakt_username=None, trakt_password=None, trakt_api=None,
  1181
+                          use_pytivo=None, pytivo_notify_onsnatch=None, pytivo_notify_ondownload=None, pytivo_update_library=None, 
  1182
+                          pytivo_host=None, pytivo_share_name=None, pytivo_tivo_name=None ):
1181 1183
 
1182 1184
         results = []
1183 1185
 
@@ -1278,24 +1280,25 @@ def saveNotifications(self, use_xbmc=None, xbmc_notify_onsnatch=None, xbmc_notif
1278 1280
             notifo_notify_ondownload = 1
1279 1281
         else:
1280 1282
             notifo_notify_ondownload = 0
  1283
+            
1281 1284
         if use_notifo == "on":
1282 1285
             use_notifo = 1
1283 1286
         else:
1284 1287
             use_notifo = 0
1285  
-
1286  
-        if boxcar_notify_onsnatch == "on":
1287  
-            boxcar_notify_onsnatch = 1
1288  
-        else:
1289  
-            boxcar_notify_onsnatch = 0
1290  
-
1291  
-        if boxcar_notify_ondownload == "on":
1292  
-            boxcar_notify_ondownload = 1
1293  
-        else:
1294  
-            boxcar_notify_ondownload = 0
1295  
-        if use_boxcar == "on":
1296  
-            use_boxcar = 1
1297  
-        else:
1298  
-            use_boxcar = 0
  1288
+
  1289
+        if boxcar_notify_onsnatch == "on":
  1290
+            boxcar_notify_onsnatch = 1
  1291
+        else:
  1292
+            boxcar_notify_onsnatch = 0
  1293
+
  1294
+        if boxcar_notify_ondownload == "on":
  1295
+            boxcar_notify_ondownload = 1
  1296
+        else:
  1297
+            boxcar_notify_ondownload = 0
  1298
+        if use_boxcar == "on":
  1299
+            use_boxcar = 1
  1300
+        else:
  1301
+            use_boxcar = 0
1299 1302
 
1300 1303
         if use_nmj == "on":
1301 1304
             use_nmj = 1
@@ -1305,13 +1308,33 @@ def saveNotifications(self, use_xbmc=None, xbmc_notify_onsnatch=None, xbmc_notif
1305 1308
         if use_synoindex == "on":
1306 1309
             use_synoindex = 1
1307 1310
         else:
1308  
-            use_synoindex = 0
1309  
-
1310  
-        if use_trakt == "on":
1311  
-            use_trakt = 1
1312  
-        else:
  1311
+            use_synoindex = 0
  1312
+
  1313
+        if use_trakt == "on":
  1314
+            use_trakt = 1
  1315
+        else:
1313 1316
             use_trakt = 0
1314 1317
 
  1318
+        if use_pytivo == "on":
  1319
+            use_pytivo = 1
  1320
+        else:
  1321
+            use_pytivo = 0
  1322
+            
  1323
+        if pytivo_notify_onsnatch == "on":
  1324
+            pytivo_notify_onsnatch = 1
  1325
+        else:
  1326
+            pytivo_notify_onsnatch = 0
  1327
+
  1328
+        if pytivo_notify_ondownload == "on":
  1329
+            pytivo_notify_ondownload = 1
  1330
+        else:
  1331
+            pytivo_notify_ondownload = 0
  1332
+
  1333
+        if pytivo_update_library == "on":
  1334
+            pytivo_update_library = 1
  1335
+        else:
  1336
+            pytivo_update_library = 0
  1337
+
1315 1338
         sickbeard.USE_XBMC = use_xbmc
1316 1339
         sickbeard.XBMC_NOTIFY_ONSNATCH = xbmc_notify_onsnatch
1317 1340
         sickbeard.XBMC_NOTIFY_ONDOWNLOAD = xbmc_notify_ondownload
@@ -1351,11 +1374,11 @@ def saveNotifications(self, use_xbmc=None, xbmc_notify_onsnatch=None, xbmc_notif
1351 1374
         sickbeard.NOTIFO_NOTIFY_ONDOWNLOAD = notifo_notify_ondownload
1352 1375
         sickbeard.NOTIFO_USERNAME = notifo_username
1353 1376
         sickbeard.NOTIFO_APISECRET = notifo_apisecret
1354  
-
1355  
-        sickbeard.USE_BOXCAR = use_boxcar
1356  
-        sickbeard.BOXCAR_NOTIFY_ONSNATCH = boxcar_notify_onsnatch
1357  
-        sickbeard.BOXCAR_NOTIFY_ONDOWNLOAD = boxcar_notify_ondownload
1358  
-        sickbeard.BOXCAR_USERNAME = boxcar_username
  1377
+
  1378
+        sickbeard.USE_BOXCAR = use_boxcar
  1379
+        sickbeard.BOXCAR_NOTIFY_ONSNATCH = boxcar_notify_onsnatch
  1380
+        sickbeard.BOXCAR_NOTIFY_ONDOWNLOAD = boxcar_notify_ondownload
  1381
+        sickbeard.BOXCAR_USERNAME = boxcar_username
1359 1382
 
1360 1383
         sickbeard.USE_LIBNOTIFY = use_libnotify == "on"
1361 1384
         sickbeard.LIBNOTIFY_NOTIFY_ONSNATCH = libnotify_notify_onsnatch == "on"
@@ -1366,13 +1389,21 @@ def saveNotifications(self, use_xbmc=None, xbmc_notify_onsnatch=None, xbmc_notif
1366 1389
         sickbeard.NMJ_DATABASE = nmj_database
1367 1390
         sickbeard.NMJ_MOUNT = nmj_mount
1368 1391
 
1369  
-        sickbeard.USE_SYNOINDEX = use_synoindex
1370  
-
1371  
-        sickbeard.USE_TRAKT = use_trakt
1372  
-        sickbeard.TRAKT_USERNAME = trakt_username
1373  
-        sickbeard.TRAKT_PASSWORD = trakt_password
  1392
+        sickbeard.USE_SYNOINDEX = use_synoindex
  1393
+
  1394
+        sickbeard.USE_TRAKT = use_trakt
  1395
+        sickbeard.TRAKT_USERNAME = trakt_username
  1396
+        sickbeard.TRAKT_PASSWORD = trakt_password
1374 1397
         sickbeard.TRAKT_API = trakt_api
1375 1398
 
  1399
+        sickbeard.USE_PYTIVO = use_pytivo
  1400
+        sickbeard.PYTIVO_NOTIFY_ONSNATCH = pytivo_notify_onsnatch == "off"
  1401
+        sickbeard.PYTIVO_NOTIFY_ONDOWNLOAD = pytivo_notify_ondownload ==  "off"
  1402
+        sickbeard.PYTIVO_UPDATE_LIBRARY = pytivo_update_library
  1403
+        sickbeard.PYTIVO_HOST = pytivo_host
  1404
+        sickbeard.PYTIVO_SHARE_NAME = pytivo_share_name
  1405
+        sickbeard.PYTIVO_TIVO_NAME = pytivo_tivo_name
  1406
+        
1376 1407
         sickbeard.save_config()
1377 1408
 
1378 1409
         if len(results) > 0:
@@ -1405,18 +1436,18 @@ def index(self):
1405 1436
 
1406 1437
     notifications = ConfigNotifications()
1407 1438
 
1408  
-def haveXBMC():
1409  
-    return sickbeard.XBMC_HOST
1410  
-
1411  
-def havePLEX():
1412  
-    return sickbeard.PLEX_SERVER_HOST
1413  
-
  1439
+def haveXBMC():
  1440
+    return sickbeard.XBMC_HOST
  1441
+
  1442
+def havePLEX():
  1443
+    return sickbeard.PLEX_SERVER_HOST
  1444
+
1414 1445
 def HomeMenu():
1415 1446
     return [
1416 1447
         { 'title': 'Add Shows',              'path': 'home/addShows/',                                          },
1417 1448
         { 'title': 'Manual Post-Processing', 'path': 'home/postprocess/'                                        },
1418  
-        { 'title': 'Update XBMC',            'path': 'home/updateXBMC/', 'requires': haveXBMC                   },
1419  
-        { 'title': 'Update Plex',            'path': 'home/updatePLEX/', 'requires': havePLEX                   },
  1449
+        { 'title': 'Update XBMC',            'path': 'home/updateXBMC/', 'requires': haveXBMC                   },
  1450
+        { 'title': 'Update Plex',            'path': 'home/updatePLEX/', 'requires': havePLEX                   },
1420 1451
         { 'title': 'Restart',                'path': 'home/restart/?pid='+str(sickbeard.PID), 'confirm': True   },
1421 1452
         { 'title': 'Shutdown',               'path': 'home/shutdown/', 'confirm': True                          },
1422 1453
     ]
@@ -1925,16 +1956,16 @@ def testNotifo(self, username=None, apisecret=None):
1925 1956
             return "Notifo notification succeeded. Check your Notifo clients to make sure it worked"
1926 1957
         else:
1927 1958
             return "Error sending Notifo notification"
1928  
-
1929  
-    @cherrypy.expose
1930  
-    def testBoxcar(self, username=None):
1931  
-        cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
1932  
-
1933  
-        result = notifiers.boxcar_notifier.test_notify(username)
1934  
-        if result:
1935  
-            return "Boxcar notification succeeded. Check your Boxcar clients to make sure it worked"
1936  
-        else:
1937  
-            return "Error sending Boxcar notification"
  1959
+
  1960
+    @cherrypy.expose
  1961
+    def testBoxcar(self, username=None):
  1962
+        cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
  1963
+
  1964
+        result = notifiers.boxcar_notifier.test_notify(username)
  1965
+        if result:
  1966
+            return "Boxcar notification succeeded. Check your Boxcar clients to make sure it worked"
  1967
+        else:
  1968
+            return "Error sending Boxcar notification"
1938 1969
 
1939 1970
     @cherrypy.expose
1940 1971
     def twitterStep1(self):
@@ -2010,16 +2041,16 @@ def settingsNMJ(self, host=None):
2010 2041
         if result:
2011 2042
             return '{"message": "Got settings from %(host)s", "database": "%(database)s", "mount": "%(mount)s"}' % {"host": host, "database": sickbeard.NMJ_DATABASE, "mount": sickbeard.NMJ_MOUNT}
2012 2043
         else:
2013  
-            return '{"message": "Failed! Make sure your Popcorn is on and NMJ is running. (see Log & Errors -> Debug for detailed info)", "database": "", "mount": ""}'
2014  
-
2015  
-    @cherrypy.expose
2016  
-    def testTrakt(self, api=None, username=None, password=None):
2017  
-        cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
2018  
-
2019  
-        result = notifiers.trakt_notifier.test_notify(api, username, password)
2020  
-        if result:
2021  
-            return "Test notice sent successfully to Trakt"
2022  
-        else:
  2044
+            return '{"message": "Failed! Make sure your Popcorn is on and NMJ is running. (see Log & Errors -> Debug for detailed info)", "database": "", "mount": ""}'
  2045
+
  2046
+    @cherrypy.expose
  2047
+    def testTrakt(self, api=None, username=None, password=None):
  2048
+        cherrypy.response.headers['Cache-Control'] = "max-age=0,no-cache,no-store"
  2049
+
  2050
+        result = notifiers.trakt_notifier.test_notify(api, username, password)
  2051
+        if result:
  2052
+            return "Test notice sent successfully to Trakt"
  2053
+        else:
2023 2054
             return "Test notice failed to Trakt"
2024 2055
 
2025 2056
 
@@ -2341,27 +2372,27 @@ def updateShow(self, show=None, force=0):
2341 2372
         redirect("/home/displayShow?show="+str(showObj.tvdbid))
2342 2373
 
2343 2374
 
2344  
-    @cherrypy.expose
2345  
-    def updateXBMC(self, showName=None):
2346  
-
2347  
-        for curHost in [x.strip() for x in sickbeard.XBMC_HOST.split(",")]:
2348  
-            if notifiers.xbmc_notifier._update_library(curHost, showName=showName):
2349  
-                ui.notifications.message("Command sent to XBMC host " + curHost + " to update library")
2350  
-            else:
2351  
-                ui.notifications.error("Unable to contact XBMC host " + curHost)
2352  
-        redirect('/home')
2353  
-
2354  
-
2355  
-    @cherrypy.expose
2356  
-    def updatePLEX(self):
2357  
-
2358  
-        if notifiers.plex_notifier._update_library():
2359  
-            ui.notifications.message("Command sent to Plex Media Server host " + sickbeard.PLEX_HOST + " to update library")
2360  
-            logger.log(u"Plex library update initiated for host " + sickbeard.PLEX_HOST, logger.DEBUG)
2361  
-        else:
2362  
-            ui.notifications.error("Unable to contact Plex Media Server host " + sickbeard.PLEX_HOST)
2363  
-            logger.log(u"Plex library update failed for host " + sickbeard.PLEX_HOST, logger.ERROR)
2364  
-        redirect('/home')
  2375
+    @cherrypy.expose
  2376
+    def updateXBMC(self, showName=None):
  2377
+
  2378
+        for curHost in [x.strip() for x in sickbeard.XBMC_HOST.split(",")]:
  2379
+            if notifiers.xbmc_notifier._update_library(curHost, showName=showName):
  2380
+                ui.notifications.message("Command sent to XBMC host " + curHost + " to update library")
  2381
+            else:
  2382
+                ui.notifications.error("Unable to contact XBMC host " + curHost)
  2383
+        redirect('/home')
  2384
+
  2385
+
  2386
+    @cherrypy.expose
  2387
+    def updatePLEX(self):
  2388
+
  2389
+        if notifiers.plex_notifier._update_library():
  2390
+            ui.notifications.message("Command sent to Plex Media Server host " + sickbeard.PLEX_HOST + " to update library")
  2391
+            logger.log(u"Plex library update initiated for host " + sickbeard.PLEX_HOST, logger.DEBUG)
  2392
+        else:
  2393
+            ui.notifications.error("Unable to contact Plex Media Server host " + sickbeard.PLEX_HOST)
  2394
+            logger.log(u"Plex library update failed for host " + sickbeard.PLEX_HOST, logger.ERROR)
  2395
+        redirect('/home')
2365 2396
 
2366 2397
 
2367 2398
     @cherrypy.expose
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.