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

Name change XBMC -> Kodi

This commit is contained in:
echel0n 2014-11-28 14:47:43 -08:00
parent 76717fa52b
commit 9ecbd401f4
20 changed files with 301 additions and 301 deletions

View File

@ -49,7 +49,7 @@
* Add image to be used when Trakt posters are void on Add Show/Add Trending Show page
* Fix growl registration not sending sickrage an update notification registration
* Add an anonymous redirect builder for external links
* Update xbmc link to Kodi at Config Notifications
* Update kodi link to Kodi at Config Notifications
* Fix missing url for kickasstorrents in config_providers
* Fix post processing when using tvrage indexer and mediabrowser metadata generation
* Change reporting failed network_timezones.txt updates from an error to a warning

View File

@ -452,7 +452,7 @@ inc_top.tmpl
background-position: -357px 0px;
}
.menu-icon-xbmc {
.menu-icon-kodi {
background-position: -378px 0px;
}
@ -486,7 +486,7 @@ inc_top.tmpl
background-position: -294px 0px;
}
.submenu-icon-xbmc {
.submenu-icon-kodi {
background-position: -378px 0px;
}

View File

@ -434,7 +434,7 @@ inc_top.tmpl
background-position: -357px 0px;
}
.menu-icon-xbmc {
.menu-icon-kodi {
background-position: -378px 0px;
}
@ -468,7 +468,7 @@ inc_top.tmpl
background-position: -294px 0px;
}
.submenu-icon-xbmc {
.submenu-icon-kodi {
background-position: -378px 0px;
}

View File

@ -434,7 +434,7 @@ inc_top.tmpl
background-position: -357px 0px;
}
.menu-icon-xbmc {
.menu-icon-kodi {
background-position: -378px 0px;
}
@ -468,7 +468,7 @@ inc_top.tmpl
background-position: -294px 0px;
}
.submenu-icon-xbmc {
.submenu-icon-kodi {
background-position: -378px 0px;
}

View File

@ -32,93 +32,93 @@
<div class="component-group">
<div class="component-group-desc">
<img class="notifier-icon" src="$sbRoot/images/notifiers/xbmc.png" alt="" title="XBMC" />
<h3><a href="<%= anon_url('http://kodi.tv/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">XBMC</a></h3>
<img class="notifier-icon" src="$sbRoot/images/notifiers/kodi.png" alt="" title="KODI" />
<h3><a href="<%= anon_url('http://kodi.tv/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">KODI</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>
</div>
<fieldset class="component-group-list">
<div class="field-pair">
<label class="cleafix" for="use_xbmc">
<label class="cleafix" for="use_kodi">
<span class="component-title">Enable</span>
<span class="component-desc">
<input type="checkbox" class="enabler" name="use_xbmc" id="use_xbmc" #if $sickbeard.USE_XBMC then "checked=\"checked\"" else ""# />
<p>should SickRage send XBMC commands ?<p>
<input type="checkbox" class="enabler" name="use_kodi" id="use_kodi" #if $sickbeard.USE_KODI then "checked=\"checked\"" else ""# />
<p>should SickRage send KODI commands ?<p>
</span>
</label>
</div>
<div id="content_use_xbmc">
<div id="content_use_kodi">
<div class="field-pair">
<label for="xbmc_always_on">
<label for="kodi_always_on">
<span class="component-title">Always on</span>
<span class="component-desc">
<input type="checkbox" name="xbmc_always_on" id="xbmc_always_on" #if $sickbeard.XBMC_ALWAYS_ON then "checked=\"checked\"" else ""# />
<input type="checkbox" name="kodi_always_on" id="kodi_always_on" #if $sickbeard.KODI_ALWAYS_ON then "checked=\"checked\"" else ""# />
<p>log errors when unreachable ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="xbmc_notify_onsnatch">
<label for="kodi_notify_onsnatch">
<span class="component-title">Notify on snatch</span>
<span class="component-desc">
<input type="checkbox" name="xbmc_notify_onsnatch" id="xbmc_notify_onsnatch" #if $sickbeard.XBMC_NOTIFY_ONSNATCH then "checked=\"checked\"" else ""# />
<input type="checkbox" name="kodi_notify_onsnatch" id="kodi_notify_onsnatch" #if $sickbeard.KODI_NOTIFY_ONSNATCH then "checked=\"checked\"" else ""# />
<p>send a notification when a download starts ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="xbmc_notify_ondownload">
<label for="kodi_notify_ondownload">
<span class="component-title">Notify on download</span>
<span class="component-desc">
<input type="checkbox" name="xbmc_notify_ondownload" id="xbmc_notify_ondownload" #if $sickbeard.XBMC_NOTIFY_ONDOWNLOAD then "checked=\"checked\"" else ""# />
<input type="checkbox" name="kodi_notify_ondownload" id="kodi_notify_ondownload" #if $sickbeard.KODI_NOTIFY_ONDOWNLOAD then "checked=\"checked\"" else ""# />
<p>send a notification when a download finishes ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="xbmc_notify_onsubtitledownload">
<label for="kodi_notify_onsubtitledownload">
<span class="component-title">Notify on subtitle download</span>
<span class="component-desc">
<input type="checkbox" name="xbmc_notify_onsubtitledownload" id="xbmc_notify_onsubtitledownload" #if $sickbeard.XBMC_NOTIFY_ONSUBTITLEDOWNLOAD then "checked=\"checked\"" else ""# />
<input type="checkbox" name="kodi_notify_onsubtitledownload" id="kodi_notify_onsubtitledownload" #if $sickbeard.KODI_NOTIFY_ONSUBTITLEDOWNLOAD then "checked=\"checked\"" else ""# />
<p>send a notification when subtitles are downloaded ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="xbmc_update_library">
<label for="kodi_update_library">
<span class="component-title">Update library</span>
<span class="component-desc">
<input type="checkbox" name="xbmc_update_library" id="xbmc_update_library" #if $sickbeard.XBMC_UPDATE_LIBRARY then "checked=\"checked\"" else ""# />
<p>update XBMC library when a download finishes ?</p>
<input type="checkbox" name="kodi_update_library" id="kodi_update_library" #if $sickbeard.KODI_UPDATE_LIBRARY then "checked=\"checked\"" else ""# />
<p>update KODI library when a download finishes ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="xbmc_update_full">
<label for="kodi_update_full">
<span class="component-title">Full library update</span>
<span class="component-desc">
<input type="checkbox" name="xbmc_update_full" id="xbmc_update_full" #if $sickbeard.XBMC_UPDATE_FULL then "checked=\"checked\"" else ""# />
<input type="checkbox" name="kodi_update_full" id="kodi_update_full" #if $sickbeard.KODI_UPDATE_FULL then "checked=\"checked\"" else ""# />
<p>perform a full library update if update per-show fails ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="xbmc_update_onlyfirst">
<label for="kodi_update_onlyfirst">
<span class="component-title">Only update first host</span>
<span class="component-desc">
<input type="checkbox" name="xbmc_update_onlyfirst" id="xbmc_update_onlyfirst" #if $sickbeard.XBMC_UPDATE_ONLYFIRST then "checked=\"checked\"" else ""# />
<input type="checkbox" name="kodi_update_onlyfirst" id="kodi_update_onlyfirst" #if $sickbeard.KODI_UPDATE_ONLYFIRST then "checked=\"checked\"" else ""# />
<p>only send library updates to the first active host ?</p>
</span>
</label>
</div>
<div class="field-pair">
<label for="xbmc_host">
<span class="component-title">XBMC IP:Port</span>
<input type="text" name="xbmc_host" id="xbmc_host" value="$sickbeard.XBMC_HOST" class="form-control input-sm input350" />
<label for="kodi_host">
<span class="component-title">KODI IP:Port</span>
<input type="text" name="kodi_host" id="kodi_host" value="$sickbeard.KODI_HOST" class="form-control input-sm input350" />
</label>
<label>
<span class="component-title">&nbsp;</span>
<span class="component-desc">host running XBMC (eg. 192.168.1.100:8080)</span>
<span class="component-desc">host running KODI (eg. 192.168.1.100:8080)</span>
</label>
<label>
<span class="component-title">&nbsp;</span>
@ -126,33 +126,33 @@
</label>
</div>
<div class="field-pair">
<label for="xbmc_username">
<span class="component-title">XBMC username</span>
<input type="text" name="xbmc_username" id="xbmc_username" value="$sickbeard.XBMC_USERNAME" class="form-control input-sm input250" />
<label for="kodi_username">
<span class="component-title">KODI username</span>
<input type="text" name="kodi_username" id="kodi_username" value="$sickbeard.KODI_USERNAME" class="form-control input-sm input250" />
</label>
<label>
<span class="component-title">&nbsp;</span>
<span class="component-desc">username for your XBMC server (blank for none)</span>
<span class="component-desc">username for your KODI server (blank for none)</span>
</label>
</div>
<div class="field-pair">
<label for="xbmc_password">
<span class="component-title">XBMC password</span>
<input type="password" name="xbmc_password" id="xbmc_password" value="$sickbeard.XBMC_PASSWORD" class="form-control input-sm input250" />
<label for="kodi_password">
<span class="component-title">KODI password</span>
<input type="password" name="kodi_password" id="kodi_password" value="$sickbeard.KODI_PASSWORD" class="form-control input-sm input250" />
</label>
<label>
<span class="component-title">&nbsp;</span>
<span class="component-desc">password for your XBMC server (blank for none)</span>
<span class="component-desc">password for your KODI server (blank for none)</span>
</label>
</div>
<div class="testNotification" id="testXBMC-result">Click below to test.</div>
<input class="btn" type="button" value="Test XBMC" id="testXBMC" />
<div class="testNotification" id="testKODI-result">Click below to test.</div>
<input class="btn" type="button" value="Test KODI" id="testKODI" />
<input type="submit" class="config_submitter btn" value="Save Changes" />
</div><!-- /content_use_xbmc //-->
</div><!-- /content_use_kodi //-->
</fieldset>
</div><!-- /xbmc component-group //-->
</div><!-- /kodi component-group //-->
<div class="component-group">
@ -160,7 +160,7 @@
<img class="notifier-icon" src="$sbRoot/images/notifiers/plex.png" alt="" title="Plex Media Server" />
<h3><a href="<%= anon_url('http://www.plexapp.com/') %>" rel="noreferrer" onclick="window.open(this.href, '_blank'); return false;">Plex Media Server</a></h3>
<p>Experience your media on a visually stunning, easy to use interface on your Mac connected to your TV. Your media library has never looked this good!</p>
<p class="plexinfo hide">For sending notifications to Plex Home Theater (PHT) clients, use the XBMC notifier with port <b>3005</b>.</p>
<p class="plexinfo hide">For sending notifications to Plex Home Theater (PHT) clients, use the KODI notifier with port <b>3005</b>.</p>
</div>
<fieldset class="component-group-list">
<div class="field-pair">

View File

@ -109,8 +109,8 @@
\$("#SubMenu a:contains('Manage Torrents')").addClass('btn').html('<span class="submenu-icon-bittorrent pull-left"></span> Manage Torrents');
\$("#SubMenu a[href$='/manage/failedDownloads/']").addClass('btn').html('<span class="submenu-icon-failed-download pull-left"></span> Failed Downloads');
\$("#SubMenu a:contains('Notification')").addClass('btn').html('<span class="ui-icon ui-icon-note pull-left"></span> Notifications');
\$("#SubMenu a:contains('Update show in XBMC')").addClass('btn').html('<span class="submenu-icon-xbmc pull-left"></span> Update show in XBMC');
\$("#SubMenu a[href$='/home/updateXBMC/']").addClass('btn').html('<span class="submenu-icon-xbmc pull-left"></span> Update XBMC');
\$("#SubMenu a:contains('Update show in KODI')").addClass('btn').html('<span class="submenu-icon-kodi pull-left"></span> Update show in KODI');
\$("#SubMenu a[href$='/home/updateKODI/']").addClass('btn').html('<span class="submenu-icon-kodi pull-left"></span> Update KODI');
}
\$(document).ready(function() {
@ -169,8 +169,8 @@
#if $sickbeard.USE_PLEX and $sickbeard.PLEX_SERVER_HOST != "":
<li><a href="$sbRoot/home/updatePLEX/"><i class="menu-icon-backlog-view"></i>&nbsp;Update PLEX</a></li>
#end if
#if $sickbeard.USE_XBMC and $sickbeard.XBMC_HOST != "":
<li><a href="$sbRoot/home/updateXBMC/"><i class="menu-icon-xbmc"></i>&nbsp;Update XBMC</a></li>
#if $sickbeard.USE_KODI and $sickbeard.KODI_HOST != "":
<li><a href="$sbRoot/home/updateKODI/"><i class="menu-icon-kodi"></i>&nbsp;Update KODI</a></li>
#end if
#if $sickbeard.USE_TORRENTS and $sickbeard.TORRENT_METHOD != 'blackhole' \
and ($sickbeard.ENABLE_HTTPS and $sickbeard.TORRENT_HOST[:5] == 'https' \

View File

@ -37,22 +37,22 @@ $(document).ready(function(){
});
});
$('#testXBMC').click(function () {
var xbmc_host = $.trim($('#xbmc_host').val());
var xbmc_username = $.trim($('#xbmc_username').val());
var xbmc_password = $.trim($('#xbmc_password').val());
if (!xbmc_host) {
$('#testXBMC-result').html('Please fill out the necessary fields above.');
$('#xbmc_host').addClass('warning');
$('#testKODI').click(function () {
var kodi_host = $.trim($('#kodi_host').val());
var kodi_username = $.trim($('#kodi_username').val());
var kodi_password = $.trim($('#kodi_password').val());
if (!kodi_host) {
$('#testKODI-result').html('Please fill out the necessary fields above.');
$('#kodi_host').addClass('warning');
return;
}
$('#xbmc_host').removeClass('warning');
$('#kodi_host').removeClass('warning');
$(this).prop('disabled', true);
$('#testXBMC-result').html(loading);
$.get(sbRoot + '/home/testXBMC', {'host': xbmc_host, 'username': xbmc_username, 'password': xbmc_password})
$('#testKODI-result').html(loading);
$.get(sbRoot + '/home/testKODI', {'host': kodi_host, 'username': kodi_username, 'password': kodi_password})
.done(function (data) {
$('#testXBMC-result').html(data);
$('#testXBMC').prop('disabled', false);
$('#testKODI-result').html(data);
$('#testKODI').prop('disabled', false);
});
});

View File

@ -9,10 +9,10 @@ Video File Manager for TV Shows, It watches for new episodes of your favorite sh
[![Build Status](https://travis-ci.org/SiCKRAGETV/SickRage.svg?branch=master)](https://travis-ci.org/SiCKRAGETV/SickRage)
## Features
- XBMC library updates, poster/fanart downloads, and NFO/TBN generation
- KODI library updates, poster/fanart downloads, and NFO/TBN generation
- configurable episode renaming
- available for any platform, uses simple HTTP interface
- can notify XBMC, Growl, or Twitter when new episodes are available
- can notify KODI, Growl, or Twitter when new episodes are available
- specials and double episode support
- Automatic XEM Scene Numbering/Naming for seasons/episodes
- Episode Status Manager now allows for mass failing seasons/episodes to force retrying.

View File

@ -161,8 +161,8 @@ SORT_ARTICLE = False
DEBUG = False
USE_LISTVIEW = False
METADATA_XBMC = None
METADATA_XBMC_12PLUS = None
METADATA_KODI = None
METADATA_KODI_12PLUS = None
METADATA_MEDIABROWSER = None
METADATA_PS3 = None
METADATA_WDTV = None
@ -277,17 +277,17 @@ TORRENT_LABEL = ''
TORRENT_LABEL_ANIME = ''
TORRENT_VERIFY_CERT = False
USE_XBMC = False
XBMC_ALWAYS_ON = True
XBMC_NOTIFY_ONSNATCH = False
XBMC_NOTIFY_ONDOWNLOAD = False
XBMC_NOTIFY_ONSUBTITLEDOWNLOAD = False
XBMC_UPDATE_LIBRARY = False
XBMC_UPDATE_FULL = False
XBMC_UPDATE_ONLYFIRST = False
XBMC_HOST = ''
XBMC_USERNAME = None
XBMC_PASSWORD = None
USE_KODI = False
KODI_ALWAYS_ON = True
KODI_NOTIFY_ONSNATCH = False
KODI_NOTIFY_ONDOWNLOAD = False
KODI_NOTIFY_ONSUBTITLEDOWNLOAD = False
KODI_UPDATE_LIBRARY = False
KODI_UPDATE_FULL = False
KODI_UPDATE_ONLYFIRST = False
KODI_HOST = ''
KODI_USERNAME = None
KODI_PASSWORD = None
USE_PLEX = False
PLEX_NOTIFY_ONSNATCH = False
@ -483,8 +483,8 @@ def initialize(consoleLogging=True):
SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_CATEGORY_ANIME, SAB_HOST, \
NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_CATEGORY_ANIME, NZBGET_PRIORITY, NZBGET_HOST, NZBGET_USE_HTTPS, backlogSearchScheduler, \
TORRENT_USERNAME, TORRENT_PASSWORD, TORRENT_HOST, TORRENT_PATH, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_LABEL, TORRENT_LABEL_ANIME, TORRENT_VERIFY_CERT, \
USE_XBMC, XBMC_ALWAYS_ON, XBMC_NOTIFY_ONSNATCH, XBMC_NOTIFY_ONDOWNLOAD, XBMC_NOTIFY_ONSUBTITLEDOWNLOAD, XBMC_UPDATE_FULL, XBMC_UPDATE_ONLYFIRST, \
XBMC_UPDATE_LIBRARY, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, BACKLOG_FREQUENCY, \
USE_KODI, KODI_ALWAYS_ON, KODI_NOTIFY_ONSNATCH, KODI_NOTIFY_ONDOWNLOAD, KODI_NOTIFY_ONSUBTITLEDOWNLOAD, KODI_UPDATE_FULL, KODI_UPDATE_ONLYFIRST, \
KODI_UPDATE_LIBRARY, KODI_HOST, KODI_USERNAME, KODI_PASSWORD, BACKLOG_FREQUENCY, \
USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, TRAKT_REMOVE_WATCHLIST, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktCheckerScheduler, TRAKT_USE_RECOMMENDED, TRAKT_SYNC, TRAKT_DEFAULT_INDEXER, TRAKT_REMOVE_SERIESLIST, \
USE_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, \
PLEX_SERVER_HOST, PLEX_HOST, PLEX_USERNAME, PLEX_PASSWORD, DEFAULT_BACKLOG_FREQUENCY, MIN_BACKLOG_FREQUENCY, BACKLOG_STARTUP, SKIP_REMOVED_FILES, \
@ -510,7 +510,7 @@ def initialize(consoleLogging=True):
USE_LIBNOTIFY, LIBNOTIFY_NOTIFY_ONSNATCH, LIBNOTIFY_NOTIFY_ONDOWNLOAD, LIBNOTIFY_NOTIFY_ONSUBTITLEDOWNLOAD, USE_NMJ, NMJ_HOST, NMJ_DATABASE, NMJ_MOUNT, USE_NMJv2, NMJv2_HOST, NMJv2_DATABASE, NMJv2_DBLOC, USE_SYNOINDEX, \
USE_SYNOLOGYNOTIFIER, SYNOLOGYNOTIFIER_NOTIFY_ONSNATCH, SYNOLOGYNOTIFIER_NOTIFY_ONDOWNLOAD, SYNOLOGYNOTIFIER_NOTIFY_ONSUBTITLEDOWNLOAD, \
USE_EMAIL, EMAIL_HOST, EMAIL_PORT, EMAIL_TLS, EMAIL_USER, EMAIL_PASSWORD, EMAIL_FROM, EMAIL_NOTIFY_ONSNATCH, EMAIL_NOTIFY_ONDOWNLOAD, EMAIL_NOTIFY_ONSUBTITLEDOWNLOAD, EMAIL_LIST, \
USE_LISTVIEW, METADATA_XBMC, METADATA_XBMC_12PLUS, METADATA_MEDIABROWSER, METADATA_PS3, metadata_provider_dict, \
USE_LISTVIEW, METADATA_KODI, METADATA_KODI_12PLUS, METADATA_MEDIABROWSER, METADATA_PS3, metadata_provider_dict, \
NEWZBIN, NEWZBIN_USERNAME, NEWZBIN_PASSWORD, GIT_PATH, MOVE_ASSOCIATED_FILES, POSTPONE_IF_SYNC_FILES, dailySearchScheduler, NFO_RENAME, \
GUI_NAME, HOME_LAYOUT, HISTORY_LAYOUT, DISPLAY_SHOW_SPECIALS, COMING_EPS_LAYOUT, COMING_EPS_SORT, COMING_EPS_DISPLAY_PAUSED, COMING_EPS_MISSED_RANGE, FUZZY_DATING, TRIM_ZERO, DATE_PRESET, TIME_PRESET, TIME_PRESET_W_SECONDS, THEME_NAME, \
POSTER_SORTBY, POSTER_SORTDIR, \
@ -529,7 +529,7 @@ def initialize(consoleLogging=True):
CheckSection(CFG, 'Newzbin')
CheckSection(CFG, 'SABnzbd')
CheckSection(CFG, 'NZBget')
CheckSection(CFG, 'XBMC')
CheckSection(CFG, 'KODI')
CheckSection(CFG, 'PLEX')
CheckSection(CFG, 'Growl')
CheckSection(CFG, 'Prowl')
@ -771,17 +771,17 @@ def initialize(consoleLogging=True):
TORRENT_LABEL_ANIME = check_setting_str(CFG, 'TORRENT', 'torrent_label_anime', '')
TORRENT_VERIFY_CERT = bool(check_setting_int(CFG, 'TORRENT', 'torrent_verify_cert', 0))
USE_XBMC = bool(check_setting_int(CFG, 'XBMC', 'use_xbmc', 0))
XBMC_ALWAYS_ON = bool(check_setting_int(CFG, 'XBMC', 'xbmc_always_on', 1))
XBMC_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'XBMC', 'xbmc_notify_onsnatch', 0))
XBMC_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'XBMC', 'xbmc_notify_ondownload', 0))
XBMC_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'XBMC', 'xbmc_notify_onsubtitledownload', 0))
XBMC_UPDATE_LIBRARY = bool(check_setting_int(CFG, 'XBMC', 'xbmc_update_library', 0))
XBMC_UPDATE_FULL = bool(check_setting_int(CFG, 'XBMC', 'xbmc_update_full', 0))
XBMC_UPDATE_ONLYFIRST = bool(check_setting_int(CFG, 'XBMC', 'xbmc_update_onlyfirst', 0))
XBMC_HOST = check_setting_str(CFG, 'XBMC', 'xbmc_host', '')
XBMC_USERNAME = check_setting_str(CFG, 'XBMC', 'xbmc_username', '')
XBMC_PASSWORD = check_setting_str(CFG, 'XBMC', 'xbmc_password', '')
USE_KODI = bool(check_setting_int(CFG, 'KODI', 'use_kodi', 0))
KODI_ALWAYS_ON = bool(check_setting_int(CFG, 'KODI', 'kodi_always_on', 1))
KODI_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'KODI', 'kodi_notify_onsnatch', 0))
KODI_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'KODI', 'kodi_notify_ondownload', 0))
KODI_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'KODI', 'kodi_notify_onsubtitledownload', 0))
KODI_UPDATE_LIBRARY = bool(check_setting_int(CFG, 'KODI', 'kodi_update_library', 0))
KODI_UPDATE_FULL = bool(check_setting_int(CFG, 'KODI', 'kodi_update_full', 0))
KODI_UPDATE_ONLYFIRST = bool(check_setting_int(CFG, 'KODI', 'kodi_update_onlyfirst', 0))
KODI_HOST = check_setting_str(CFG, 'KODI', 'kodi_host', '')
KODI_USERNAME = check_setting_str(CFG, 'KODI', 'kodi_username', '')
KODI_PASSWORD = check_setting_str(CFG, 'KODI', 'kodi_password', '')
USE_PLEX = bool(check_setting_int(CFG, 'Plex', 'use_plex', 0))
PLEX_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'Plex', 'plex_notify_onsnatch', 0))
@ -955,8 +955,8 @@ def initialize(consoleLogging=True):
ANIME_SPLIT_HOME = bool(check_setting_int(CFG, 'ANIME', 'anime_split_home', 0))
METADATA_XBMC = check_setting_str(CFG, 'General', 'metadata_xbmc', '0|0|0|0|0|0|0|0|0|0')
METADATA_XBMC_12PLUS = check_setting_str(CFG, 'General', 'metadata_xbmc_12plus', '0|0|0|0|0|0|0|0|0|0')
METADATA_KODI = check_setting_str(CFG, 'General', 'metadata_kodi', '0|0|0|0|0|0|0|0|0|0')
METADATA_KODI_12PLUS = check_setting_str(CFG, 'General', 'metadata_kodi_12plus', '0|0|0|0|0|0|0|0|0|0')
METADATA_MEDIABROWSER = check_setting_str(CFG, 'General', 'metadata_mediabrowser', '0|0|0|0|0|0|0|0|0|0')
METADATA_PS3 = check_setting_str(CFG, 'General', 'metadata_ps3', '0|0|0|0|0|0|0|0|0|0')
METADATA_WDTV = check_setting_str(CFG, 'General', 'metadata_wdtv', '0|0|0|0|0|0|0|0|0|0')
@ -1111,8 +1111,8 @@ def initialize(consoleLogging=True):
# initialize metadata_providers
metadata_provider_dict = metadata.get_metadata_generator_dict()
for cur_metadata_tuple in [(METADATA_XBMC, metadata.xbmc),
(METADATA_XBMC_12PLUS, metadata.xbmc_12plus),
for cur_metadata_tuple in [(METADATA_KODI, metadata.kodi),
(METADATA_KODI_12PLUS, metadata.kodi_12plus),
(METADATA_MEDIABROWSER, metadata.mediabrowser),
(METADATA_PS3, metadata.ps3),
(METADATA_WDTV, metadata.wdtv),
@ -1461,8 +1461,8 @@ def save_config():
new_config['General']['proxy_indexers'] = int(PROXY_INDEXERS)
new_config['General']['use_listview'] = int(USE_LISTVIEW)
new_config['General']['metadata_xbmc'] = METADATA_XBMC
new_config['General']['metadata_xbmc_12plus'] = METADATA_XBMC_12PLUS
new_config['General']['metadata_kodi'] = METADATA_KODI
new_config['General']['metadata_kodi_12plus'] = METADATA_KODI_12PLUS
new_config['General']['metadata_mediabrowser'] = METADATA_MEDIABROWSER
new_config['General']['metadata_ps3'] = METADATA_PS3
new_config['General']['metadata_wdtv'] = METADATA_WDTV
@ -1620,18 +1620,18 @@ def save_config():
new_config['TORRENT']['torrent_label_anime'] = TORRENT_LABEL_ANIME
new_config['TORRENT']['torrent_verify_cert'] = int(TORRENT_VERIFY_CERT)
new_config['XBMC'] = {}
new_config['XBMC']['use_xbmc'] = int(USE_XBMC)
new_config['XBMC']['xbmc_always_on'] = int(XBMC_ALWAYS_ON)
new_config['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH)
new_config['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD)
new_config['XBMC']['xbmc_notify_onsubtitledownload'] = int(XBMC_NOTIFY_ONSUBTITLEDOWNLOAD)
new_config['XBMC']['xbmc_update_library'] = int(XBMC_UPDATE_LIBRARY)
new_config['XBMC']['xbmc_update_full'] = int(XBMC_UPDATE_FULL)
new_config['XBMC']['xbmc_update_onlyfirst'] = int(XBMC_UPDATE_ONLYFIRST)
new_config['XBMC']['xbmc_host'] = XBMC_HOST
new_config['XBMC']['xbmc_username'] = XBMC_USERNAME
new_config['XBMC']['xbmc_password'] = helpers.encrypt(XBMC_PASSWORD, ENCRYPTION_VERSION)
new_config['KODI'] = {}
new_config['KODI']['use_kodi'] = int(USE_KODI)
new_config['KODI']['kodi_always_on'] = int(KODI_ALWAYS_ON)
new_config['KODI']['kodi_notify_onsnatch'] = int(KODI_NOTIFY_ONSNATCH)
new_config['KODI']['kodi_notify_ondownload'] = int(KODI_NOTIFY_ONDOWNLOAD)
new_config['KODI']['kodi_notify_onsubtitledownload'] = int(KODI_NOTIFY_ONSUBTITLEDOWNLOAD)
new_config['KODI']['kodi_update_library'] = int(KODI_UPDATE_LIBRARY)
new_config['KODI']['kodi_update_full'] = int(KODI_UPDATE_FULL)
new_config['KODI']['kodi_update_onlyfirst'] = int(KODI_UPDATE_ONLYFIRST)
new_config['KODI']['kodi_host'] = KODI_HOST
new_config['KODI']['kodi_username'] = KODI_USERNAME
new_config['KODI']['kodi_password'] = helpers.encrypt(KODI_PASSWORD, ENCRYPTION_VERSION)
new_config['Plex'] = {}
new_config['Plex']['use_plex'] = int(USE_PLEX)

View File

@ -661,11 +661,11 @@ class ConfigMigrator():
new format: 0|0|0|0|0|0|0|0|0|0 -- 10 places
Drop the use of use_banner option.
Migrate the poster override to just using the banner option (applies to xbmc only).
Migrate the poster override to just using the banner option (applies to kodi only).
"""
metadata_xbmc = check_setting_str(self.config_obj, 'General', 'metadata_xbmc', '0|0|0|0|0|0')
metadata_xbmc_12plus = check_setting_str(self.config_obj, 'General', 'metadata_xbmc_12plus', '0|0|0|0|0|0')
metadata_kodi = check_setting_str(self.config_obj, 'General', 'metadata_kodi', '0|0|0|0|0|0')
metadata_kodi_12plus = check_setting_str(self.config_obj, 'General', 'metadata_kodi_12plus', '0|0|0|0|0|0')
metadata_mediabrowser = check_setting_str(self.config_obj, 'General', 'metadata_mediabrowser', '0|0|0|0|0|0')
metadata_ps3 = check_setting_str(self.config_obj, 'General', 'metadata_ps3', '0|0|0|0|0|0')
metadata_wdtv = check_setting_str(self.config_obj, 'General', 'metadata_wdtv', '0|0|0|0|0|0')
@ -686,7 +686,7 @@ class ConfigMigrator():
# swap show fanart, show poster
cur_metadata[3], cur_metadata[2] = cur_metadata[2], cur_metadata[3]
# if user was using use_banner to override the poster, instead enable the banner option and deactivate poster
if metadata_name == 'XBMC' and use_banner:
if metadata_name == 'KODI' and use_banner:
cur_metadata[4], cur_metadata[3] = cur_metadata[3], '0'
# write new format
metadata = '|'.join(cur_metadata)
@ -705,8 +705,8 @@ class ConfigMigrator():
return metadata
sickbeard.METADATA_XBMC = _migrate_metadata(metadata_xbmc, 'XBMC', use_banner)
sickbeard.METADATA_XBMC_12PLUS = _migrate_metadata(metadata_xbmc_12plus, 'XBMC 12+', use_banner)
sickbeard.METADATA_KODI = _migrate_metadata(metadata_kodi, 'KODI', use_banner)
sickbeard.METADATA_KODI_12PLUS = _migrate_metadata(metadata_kodi_12plus, 'KODI 12+', use_banner)
sickbeard.METADATA_MEDIABROWSER = _migrate_metadata(metadata_mediabrowser, 'MediaBrowser', use_banner)
sickbeard.METADATA_PS3 = _migrate_metadata(metadata_ps3, 'PS3', use_banner)
sickbeard.METADATA_WDTV = _migrate_metadata(metadata_wdtv, 'WDTV', use_banner)

View File

@ -16,10 +16,10 @@
# You should have received a copy of the GNU General Public License
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
__all__ = ['generic', 'helpers', 'xbmc', 'xbmc_12plus', 'mediabrowser', 'ps3', 'wdtv', 'tivo', 'mede8er']
__all__ = ['generic', 'helpers', 'kodi', 'kodi_12plus', 'mediabrowser', 'ps3', 'wdtv', 'tivo', 'mede8er']
import sys
import xbmc, xbmc_12plus, mediabrowser, ps3, wdtv, tivo, mede8er
import kodi, kodi_12plus, mediabrowser, ps3, wdtv, tivo, mede8er
def available_generators():

View File

@ -39,7 +39,7 @@ from lib.tmdb_api.tmdb_api import TMDB
class GenericMetadata():
"""
Base class for all metadata providers. Default behavior is meant to mostly
follow XBMC 12+ metadata standards. Has support for:
follow KODI 12+ metadata standards. Has support for:
- show metadata file
- episode metadata file
- episode thumbnail

View File

@ -154,7 +154,7 @@ class MediaBrowserMetadata(generic.GenericMetadata):
for cur_dir in dir_list:
# MediaBrowser 1.x only supports 'Specials'
# MediaBrowser 2.x looks to only support 'Season 0'
# MediaBrowser 3.x looks to mimic XBMC/Plex support
# MediaBrowser 3.x looks to mimic KODI/Plex support
if season == 0 and cur_dir == "Specials":
season_dir = cur_dir
break
@ -194,7 +194,7 @@ class MediaBrowserMetadata(generic.GenericMetadata):
for cur_dir in dir_list:
# MediaBrowser 1.x only supports 'Specials'
# MediaBrowser 2.x looks to only support 'Season 0'
# MediaBrowser 3.x looks to mimic XBMC/Plex support
# MediaBrowser 3.x looks to mimic KODI/Plex support
if season == 0 and cur_dir == "Specials":
season_dir = cur_dir
break

View File

@ -17,7 +17,7 @@
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
import generic
import xbmc_12plus
import kodi_12plus
import os
@ -25,9 +25,9 @@ from sickbeard import helpers
from sickbeard import encodingKludge as ek
class XBMCMetadata(xbmc_12plus.XBMC_12PlusMetadata):
class KODIMetadata(kodi_12plus.KODI_12PlusMetadata):
"""
Metadata generation class for XBMC (legacy).
Metadata generation class for KODI (legacy).
The following file structure is used:
@ -66,7 +66,7 @@ class XBMCMetadata(xbmc_12plus.XBMC_12PlusMetadata):
season_all_poster,
season_all_banner)
self.name = 'XBMC'
self.name = 'KODI'
self.poster_name = self.banner_name = "folder.jpg"
self.season_all_poster_name = "season-all.tbn"
@ -123,4 +123,4 @@ class XBMCMetadata(xbmc_12plus.XBMC_12PlusMetadata):
# present a standard "interface" from the module
metadata_class = XBMCMetadata
metadata_class = KODIMetadata

View File

@ -26,9 +26,9 @@ from sickbeard.exceptions import ex
import xml.etree.cElementTree as etree
class XBMC_12PlusMetadata(generic.GenericMetadata):
class KODI_12PlusMetadata(generic.GenericMetadata):
"""
Metadata generation class for XBMC 12+.
Metadata generation class for KODI 12+.
The following file structure is used:
@ -69,7 +69,7 @@ class XBMC_12PlusMetadata(generic.GenericMetadata):
season_all_poster,
season_all_banner)
self.name = 'XBMC 12+'
self.name = 'KODI 12+'
self.poster_name = "poster.jpg"
self.season_all_poster_name = "season-all-poster.jpg"
@ -88,7 +88,7 @@ class XBMC_12PlusMetadata(generic.GenericMetadata):
def _show_data(self, show_obj):
"""
Creates an elementTree XML structure for an XBMC-style tvshow.nfo and
Creates an elementTree XML structure for an KODI-style tvshow.nfo and
returns the resulting data object.
show_obj: a TVShow instance to create the NFO for
@ -212,7 +212,7 @@ class XBMC_12PlusMetadata(generic.GenericMetadata):
def _ep_data(self, ep_obj):
"""
Creates an elementTree XML structure for an XBMC-style episode.nfo and
Creates an elementTree XML structure for an KODI-style episode.nfo and
returns the resulting data object.
show_obj: a TVEpisode instance to create the NFO for
"""
@ -242,7 +242,7 @@ class XBMC_12PlusMetadata(generic.GenericMetadata):
return
if len(eps_to_write) > 1:
rootNode = etree.Element("xbmcmultiepisode")
rootNode = etree.Element("kodimultiepisode")
else:
rootNode = etree.Element("episodedetails")
@ -373,4 +373,4 @@ class XBMC_12PlusMetadata(generic.GenericMetadata):
# present a standard "interface" from the module
metadata_class = XBMC_12PlusMetadata
metadata_class = KODI_12PlusMetadata

View File

@ -18,7 +18,7 @@
import sickbeard
import xbmc
import kodi
import plex
import nmj
import nmjv2
@ -43,7 +43,7 @@ import emailnotify
from sickbeard.common import *
# home theater / nas
xbmc_notifier = xbmc.XBMCNotifier()
kodi_notifier = kodi.KODINotifier()
plex_notifier = plex.PLEXNotifier()
nmj_notifier = nmj.NMJNotifier()
nmjv2_notifier = nmjv2.NMJv2Notifier()
@ -67,7 +67,7 @@ email_notifier = emailnotify.EmailNotifier()
notifiers = [
libnotify_notifier, # Libnotify notifier goes first because it doesn't involve blocking on network activity.
xbmc_notifier,
kodi_notifier,
plex_notifier,
nmj_notifier,
nmjv2_notifier,

View File

@ -27,13 +27,13 @@ from sickbeard import common
from sickbeard.exceptions import ex
from sickbeard.encodingKludge import toUnicode
from sickbeard.notifiers.xbmc import XBMCNotifier
from sickbeard.notifiers.kodi import KODINotifier
# TODO: switch over to using ElementTree
from xml.dom import minidom
class PLEXNotifier(XBMCNotifier):
class PLEXNotifier(KODINotifier):
def _notify_pmc(self, message, title="SickRage", host=None, username=None, password=None, force=False):
# fill in omitted parameters
if not host:
@ -52,7 +52,7 @@ 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,
return self._notify_kodi(message=message, title=title, host=host, username=username, password=password,
force=True)
def notify_snatch(self, ep_name):

View File

@ -40,27 +40,27 @@ except ImportError:
from lib import simplejson as json
class XBMCNotifier:
class KODINotifier:
sb_logo_url = 'https://raw.githubusercontent.com/SiCKRAGETV/SickRage/master/gui/slick/images/sickrage-shark-mascot.png'
def _get_xbmc_version(self, host, username, password):
"""Returns XBMC JSON-RPC API version (odd # = dev, even # = stable)
def _get_kodi_version(self, host, username, password):
"""Returns KODI JSON-RPC API version (odd # = dev, even # = stable)
Sends a request to the XBMC host using the JSON-RPC to determine if
Sends a request to the KODI host using the JSON-RPC to determine if
the legacy API or if the JSON-RPC API functions should be used.
Fallback to testing legacy HTTPAPI before assuming it is just a badly configured host.
Args:
host: XBMC webserver host:port
username: XBMC webserver username
password: XBMC webserver password
host: KODI webserver host:port
username: KODI webserver username
password: KODI webserver password
Returns:
Returns API number or False
List of possible known values:
API | XBMC Version
API | KODI Version
-----+---------------
2 | v10 (Dharma)
3 | (pre Eden)
@ -75,7 +75,7 @@ class XBMCNotifier:
socket.setdefaulttimeout(10)
checkCommand = '{"jsonrpc":"2.0","method":"JSONRPC.Version","id":1}'
result = self._send_to_xbmc_json(checkCommand, host, username, password)
result = self._send_to_kodi_json(checkCommand, host, username, password)
# revert back to default socket timeout
socket.setdefaulttimeout(sickbeard.SOCKET_TIMEOUT)
@ -85,14 +85,14 @@ class XBMCNotifier:
else:
# fallback to legacy HTTPAPI method
testCommand = {'command': 'Help'}
request = self._send_to_xbmc(testCommand, host, username, password)
request = self._send_to_kodi(testCommand, host, username, password)
if request:
# return a fake version number, so it uses the legacy method
return 1
else:
return False
def _notify_xbmc(self, message, title="SickRage", host=None, username=None, password=None, force=False):
def _notify_kodi(self, message, title="SickRage", host=None, username=None, password=None, force=False):
"""Internal wrapper for the notify_snatch and notify_download functions
Detects JSON-RPC version then branches the logic for either the JSON-RPC or legacy HTTP API methods.
@ -100,9 +100,9 @@ class XBMCNotifier:
Args:
message: Message body of the notice to send
title: Title of the notice to send
host: XBMC webserver host:port
username: XBMC webserver username
password: XBMC webserver password
host: KODI webserver host:port
username: KODI webserver username
password: KODI webserver password
force: Used for the Test method to override config saftey checks
Returns:
@ -113,42 +113,42 @@ class XBMCNotifier:
# fill in omitted parameters
if not host:
host = sickbeard.XBMC_HOST
host = sickbeard.KODI_HOST
if not username:
username = sickbeard.XBMC_USERNAME
username = sickbeard.KODI_USERNAME
if not password:
password = sickbeard.XBMC_PASSWORD
password = sickbeard.KODI_PASSWORD
# suppress notifications if the notifier is disabled but the notify options are checked
if not sickbeard.USE_XBMC and not force:
logger.log("Notification for XBMC not enabled, skipping this notification", logger.DEBUG)
if not sickbeard.USE_KODI and not force:
logger.log("Notification for KODI not enabled, skipping this notification", logger.DEBUG)
return False
result = ''
for curHost in [x.strip() for x in host.split(",")]:
logger.log(u"Sending XBMC notification to '" + curHost + "' - " + message, logger.MESSAGE)
logger.log(u"Sending KODI notification to '" + curHost + "' - " + message, logger.MESSAGE)
xbmcapi = self._get_xbmc_version(curHost, username, password)
if xbmcapi:
if (xbmcapi <= 4):
logger.log(u"Detected XBMC version <= 11, using XBMC HTTP API", logger.DEBUG)
kodiapi = self._get_kodi_version(curHost, username, password)
if kodiapi:
if (kodiapi <= 4):
logger.log(u"Detected KODI version <= 11, using KODI HTTP API", logger.DEBUG)
command = {'command': 'ExecBuiltIn',
'parameter': 'Notification(' + title.encode("utf-8") + ',' + message.encode(
"utf-8") + ')'}
notifyResult = self._send_to_xbmc(command, curHost, username, password)
notifyResult = self._send_to_kodi(command, curHost, username, password)
if notifyResult:
result += curHost + ':' + str(notifyResult)
else:
logger.log(u"Detected XBMC version >= 12, using XBMC JSON API", logger.DEBUG)
logger.log(u"Detected KODI version >= 12, using KODI JSON API", logger.DEBUG)
command = '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"%s","message":"%s", "image": "%s"},"id":1}' % (
title.encode("utf-8"), message.encode("utf-8"), self.sb_logo_url)
notifyResult = self._send_to_xbmc_json(command, curHost, username, password)
notifyResult = self._send_to_kodi_json(command, curHost, username, password)
if notifyResult.get('result'):
result += curHost + ':' + notifyResult["result"].decode(sickbeard.SYS_ENCODING)
else:
if sickbeard.XBMC_ALWAYS_ON or force:
if sickbeard.KODI_ALWAYS_ON or force:
logger.log(
u"Failed to detect XBMC version for '" + curHost + "', check configuration and try again.",
u"Failed to detect KODI version for '" + curHost + "', check configuration and try again.",
logger.ERROR)
result += curHost + ':False'
@ -157,10 +157,10 @@ class XBMCNotifier:
def _send_update_library(self, host, showName=None):
"""Internal wrapper for the update library function to branch the logic for JSON-RPC or legacy HTTP API
Checks the XBMC API version to branch the logic to call either the legacy HTTP API or the newer JSON-RPC over HTTP methods.
Checks the KODI API version to branch the logic to call either the legacy HTTP API or the newer JSON-RPC over HTTP methods.
Args:
host: XBMC webserver host:port
host: KODI webserver host:port
showName: Name of a TV show to specifically target the library update for
Returns:
@ -168,43 +168,43 @@ class XBMCNotifier:
"""
logger.log(u"Sending request to update library for XBMC host: '" + host + "'", logger.MESSAGE)
logger.log(u"Sending request to update library for KODI host: '" + host + "'", logger.MESSAGE)
xbmcapi = self._get_xbmc_version(host, sickbeard.XBMC_USERNAME, sickbeard.XBMC_PASSWORD)
if xbmcapi:
if (xbmcapi <= 4):
kodiapi = self._get_kodi_version(host, sickbeard.KODI_USERNAME, sickbeard.KODI_PASSWORD)
if kodiapi:
if (kodiapi <= 4):
# try to update for just the show, if it fails, do full update if enabled
if not self._update_library(host, showName) and sickbeard.XBMC_UPDATE_FULL:
if not self._update_library(host, showName) and sickbeard.KODI_UPDATE_FULL:
logger.log(u"Single show update failed, falling back to full update", logger.WARNING)
return self._update_library(host)
else:
return True
else:
# try to update for just the show, if it fails, do full update if enabled
if not self._update_library_json(host, showName) and sickbeard.XBMC_UPDATE_FULL:
if not self._update_library_json(host, showName) and sickbeard.KODI_UPDATE_FULL:
logger.log(u"Single show update failed, falling back to full update", logger.WARNING)
return self._update_library_json(host)
else:
return True
else:
logger.log(u"Failed to detect XBMC version for '" + host + "', check configuration and try again.",
logger.log(u"Failed to detect KODI version for '" + host + "', check configuration and try again.",
logger.DEBUG)
return False
return False
# #############################################################################
# Legacy HTTP API (pre XBMC 12) methods
# Legacy HTTP API (pre KODI 12) methods
##############################################################################
def _send_to_xbmc(self, command, host=None, username=None, password=None):
"""Handles communication to XBMC servers via HTTP API
def _send_to_kodi(self, command, host=None, username=None, password=None):
"""Handles communication to KODI servers via HTTP API
Args:
command: Dictionary of field/data pairs, encoded via urllib and passed to the XBMC API via HTTP
host: XBMC webserver host:port
username: XBMC webserver username
password: XBMC webserver password
command: Dictionary of field/data pairs, encoded via urllib and passed to the KODI API via HTTP
host: KODI webserver host:port
username: KODI webserver username
password: KODI webserver password
Returns:
Returns response.result for successful commands or False if there was an error
@ -213,12 +213,12 @@ class XBMCNotifier:
# fill in omitted parameters
if not username:
username = sickbeard.XBMC_USERNAME
username = sickbeard.KODI_USERNAME
if not password:
password = sickbeard.XBMC_PASSWORD
password = sickbeard.KODI_PASSWORD
if not host:
logger.log(u'No XBMC host passed, aborting update', logger.DEBUG)
logger.log(u'No KODI host passed, aborting update', logger.DEBUG)
return False
for key in command:
@ -226,9 +226,9 @@ class XBMCNotifier:
command[key] = command[key].encode('utf-8')
enc_command = urllib.urlencode(command)
logger.log(u"XBMC encoded API command: " + enc_command, logger.DEBUG)
logger.log(u"KODI encoded API command: " + enc_command, logger.DEBUG)
url = 'http://%s/xbmcCmds/xbmcHttp/?%s' % (host, enc_command)
url = 'http://%s/kodiCmds/kodiHttp/?%s' % (host, enc_command)
try:
req = urllib2.Request(url)
# if we have a password, use authentication
@ -236,30 +236,30 @@ class XBMCNotifier:
base64string = base64.encodestring('%s:%s' % (username, password))[:-1]
authheader = "Basic %s" % base64string
req.add_header("Authorization", authheader)
logger.log(u"Contacting XBMC (with auth header) via url: " + toUnicode(url), logger.DEBUG)
logger.log(u"Contacting KODI (with auth header) via url: " + toUnicode(url), logger.DEBUG)
else:
logger.log(u"Contacting XBMC via url: " + toUnicode(url), logger.DEBUG)
logger.log(u"Contacting KODI via url: " + toUnicode(url), logger.DEBUG)
response = urllib2.urlopen(req)
result = response.read().decode(sickbeard.SYS_ENCODING)
response.close()
logger.log(u"XBMC HTTP response: " + result.replace('\n', ''), logger.DEBUG)
logger.log(u"KODI HTTP response: " + result.replace('\n', ''), logger.DEBUG)
return result
except (urllib2.URLError, IOError), e:
logger.log(u"Warning: Couldn't contact XBMC HTTP at " + toUnicode(url) + " " + ex(e),
logger.log(u"Warning: Couldn't contact KODI HTTP at " + toUnicode(url) + " " + ex(e),
logger.WARNING)
return False
def _update_library(self, host=None, showName=None):
"""Handles updating XBMC host via HTTP API
"""Handles updating KODI host via HTTP API
Attempts to update the XBMC video library for a specific tv show if passed,
Attempts to update the KODI video library for a specific tv show if passed,
otherwise update the whole library if enabled.
Args:
host: XBMC webserver host:port
host: KODI webserver host:port
showName: Name of a TV show to specifically target the library update for
Returns:
@ -268,14 +268,14 @@ class XBMCNotifier:
"""
if not host:
logger.log(u'No XBMC host passed, aborting update', logger.DEBUG)
logger.log(u'No KODI host passed, aborting update', logger.DEBUG)
return False
logger.log(u"Updating XMBC library via HTTP method for host: " + host, logger.DEBUG)
# if we're doing per-show
if showName:
logger.log(u"Updating library in XBMC via HTTP method for show " + showName, logger.DEBUG)
logger.log(u"Updating library in KODI via HTTP method for show " + showName, logger.DEBUG)
pathSql = 'select path.strPath from path, tvshow, tvshowlinkpath where ' \
'tvshow.c00 = "%s" and tvshowlinkpath.idShow = tvshow.idShow ' \
@ -290,12 +290,12 @@ class XBMCNotifier:
resetCommand = {'command': 'SetResponseFormat()'}
# set xml response format, if this fails then don't bother with the rest
request = self._send_to_xbmc(xmlCommand, host)
request = self._send_to_kodi(xmlCommand, host)
if not request:
return False
sqlXML = self._send_to_xbmc(sqlCommand, host)
request = self._send_to_xbmc(resetCommand, host)
sqlXML = self._send_to_kodi(sqlCommand, host)
request = self._send_to_kodi(resetCommand, host)
if not sqlXML:
logger.log(u"Invalid response for " + showName + " on " + host, logger.DEBUG)
@ -305,7 +305,7 @@ class XBMCNotifier:
try:
et = etree.fromstring(encSqlXML)
except SyntaxError, e:
logger.log(u"Unable to parse XML returned from XBMC: " + ex(e), logger.ERROR)
logger.log(u"Unable to parse XML returned from KODI: " + ex(e), logger.ERROR)
return False
paths = et.findall('.//field')
@ -317,40 +317,40 @@ class XBMCNotifier:
for path in paths:
# we do not need it double-encoded, gawd this is dumb
unEncPath = urllib.unquote(path.text).decode(sickbeard.SYS_ENCODING)
logger.log(u"XBMC Updating " + showName + " on " + host + " at " + unEncPath, logger.DEBUG)
updateCommand = {'command': 'ExecBuiltIn', 'parameter': 'XBMC.updatelibrary(video, %s)' % (unEncPath)}
request = self._send_to_xbmc(updateCommand, host)
logger.log(u"KODI Updating " + showName + " on " + host + " at " + unEncPath, logger.DEBUG)
updateCommand = {'command': 'ExecBuiltIn', 'parameter': 'KODI.updatelibrary(video, %s)' % (unEncPath)}
request = self._send_to_kodi(updateCommand, host)
if not request:
logger.log(u"Update of show directory failed on " + showName + " on " + host + " at " + unEncPath,
logger.ERROR)
return False
# sleep for a few seconds just to be sure xbmc has a chance to finish each directory
# sleep for a few seconds just to be sure kodi has a chance to finish each directory
if len(paths) > 1:
time.sleep(5)
# do a full update if requested
else:
logger.log(u"Doing Full Library XBMC update on host: " + host, logger.MESSAGE)
updateCommand = {'command': 'ExecBuiltIn', 'parameter': 'XBMC.updatelibrary(video)'}
request = self._send_to_xbmc(updateCommand, host)
logger.log(u"Doing Full Library KODI update on host: " + host, logger.MESSAGE)
updateCommand = {'command': 'ExecBuiltIn', 'parameter': 'KODI.updatelibrary(video)'}
request = self._send_to_kodi(updateCommand, host)
if not request:
logger.log(u"XBMC Full Library update failed on: " + host, logger.ERROR)
logger.log(u"KODI Full Library update failed on: " + host, logger.ERROR)
return False
return True
##############################################################################
# JSON-RPC API (XBMC 12+) methods
# JSON-RPC API (KODI 12+) methods
##############################################################################
def _send_to_xbmc_json(self, command, host=None, username=None, password=None):
"""Handles communication to XBMC servers via JSONRPC
def _send_to_kodi_json(self, command, host=None, username=None, password=None):
"""Handles communication to KODI servers via JSONRPC
Args:
command: Dictionary of field/data pairs, encoded via urllib and passed to the XBMC JSON-RPC via HTTP
host: XBMC webserver host:port
username: XBMC webserver username
password: XBMC webserver password
command: Dictionary of field/data pairs, encoded via urllib and passed to the KODI JSON-RPC via HTTP
host: KODI webserver host:port
username: KODI webserver username
password: KODI webserver password
Returns:
Returns response.result for successful commands or False if there was an error
@ -359,16 +359,16 @@ class XBMCNotifier:
# fill in omitted parameters
if not username:
username = sickbeard.XBMC_USERNAME
username = sickbeard.KODI_USERNAME
if not password:
password = sickbeard.XBMC_PASSWORD
password = sickbeard.KODI_PASSWORD
if not host:
logger.log(u'No XBMC host passed, aborting update', logger.DEBUG)
logger.log(u'No KODI host passed, aborting update', logger.DEBUG)
return False
command = command.encode('utf-8')
logger.log(u"XBMC JSON command: " + command, logger.DEBUG)
logger.log(u"KODI JSON command: " + command, logger.DEBUG)
url = 'http://%s/jsonrpc' % (host)
try:
@ -379,14 +379,14 @@ class XBMCNotifier:
base64string = base64.encodestring('%s:%s' % (username, password))[:-1]
authheader = "Basic %s" % base64string
req.add_header("Authorization", authheader)
logger.log(u"Contacting XBMC (with auth header) via url: " + toUnicode(url), logger.DEBUG)
logger.log(u"Contacting KODI (with auth header) via url: " + toUnicode(url), logger.DEBUG)
else:
logger.log(u"Contacting XBMC via url: " + toUnicode(url), logger.DEBUG)
logger.log(u"Contacting KODI via url: " + toUnicode(url), logger.DEBUG)
try:
response = urllib2.urlopen(req)
except urllib2.URLError, e:
logger.log(u"Error while trying to retrieve XBMC API version for " + host + ": " + ex(e),
logger.log(u"Error while trying to retrieve KODI API version for " + host + ": " + ex(e),
logger.WARNING)
return False
@ -394,25 +394,25 @@ class XBMCNotifier:
try:
result = json.load(response)
response.close()
logger.log(u"XBMC JSON response: " + str(result), logger.DEBUG)
logger.log(u"KODI JSON response: " + str(result), logger.DEBUG)
return result # need to return response for parsing
except ValueError, e:
logger.log(u"Unable to decode JSON: " + response, logger.WARNING)
return False
except IOError, e:
logger.log(u"Warning: Couldn't contact XBMC JSON API at " + toUnicode(url) + " " + ex(e),
logger.log(u"Warning: Couldn't contact KODI JSON API at " + toUnicode(url) + " " + ex(e),
logger.WARNING)
return False
def _update_library_json(self, host=None, showName=None):
"""Handles updating XBMC host via HTTP JSON-RPC
"""Handles updating KODI host via HTTP JSON-RPC
Attempts to update the XBMC video library for a specific tv show if passed,
Attempts to update the KODI video library for a specific tv show if passed,
otherwise update the whole library if enabled.
Args:
host: XBMC webserver host:port
host: KODI webserver host:port
showName: Name of a TV show to specifically target the library update for
Returns:
@ -421,7 +421,7 @@ class XBMCNotifier:
"""
if not host:
logger.log(u'No XBMC host passed, aborting update', logger.DEBUG)
logger.log(u'No KODI host passed, aborting update', logger.DEBUG)
return False
logger.log(u"Updating XMBC library via JSON method for host: " + host, logger.MESSAGE)
@ -429,16 +429,16 @@ class XBMCNotifier:
# if we're doing per-show
if showName:
tvshowid = -1
logger.log(u"Updating library in XBMC via JSON method for show " + showName, logger.DEBUG)
logger.log(u"Updating library in KODI via JSON method for show " + showName, logger.DEBUG)
# get tvshowid by showName
showsCommand = '{"jsonrpc":"2.0","method":"VideoLibrary.GetTVShows","id":1}'
showsResponse = self._send_to_xbmc_json(showsCommand, host)
showsResponse = self._send_to_kodi_json(showsCommand, host)
if showsResponse and "result" in showsResponse and "tvshows" in showsResponse["result"]:
shows = showsResponse["result"]["tvshows"]
else:
logger.log(u"XBMC: No tvshows in XBMC TV show list", logger.DEBUG)
logger.log(u"KODI: No tvshows in KODI TV show list", logger.DEBUG)
return False
for show in shows:
@ -451,13 +451,13 @@ class XBMCNotifier:
# we didn't find the show (exact match), thus revert to just doing a full update if enabled
if (tvshowid == -1):
logger.log(u'Exact show name not matched in XBMC TV show list', logger.DEBUG)
logger.log(u'Exact show name not matched in KODI TV show list', logger.DEBUG)
return False
# lookup tv-show path
pathCommand = '{"jsonrpc":"2.0","method":"VideoLibrary.GetTVShowDetails","params":{"tvshowid":%d, "properties": ["file"]},"id":1}' % (
tvshowid)
pathResponse = self._send_to_xbmc_json(pathCommand, host)
pathResponse = self._send_to_kodi_json(pathCommand, host)
path = pathResponse["result"]["tvshowdetails"]["file"]
logger.log(u"Received Show: " + showName + " with ID: " + str(tvshowid) + " Path: " + path,
@ -468,10 +468,10 @@ class XBMCNotifier:
logger.WARNING)
return False
logger.log(u"XBMC Updating " + showName + " on " + host + " at " + path, logger.DEBUG)
logger.log(u"KODI Updating " + showName + " on " + host + " at " + path, logger.DEBUG)
updateCommand = '{"jsonrpc":"2.0","method":"VideoLibrary.Scan","params":{"directory":%s},"id":1}' % (
json.dumps(path))
request = self._send_to_xbmc_json(updateCommand, host)
request = self._send_to_kodi_json(updateCommand, host)
if not request:
logger.log(u"Update of show directory failed on " + showName + " on " + host + " at " + path,
logger.ERROR)
@ -487,12 +487,12 @@ class XBMCNotifier:
# do a full update if requested
else:
logger.log(u"Doing Full Library XBMC update on host: " + host, logger.MESSAGE)
logger.log(u"Doing Full Library KODI update on host: " + host, logger.MESSAGE)
updateCommand = '{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}'
request = self._send_to_xbmc_json(updateCommand, host, sickbeard.XBMC_USERNAME, sickbeard.XBMC_PASSWORD)
request = self._send_to_kodi_json(updateCommand, host, sickbeard.KODI_USERNAME, sickbeard.KODI_PASSWORD)
if not request:
logger.log(u"XBMC Full Library update failed on: " + host, logger.ERROR)
logger.log(u"KODI Full Library update failed on: " + host, logger.ERROR)
return False
return True
@ -502,31 +502,31 @@ class XBMCNotifier:
##############################################################################
def notify_snatch(self, ep_name):
if sickbeard.XBMC_NOTIFY_ONSNATCH:
self._notify_xbmc(ep_name, common.notifyStrings[common.NOTIFY_SNATCH])
if sickbeard.KODI_NOTIFY_ONSNATCH:
self._notify_kodi(ep_name, common.notifyStrings[common.NOTIFY_SNATCH])
def notify_download(self, ep_name):
if sickbeard.XBMC_NOTIFY_ONDOWNLOAD:
self._notify_xbmc(ep_name, common.notifyStrings[common.NOTIFY_DOWNLOAD])
if sickbeard.KODI_NOTIFY_ONDOWNLOAD:
self._notify_kodi(ep_name, common.notifyStrings[common.NOTIFY_DOWNLOAD])
def notify_subtitle_download(self, ep_name, lang):
if sickbeard.XBMC_NOTIFY_ONSUBTITLEDOWNLOAD:
self._notify_xbmc(ep_name + ": " + lang, common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD])
if sickbeard.KODI_NOTIFY_ONSUBTITLEDOWNLOAD:
self._notify_kodi(ep_name + ": " + lang, common.notifyStrings[common.NOTIFY_SUBTITLE_DOWNLOAD])
def notify_git_update(self, new_version = "??"):
if sickbeard.USE_XBMC:
if sickbeard.USE_KODI:
update_text=common.notifyStrings[common.NOTIFY_GIT_UPDATE_TEXT]
title=common.notifyStrings[common.NOTIFY_GIT_UPDATE]
self._notify_xbmc(update_text + new_version, title)
self._notify_kodi(update_text + new_version, title)
def test_notify(self, host, username, password):
return self._notify_xbmc("Testing XBMC notifications from SickRage", "Test Notification", host, username,
return self._notify_kodi("Testing KODI notifications from SickRage", "Test Notification", host, username,
password, force=True)
def update_library(self, showName=None):
"""Public wrapper for the update library functions to branch the logic for JSON-RPC or legacy HTTP API
Checks the XBMC API version to branch the logic to call either the legacy HTTP API or the newer JSON-RPC over HTTP methods.
Checks the KODI API version to branch the logic to call either the legacy HTTP API or the newer JSON-RPC over HTTP methods.
Do the ability of accepting a list of hosts deliminated by comma, only one host is updated, the first to respond with success.
This is a workaround for SQL backend users as updating multiple clients causes duplicate entries.
Future plan is to revist how we store the host/ip/username/pw/options so that it may be more flexible.
@ -539,27 +539,27 @@ class XBMCNotifier:
"""
if sickbeard.USE_XBMC and sickbeard.XBMC_UPDATE_LIBRARY:
if not sickbeard.XBMC_HOST:
logger.log(u"No XBMC hosts specified, check your settings", logger.DEBUG)
if sickbeard.USE_KODI and sickbeard.KODI_UPDATE_LIBRARY:
if not sickbeard.KODI_HOST:
logger.log(u"No KODI hosts specified, check your settings", logger.DEBUG)
return False
# either update each host, or only attempt to update until one successful result
result = 0
for host in [x.strip() for x in sickbeard.XBMC_HOST.split(",")]:
for host in [x.strip() for x in sickbeard.KODI_HOST.split(",")]:
if self._send_update_library(host, showName):
if sickbeard.XBMC_UPDATE_ONLYFIRST:
if sickbeard.KODI_UPDATE_ONLYFIRST:
logger.log(u"Successfully updated '" + host + "', stopped sending update library commands.",
logger.DEBUG)
return True
else:
if sickbeard.XBMC_ALWAYS_ON:
if sickbeard.KODI_ALWAYS_ON:
logger.log(
u"Failed to detect XBMC version for '" + host + "', check configuration and try again.",
u"Failed to detect KODI version for '" + host + "', check configuration and try again.",
logger.ERROR)
result = result + 1
# needed for the 'update xbmc' submenu command
# needed for the 'update kodi' submenu command
# as it only cares of the final result vs the individual ones
if result == 0:
return True
@ -567,4 +567,4 @@ class XBMCNotifier:
return False
notifier = XBMCNotifier
notifier = KODINotifier

View File

@ -1009,8 +1009,8 @@ class PostProcessor(object):
# send notifications
notifiers.notify_download(ep_obj._format_pattern('%SN - %Sx%0E - %EN - %QN'))
# do the library update for XBMC
notifiers.xbmc_notifier.update_library(ep_obj.show.name)
# do the library update for KODI
notifiers.kodi_notifier.update_library(ep_obj.show.name)
# do the library update for Plex
notifiers.plex_notifier.update_library()

View File

@ -1763,7 +1763,7 @@ class ConfigPostProcessing(MainHandler):
def savePostProcessing(self, naming_pattern=None, naming_multi_ep=None,
xbmc_data=None, xbmc_12plus_data=None, mediabrowser_data=None, sony_ps3_data=None,
kodi_data=None, kodi_12plus_data=None, mediabrowser_data=None, sony_ps3_data=None,
wdtv_data=None, tivo_data=None, mede8er_data=None,
keep_processed_dir=None, process_method=None, process_automatically=None,
rename_episodes=None, airdate_episodes=None, unpack=None,
@ -1823,16 +1823,16 @@ class ConfigPostProcessing(MainHandler):
sickbeard.SKIP_REMOVED_FILES = config.checkbox_to_value(skip_removed_files)
sickbeard.NFO_RENAME = config.checkbox_to_value(nfo_rename)
sickbeard.METADATA_XBMC = xbmc_data
sickbeard.METADATA_XBMC_12PLUS = xbmc_12plus_data
sickbeard.METADATA_KODI = kodi_data
sickbeard.METADATA_KODI_12PLUS = kodi_12plus_data
sickbeard.METADATA_MEDIABROWSER = mediabrowser_data
sickbeard.METADATA_PS3 = sony_ps3_data
sickbeard.METADATA_WDTV = wdtv_data
sickbeard.METADATA_TIVO = tivo_data
sickbeard.METADATA_MEDE8ER = mede8er_data
sickbeard.metadata_provider_dict['XBMC'].set_config(sickbeard.METADATA_XBMC)
sickbeard.metadata_provider_dict['XBMC 12+'].set_config(sickbeard.METADATA_XBMC_12PLUS)
sickbeard.metadata_provider_dict['KODI'].set_config(sickbeard.METADATA_KODI)
sickbeard.metadata_provider_dict['KODI 12+'].set_config(sickbeard.METADATA_KODI_12PLUS)
sickbeard.metadata_provider_dict['MediaBrowser'].set_config(sickbeard.METADATA_MEDIABROWSER)
sickbeard.metadata_provider_dict['Sony PS3'].set_config(sickbeard.METADATA_PS3)
sickbeard.metadata_provider_dict['WDTV'].set_config(sickbeard.METADATA_WDTV)
@ -2398,11 +2398,11 @@ class ConfigNotifications(MainHandler):
return _munge(t)
def saveNotifications(self, use_xbmc=None, xbmc_always_on=None, xbmc_notify_onsnatch=None,
xbmc_notify_ondownload=None,
xbmc_notify_onsubtitledownload=None, xbmc_update_onlyfirst=None,
xbmc_update_library=None, xbmc_update_full=None, xbmc_host=None, xbmc_username=None,
xbmc_password=None,
def saveNotifications(self, use_kodi=None, kodi_always_on=None, kodi_notify_onsnatch=None,
kodi_notify_ondownload=None,
kodi_notify_onsubtitledownload=None, kodi_update_onlyfirst=None,
kodi_update_library=None, kodi_update_full=None, kodi_host=None, kodi_username=None,
kodi_password=None,
use_plex=None, plex_notify_onsnatch=None, plex_notify_ondownload=None,
plex_notify_onsubtitledownload=None, plex_update_library=None,
plex_server_host=None, plex_host=None, plex_username=None, plex_password=None,
@ -2445,17 +2445,17 @@ class ConfigNotifications(MainHandler):
results = []
sickbeard.USE_XBMC = config.checkbox_to_value(use_xbmc)
sickbeard.XBMC_ALWAYS_ON = config.checkbox_to_value(xbmc_always_on)
sickbeard.XBMC_NOTIFY_ONSNATCH = config.checkbox_to_value(xbmc_notify_onsnatch)
sickbeard.XBMC_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(xbmc_notify_ondownload)
sickbeard.XBMC_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(xbmc_notify_onsubtitledownload)
sickbeard.XBMC_UPDATE_LIBRARY = config.checkbox_to_value(xbmc_update_library)
sickbeard.XBMC_UPDATE_FULL = config.checkbox_to_value(xbmc_update_full)
sickbeard.XBMC_UPDATE_ONLYFIRST = config.checkbox_to_value(xbmc_update_onlyfirst)
sickbeard.XBMC_HOST = config.clean_hosts(xbmc_host)
sickbeard.XBMC_USERNAME = xbmc_username
sickbeard.XBMC_PASSWORD = xbmc_password
sickbeard.USE_KODI = config.checkbox_to_value(use_kodi)
sickbeard.KODI_ALWAYS_ON = config.checkbox_to_value(kodi_always_on)
sickbeard.KODI_NOTIFY_ONSNATCH = config.checkbox_to_value(kodi_notify_onsnatch)
sickbeard.KODI_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(kodi_notify_ondownload)
sickbeard.KODI_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(kodi_notify_onsubtitledownload)
sickbeard.KODI_UPDATE_LIBRARY = config.checkbox_to_value(kodi_update_library)
sickbeard.KODI_UPDATE_FULL = config.checkbox_to_value(kodi_update_full)
sickbeard.KODI_UPDATE_ONLYFIRST = config.checkbox_to_value(kodi_update_onlyfirst)
sickbeard.KODI_HOST = config.clean_hosts(kodi_host)
sickbeard.KODI_USERNAME = kodi_username
sickbeard.KODI_PASSWORD = kodi_password
sickbeard.USE_PLEX = config.checkbox_to_value(use_plex)
sickbeard.PLEX_NOTIFY_ONSNATCH = config.checkbox_to_value(plex_notify_onsnatch)
@ -2710,8 +2710,8 @@ class Config(MainHandler):
anime = ConfigAnime
def haveXBMC():
return sickbeard.USE_XBMC and sickbeard.XBMC_UPDATE_LIBRARY
def haveKODI():
return sickbeard.USE_KODI and sickbeard.KODI_UPDATE_LIBRARY
def havePLEX():
@ -2731,7 +2731,7 @@ def HomeMenu():
return [
{'title': 'Add Shows', 'path': 'home/addShows/', },
{'title': 'Manual Post-Processing', 'path': 'home/postprocess/'},
{'title': 'Update XBMC', 'path': 'home/updateXBMC/', 'requires': haveXBMC},
{'title': 'Update KODI', 'path': 'home/updateKODI/', 'requires': haveKODI},
{'title': 'Update Plex', 'path': 'home/updatePLEX/', 'requires': havePLEX},
{'title': 'Manage Torrents', 'path': 'manage/manageTorrents', 'requires': haveTORRENT},
{'title': 'Restart', 'path': 'home/restart/?pid=' + str(sickbeard.PID), 'confirm': True},
@ -2878,7 +2878,7 @@ class NewHomeAddShows(MainHandler):
cur_path),
}
# see if the folder is in XBMC already
# see if the folder is in KODI already
dirResults = myDB.select("SELECT * FROM tv_shows WHERE location = ?", [cur_path])
if dirResults:
@ -3494,17 +3494,17 @@ class Home(MainHandler):
return "Error sending tweet"
def testXBMC(self, host=None, username=None, password=None):
def testKODI(self, host=None, username=None, password=None):
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
host = config.clean_hosts(host)
finalResult = ''
for curHost in [x.strip() for x in host.split(",")]:
curResult = notifiers.xbmc_notifier.test_notify(urllib.unquote_plus(curHost), username, password)
curResult = notifiers.kodi_notifier.test_notify(urllib.unquote_plus(curHost), username, password)
if len(curResult.split(":")) > 2 and 'OK' in curResult.split(":")[2]:
finalResult += "Test XBMC notice sent successfully to " + urllib.unquote_plus(curHost)
finalResult += "Test KODI notice sent successfully to " + urllib.unquote_plus(curHost)
else:
finalResult += "Test XBMC notice failed to " + urllib.unquote_plus(curHost)
finalResult += "Test KODI notice failed to " + urllib.unquote_plus(curHost)
finalResult += "<br />\n"
return finalResult
@ -3760,9 +3760,9 @@ class Home(MainHandler):
t.submenu.append({'title': 'Re-scan files', 'path': 'home/refreshShow?show=%d' % showObj.indexerid})
t.submenu.append(
{'title': 'Force Full Update', 'path': 'home/updateShow?show=%d&amp;force=1' % showObj.indexerid})
t.submenu.append({'title': 'Update show in XBMC',
'path': 'home/updateXBMC?showName=%s' % urllib.quote_plus(
showObj.name.encode('utf-8')), 'requires': haveXBMC})
t.submenu.append({'title': 'Update show in KODI',
'path': 'home/updateKODI?showName=%s' % urllib.quote_plus(
showObj.name.encode('utf-8')), 'requires': haveKODI})
t.submenu.append({'title': 'Preview Rename', 'path': 'home/testRename?show=%d' % showObj.indexerid})
if sickbeard.USE_SUBTITLES and not sickbeard.showQueueScheduler.action.isBeingSubtitled(
showObj) and showObj.subtitles:
@ -4182,19 +4182,19 @@ class Home(MainHandler):
redirect("/home/displayShow?show=" + str(showObj.indexerid))
def updateXBMC(self, showName=None):
def updateKODI(self, showName=None):
# only send update to first host in the list -- workaround for xbmc sql backend users
if sickbeard.XBMC_UPDATE_ONLYFIRST:
# only send update to first host in the list -- workaround for xbmc sql backend users
host = sickbeard.XBMC_HOST.split(",")[0].strip()
# only send update to first host in the list -- workaround for kodi sql backend users
if sickbeard.KODI_UPDATE_ONLYFIRST:
# only send update to first host in the list -- workaround for kodi sql backend users
host = sickbeard.KODI_HOST.split(",")[0].strip()
else:
host = sickbeard.XBMC_HOST
host = sickbeard.KODI_HOST
if notifiers.xbmc_notifier.update_library(showName=showName):
ui.notifications.message("Library update command sent to XBMC host(s): " + host)
if notifiers.kodi_notifier.update_library(showName=showName):
ui.notifications.message("Library update command sent to KODI host(s): " + host)
else:
ui.notifications.error("Unable to contact one or more XBMC host(s): " + host)
ui.notifications.error("Unable to contact one or more KODI host(s): " + host)
redirect('/home/')