1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed: Emby library update (#3318)

Fixes: #3158
This commit is contained in:
hatharry 2019-02-18 23:12:34 +13:00 committed by Leonardo Galli
parent 19299ad47f
commit 3e96fe4a72
3 changed files with 20 additions and 8 deletions

View File

@ -37,7 +37,7 @@ public override void OnDownload(DownloadMessage message)
if (Settings.UpdateLibrary)
{
_mediaBrowserService.UpdateMovies(Settings, message.Movie);
_mediaBrowserService.UpdateMovies(Settings, message.Movie, "Created");
}
}
@ -45,7 +45,7 @@ public override void OnMovieRename(Movie movie)
{
if (Settings.UpdateLibrary)
{
_mediaBrowserService.UpdateMovies(Settings, movie);
_mediaBrowserService.UpdateMovies(Settings, movie, "Modified");
}
}

View File

@ -31,11 +31,23 @@ public void Notify(MediaBrowserSettings settings, string title, string message)
ProcessRequest(request, settings);
}
public void UpdateMovies(MediaBrowserSettings settings, string imdbid)
public void UpdateMovies(MediaBrowserSettings settings, string moviePath, string updateType)
{
var path = string.Format("/Library/Movies/Updated?ImdbId={0}", imdbid);
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 = moviePath,
UpdateType = updateType
}
}
}.ToJson());
ProcessRequest(request, settings);
}

View File

@ -10,7 +10,7 @@ namespace NzbDrone.Core.Notifications.MediaBrowser
public interface IMediaBrowserService
{
void Notify(MediaBrowserSettings settings, string title, string message);
void UpdateMovies(MediaBrowserSettings settings, Movie movie);
void UpdateMovies(MediaBrowserSettings settings, Movie movie, string updateType);
ValidationFailure Test(MediaBrowserSettings settings);
}
@ -30,9 +30,9 @@ public void Notify(MediaBrowserSettings settings, string title, string message)
_proxy.Notify(settings, title, message);
}
public void UpdateMovies(MediaBrowserSettings settings, Movie movie)
public void UpdateMovies(MediaBrowserSettings settings, Movie movie, string updateType)
{
_proxy.UpdateMovies(settings, movie.ImdbId);
_proxy.UpdateMovies(settings, movie.Path, updateType);
}