1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-24 17:01:38 +00:00

Added hidden option to allow updating of XBMC even if video is playing.

This commit is contained in:
Mark McDowall 2012-01-04 11:48:48 -08:00
parent e4985cbd66
commit b8559ccec3
2 changed files with 29 additions and 14 deletions

View file

@ -230,6 +230,13 @@ public virtual Boolean XbmcCleanLibrary
set { SetValue("XbmcCleanLibrary", value); } set { SetValue("XbmcCleanLibrary", value); }
} }
public virtual Boolean XbmcUpdateWhenPlaying
{
get { return GetValueBoolean("XbmcUpdateWhenPlaying"); }
set { SetValue("XbmcUpdateWhenPlaying", value); }
}
public virtual string XbmcHosts public virtual string XbmcHosts
{ {
get { return GetValue("XbmcHosts", "localhost:8080"); } get { return GetValue("XbmcHosts", "localhost:8080"); }

View file

@ -61,14 +61,18 @@ public virtual void Update(Series series)
//If Dharma //If Dharma
if (version == 2) if (version == 2)
{ {
Logger.Trace("Determining if there are any active players on XBMC host: {0}", host); //Check for active player only when we should skip updates when playing
var activePlayers = GetActivePlayersDharma(host, username, password); if (!_configProvider.XbmcUpdateWhenPlaying)
//If video is currently playing, then skip update
if (activePlayers["video"])
{ {
Logger.Debug("Video is currently playing, skipping library update"); Logger.Trace("Determining if there are any active players on XBMC host: {0}", host);
continue; var activePlayers = GetActivePlayersDharma(host, username, password);
//If video is currently playing, then skip update
if(activePlayers["video"])
{
Logger.Debug("Video is currently playing, skipping library update");
continue;
}
} }
UpdateWithHttp(series, host, username, password); UpdateWithHttp(series, host, username, password);
@ -77,14 +81,18 @@ public virtual void Update(Series series)
//If Eden or newer (attempting to make it future compatible) //If Eden or newer (attempting to make it future compatible)
else if (version >= 3) else if (version >= 3)
{ {
Logger.Trace("Determining if there are any active players on XBMC host: {0}", host); //Check for active player only when we should skip updates when playing
var activePlayers = GetActivePlayersEden(host, username, password); if (!_configProvider.XbmcUpdateWhenPlaying)
//If video is currently playing, then skip update
if (activePlayers.Any(a => a.Type.Equals("video")))
{ {
Logger.Debug("Video is currently playing, skipping library update"); Logger.Trace("Determining if there are any active players on XBMC host: {0}", host);
continue; var activePlayers = GetActivePlayersEden(host, username, password);
//If video is currently playing, then skip update
if(activePlayers.Any(a => a.Type.Equals("video")))
{
Logger.Debug("Video is currently playing, skipping library update");
continue;
}
} }
UpdateWithJson(series, password, host, username); UpdateWithJson(series, password, host, username);