mirror of https://github.com/Radarr/Radarr
parent
19299ad47f
commit
3e96fe4a72
|
@ -37,7 +37,7 @@ namespace NzbDrone.Core.Notifications.MediaBrowser
|
|||
|
||||
if (Settings.UpdateLibrary)
|
||||
{
|
||||
_mediaBrowserService.UpdateMovies(Settings, message.Movie);
|
||||
_mediaBrowserService.UpdateMovies(Settings, message.Movie, "Created");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace NzbDrone.Core.Notifications.MediaBrowser
|
|||
{
|
||||
if (Settings.UpdateLibrary)
|
||||
{
|
||||
_mediaBrowserService.UpdateMovies(Settings, movie);
|
||||
_mediaBrowserService.UpdateMovies(Settings, movie, "Modified");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,23 @@ namespace NzbDrone.Core.Notifications.MediaBrowser
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -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 @@ namespace NzbDrone.Core.Notifications.MediaBrowser
|
|||
_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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue