Fixed: Emby library update

Fixes #2662
This commit is contained in:
hatharry 2019-03-17 11:56:33 +13:00 committed by Mark McDowall
parent 1b0c6b919f
commit ecebe73c33
3 changed files with 20 additions and 8 deletions

View File

@ -35,7 +35,7 @@ namespace NzbDrone.Core.Notifications.Emby
if (Settings.UpdateLibrary)
{
_mediaBrowserService.Update(Settings, message.Series);
_mediaBrowserService.Update(Settings, message.Series, "Created");
}
}
@ -43,7 +43,7 @@ namespace NzbDrone.Core.Notifications.Emby
{
if (Settings.UpdateLibrary)
{
_mediaBrowserService.Update(Settings, series);
_mediaBrowserService.Update(Settings, series, "Modified");
}
}

View File

@ -31,11 +31,23 @@ namespace NzbDrone.Core.Notifications.Emby
ProcessRequest(request, settings);
}
public void Update(MediaBrowserSettings settings, int tvdbId)
public void Update(MediaBrowserSettings settings, string seriesPath, string updateType)
{
var path = string.Format("/Library/Series/Updated?tvdbid={0}", tvdbId);
var path = "/Library/Media/Updated";
var request = BuildRequest(path, settings);
request.Headers.Add("Content-Length", "0");
request.Headers.ContentType = "application/json";
request.SetContent(new
{
Updates = new[]
{
new
{
Path = seriesPath,
UpdateType = updateType
}
}
}.ToJson());
ProcessRequest(request, settings);
}

View File

@ -10,7 +10,7 @@ namespace NzbDrone.Core.Notifications.Emby
public interface IMediaBrowserService
{
void Notify(MediaBrowserSettings settings, string title, string message);
void Update(MediaBrowserSettings settings, Series series);
void Update(MediaBrowserSettings settings, Series series, string updateType);
ValidationFailure Test(MediaBrowserSettings settings);
}
@ -30,9 +30,9 @@ namespace NzbDrone.Core.Notifications.Emby
_proxy.Notify(settings, title, message);
}
public void Update(MediaBrowserSettings settings, Series series)
public void Update(MediaBrowserSettings settings, Series series, string updateType)
{
_proxy.Update(settings, series.TvdbId);
_proxy.Update(settings, series.Path, updateType);
}
public ValidationFailure Test(MediaBrowserSettings settings)