mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
parent
19299ad47f
commit
3e96fe4a72
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user