mirror of
https://github.com/Radarr/Radarr.git
synced 2026-03-30 18:25:57 -04:00
Compare commits
22 Commits
v0.2.0.226
...
v0.2.0.238
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
487c5e22ce | ||
|
|
6efd63a292 | ||
|
|
5ebd035b1c | ||
|
|
d50514f8bc | ||
|
|
a417ac2716 | ||
|
|
a89e662721 | ||
|
|
4b1e4eecfb | ||
|
|
8e452f8b6d | ||
|
|
7e6db89eff | ||
|
|
16214e666b | ||
|
|
2b25ce237f | ||
|
|
f0a9955447 | ||
|
|
d0439296fe | ||
|
|
bc3fdb0f80 | ||
|
|
186b2ada36 | ||
|
|
577125f345 | ||
|
|
687dd8a05f | ||
|
|
81861c6121 | ||
|
|
302462f48c | ||
|
|
d132f55830 | ||
|
|
6bbd64e59a | ||
|
|
290c4e1f2e |
@@ -5,7 +5,7 @@ namespace NzbDrone.Api.Validation
|
||||
public class RssSyncIntervalValidator : PropertyValidator
|
||||
{
|
||||
public RssSyncIntervalValidator()
|
||||
: base("Must be between 10 and 120 or 0 to disable")
|
||||
: base("Must be between 10 and 720 or 0 to disable")
|
||||
{
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace NzbDrone.Api.Validation
|
||||
return true;
|
||||
}
|
||||
|
||||
if (value >= 10 && value <= 120)
|
||||
if (value >= 10 && value <= 720)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -54,13 +54,19 @@ namespace NzbDrone.Core.Indexers.AwesomeHD
|
||||
|
||||
private IEnumerable<IndexerRequest> GetRequest(string searchParameters)
|
||||
{
|
||||
var onlyInternal = "";
|
||||
if (Settings.Internal)
|
||||
{
|
||||
onlyInternal = "&internal=true";
|
||||
}
|
||||
|
||||
if (searchParameters != null)
|
||||
{
|
||||
yield return new IndexerRequest(string.Format("{0}/searchapi.php?action=imdbsearch&passkey={1}&imdb={2}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.Passkey.Trim(), searchParameters), HttpAccept.Rss);
|
||||
yield return new IndexerRequest($"{Settings.BaseUrl.Trim().TrimEnd('/')}/searchapi.php?action=imdbsearch&passkey={Settings.Passkey.Trim()}&imdb={searchParameters}", HttpAccept.Rss);
|
||||
}
|
||||
else
|
||||
{
|
||||
yield return new IndexerRequest(string.Format("{0}/searchapi.php?action=latestmovies&passkey={1}", Settings.BaseUrl.Trim().TrimEnd('/'), Settings.Passkey.Trim()), HttpAccept.Rss);
|
||||
yield return new IndexerRequest($"{Settings.BaseUrl.Trim().TrimEnd('/')}/searchapi.php?action=latestmovies&passkey={Settings.Passkey.Trim()}{onlyInternal}", HttpAccept.Rss);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ namespace NzbDrone.Core.Indexers.AwesomeHD
|
||||
[FieldDefinition(1, Label = "Passkey")]
|
||||
public string Passkey { get; set; }
|
||||
|
||||
[FieldDefinition(2, Type = FieldType.Checkbox, Label = "Require Internal", HelpText = "Will only include internal releases for RSS Sync.")]
|
||||
public bool Internal { get; set; }
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.Profiles;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Core.MetadataSource
|
||||
@@ -7,6 +8,6 @@ namespace NzbDrone.Core.MetadataSource
|
||||
public interface IProvideMovieInfo
|
||||
{
|
||||
Movie GetMovieInfo(string ImdbId);
|
||||
Movie GetMovieInfo(int TmdbId);
|
||||
Movie GetMovieInfo(int TmdbId, Profile profile);
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,8 @@ using NzbDrone.Core.Tv;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Text;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Profiles;
|
||||
|
||||
namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
{
|
||||
@@ -67,25 +69,39 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
return new Tuple<Series, List<Episode>>(series, episodes.ToList());
|
||||
}
|
||||
|
||||
public Movie GetMovieInfo(int TmdbId)
|
||||
public Movie GetMovieInfo(int TmdbId, Profile profile = null)
|
||||
{
|
||||
var langCode = profile != null ? IsoLanguages.Get(profile.Language).TwoLetterCode : "us";
|
||||
|
||||
var request = _movieBuilder.Create()
|
||||
.SetSegment("route", "movie")
|
||||
.SetSegment("id", TmdbId.ToString())
|
||||
.SetSegment("secondaryRoute", "")
|
||||
.AddQueryParam("append_to_response", "alternative_titles,release_dates,videos")
|
||||
.AddQueryParam("country", "US")
|
||||
.AddQueryParam("language", langCode.ToUpper())
|
||||
// .AddQueryParam("country", "US")
|
||||
.Build();
|
||||
|
||||
request.AllowAutoRedirect = true;
|
||||
request.SuppressHttpError = true;
|
||||
|
||||
var response = _httpClient.Get<MovieResourceRoot>(request);
|
||||
|
||||
var resource = response.Resource;
|
||||
|
||||
var movie = new Movie();
|
||||
|
||||
foreach (var alternativeTitle in resource.alternative_titles.titles)
|
||||
{
|
||||
if (alternativeTitle.iso_3166_1.ToLower() == langCode)
|
||||
{
|
||||
movie.AlternativeTitles.Add(alternativeTitle.title);
|
||||
}
|
||||
else if (alternativeTitle.iso_3166_1.ToLower() == "us")
|
||||
{
|
||||
movie.AlternativeTitles.Add(alternativeTitle.title);
|
||||
}
|
||||
}
|
||||
|
||||
movie.TmdbId = TmdbId;
|
||||
movie.ImdbId = resource.imdb_id;
|
||||
movie.Title = resource.title;
|
||||
@@ -106,10 +122,10 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
movie.Images.Add(_configService.GetCoverForURL(resource.backdrop_path, MediaCoverTypes.Banner));
|
||||
movie.Runtime = resource.runtime;
|
||||
|
||||
foreach(Title title in resource.alternative_titles.titles)
|
||||
{
|
||||
movie.AlternativeTitles.Add(title.title);
|
||||
}
|
||||
//foreach(Title title in resource.alternative_titles.titles)
|
||||
//{
|
||||
// movie.AlternativeTitles.Add(title.title);
|
||||
//}
|
||||
|
||||
foreach(ReleaseDates releaseDates in resource.release_dates.results)
|
||||
{
|
||||
@@ -149,7 +165,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
{
|
||||
movie.Status = MovieStatusType.Announced;
|
||||
}
|
||||
|
||||
|
||||
if (resource.videos != null)
|
||||
{
|
||||
foreach (Video video in resource.videos.results)
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace NzbDrone.Core.Notifications.CustomScript
|
||||
{
|
||||
var movie = message.Movie;
|
||||
var remoteMovie = message.RemoteMovie;
|
||||
var releaseGroup = remoteMovie.ParsedEpisodeInfo.ReleaseGroup;
|
||||
var releaseGroup = remoteMovie.ParsedMovieInfo.ReleaseGroup;
|
||||
var environmentVariables = new StringDictionary();
|
||||
|
||||
environmentVariables.Add("Radarr_EventType", "Grab");
|
||||
@@ -84,16 +84,6 @@ namespace NzbDrone.Core.Notifications.CustomScript
|
||||
|
||||
public override void OnRename(Series series)
|
||||
{
|
||||
var environmentVariables = new StringDictionary();
|
||||
|
||||
environmentVariables.Add("Radarr_EventType", "Rename");
|
||||
environmentVariables.Add("Radarr_Series_Id", series.Id.ToString());
|
||||
environmentVariables.Add("Radarr_Series_Title", series.Title);
|
||||
environmentVariables.Add("Radarr_Series_Path", series.Path);
|
||||
environmentVariables.Add("Radarr_Series_TvdbId", series.TvdbId.ToString());
|
||||
environmentVariables.Add("Radarr_Series_Type", series.SeriesType.ToString());
|
||||
|
||||
ExecuteScript(environmentVariables);
|
||||
}
|
||||
|
||||
public override string Name => "Custom Script";
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace NzbDrone.Core.Notifications.Join
|
||||
request.AddParameter("apikey", settings.ApiKey);
|
||||
request.AddParameter("title", title);
|
||||
request.AddParameter("text", message);
|
||||
request.AddParameter("icon", "https://cdn.rawgit.com/Sonarr/Sonarr/develop/Logo/256.png"); // Use the Sonarr logo.
|
||||
request.AddParameter("icon", "https://cdn.rawgit.com/Radarr/Radarr/develop/Logo/256.png"); // Use the Radarr logo.
|
||||
|
||||
var response = client.ExecuteAndValidate(request);
|
||||
var res = Json.Deserialize<JoinResponseModel>(response.Content);
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace NzbDrone.Core.Notifications
|
||||
qualityString += " Proper";
|
||||
}
|
||||
|
||||
return string.Format("{0}[{1}]",
|
||||
return string.Format("{0} [{1}]",
|
||||
movie.Title,
|
||||
qualityString);
|
||||
}
|
||||
@@ -210,10 +210,12 @@ namespace NzbDrone.Core.Notifications
|
||||
public void Handle(MovieDownloadedEvent message)
|
||||
{
|
||||
var downloadMessage = new DownloadMessage();
|
||||
downloadMessage.Message = GetMessage(message.Movie.Movie, message.Movie.ParsedMovieInfo.Quality);
|
||||
downloadMessage.Message = GetMessage(message.Movie.Movie, message.Movie.Quality);
|
||||
downloadMessage.Series = null;
|
||||
downloadMessage.EpisodeFile = null;
|
||||
downloadMessage.MovieFile = message.MovieFile;
|
||||
downloadMessage.Movie = message.Movie.Movie;
|
||||
downloadMessage.OldFiles = null;
|
||||
downloadMessage.OldMovieFiles = message.OldFiles;
|
||||
downloadMessage.SourcePath = message.Movie.Path;
|
||||
|
||||
|
||||
@@ -22,23 +22,24 @@ namespace NzbDrone.Core.Notifications.Plex
|
||||
|
||||
public override void OnDownload(DownloadMessage message)
|
||||
{
|
||||
UpdateIfEnabled(message.Series);
|
||||
UpdateIfEnabled(message.Movie);
|
||||
}
|
||||
|
||||
public override void OnMovieRename(Movie movie)
|
||||
{
|
||||
UpdateIfEnabled(movie);
|
||||
}
|
||||
|
||||
public override void OnRename(Series series)
|
||||
{
|
||||
UpdateIfEnabled(series);
|
||||
//UpdateIfEnabled(movie);
|
||||
}
|
||||
|
||||
private void UpdateIfEnabled(Series series)
|
||||
private void UpdateIfEnabled(Movie movie)
|
||||
{
|
||||
if (Settings.UpdateLibrary)
|
||||
{
|
||||
_plexServerService.UpdateLibrary(series, Settings);
|
||||
_plexServerService.UpdateMovieSections(movie, Settings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace NzbDrone.Core.Notifications.Plex
|
||||
public interface IPlexServerProxy
|
||||
{
|
||||
List<PlexSection> GetTvSections(PlexServerSettings settings);
|
||||
List<PlexSection> GetMovieSections(PlexServerSettings settings);
|
||||
void Update(int sectionId, PlexServerSettings settings);
|
||||
void UpdateSeries(int metadataId, PlexServerSettings settings);
|
||||
string Version(PlexServerSettings settings);
|
||||
@@ -66,6 +67,37 @@ namespace NzbDrone.Core.Notifications.Plex
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public List<PlexSection> GetMovieSections(PlexServerSettings settings)
|
||||
{
|
||||
var request = GetPlexServerRequest("library/sections", Method.GET, settings);
|
||||
var client = GetPlexServerClient(settings);
|
||||
var response = client.Execute(request);
|
||||
|
||||
_logger.Trace("Sections response: {0}", response.Content);
|
||||
CheckForError(response, settings);
|
||||
|
||||
if (response.Content.Contains("_children"))
|
||||
{
|
||||
return Json.Deserialize<PlexMediaContainerLegacy>(response.Content)
|
||||
.Sections
|
||||
.Where(d => d.Type == "movie")
|
||||
.Select(s => new PlexSection
|
||||
{
|
||||
Id = s.Id,
|
||||
Language = s.Language,
|
||||
Locations = s.Locations,
|
||||
Type = s.Type
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
|
||||
return Json.Deserialize<PlexResponse<PlexSectionsContainer>>(response.Content)
|
||||
.MediaContainer
|
||||
.Sections
|
||||
.Where(d => d.Type == "movie")
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public void Update(int sectionId, PlexServerSettings settings)
|
||||
{
|
||||
var resource = string.Format("library/sections/{0}/refresh", sectionId);
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace NzbDrone.Core.Notifications.Plex
|
||||
public interface IPlexServerService
|
||||
{
|
||||
void UpdateLibrary(Series series, PlexServerSettings settings);
|
||||
void UpdateMovieSections(Movie movie, PlexServerSettings settings);
|
||||
ValidationFailure Test(PlexServerSettings settings);
|
||||
}
|
||||
|
||||
@@ -62,11 +63,43 @@ namespace NzbDrone.Core.Notifications.Plex
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateMovieSections(Movie movie, PlexServerSettings settings)
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.Debug("Sending Update Request to Plex Server");
|
||||
|
||||
var version = _versionCache.Get(settings.Host, () => GetVersion(settings), TimeSpan.FromHours(2));
|
||||
ValidateVersion(version);
|
||||
|
||||
var sections = GetSections(settings);
|
||||
var partialUpdates = _partialUpdateCache.Get(settings.Host, () => PartialUpdatesAllowed(settings, version), TimeSpan.FromHours(2));
|
||||
|
||||
// TODO: Investiate partial updates later, for now just update all movie sections...
|
||||
|
||||
//if (partialUpdates)
|
||||
//{
|
||||
// UpdatePartialSection(series, sections, settings);
|
||||
//}
|
||||
|
||||
//else
|
||||
//{
|
||||
sections.ForEach(s => UpdateSection(s.Id, settings));
|
||||
//}
|
||||
}
|
||||
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Warn(ex, "Failed to Update Plex host: " + settings.Host);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
private List<PlexSection> GetSections(PlexServerSettings settings)
|
||||
{
|
||||
_logger.Debug("Getting sections from Plex host: {0}", settings.Host);
|
||||
|
||||
return _plexServerProxy.GetTvSections(settings).ToList();
|
||||
return _plexServerProxy.GetMovieSections(settings).ToList();
|
||||
}
|
||||
|
||||
private bool PartialUpdatesAllowed(PlexServerSettings settings, Version version)
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace NzbDrone.Core.Notifications.Slack
|
||||
new Attachment
|
||||
{
|
||||
Fallback = message.Message,
|
||||
Title = message.Series.Title,
|
||||
Title = message.Movie.Title,
|
||||
Text = message.Message,
|
||||
Color = "warning"
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace NzbDrone.Core.Notifications.Slack
|
||||
new Attachment
|
||||
{
|
||||
Fallback = message.Message,
|
||||
Title = message.Series.Title,
|
||||
Title = message.Movie.Title,
|
||||
Text = message.Message,
|
||||
Color = "good"
|
||||
}
|
||||
@@ -71,8 +71,23 @@ namespace NzbDrone.Core.Notifications.Slack
|
||||
|
||||
public override void OnMovieRename(Movie movie)
|
||||
{
|
||||
}
|
||||
|
||||
var payload = new SlackPayload
|
||||
{
|
||||
IconEmoji = Settings.Icon,
|
||||
Username = Settings.Username,
|
||||
Text = "Renamed",
|
||||
Attachments = new List<Attachment>
|
||||
{
|
||||
new Attachment
|
||||
{
|
||||
Title = movie.Title,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
NotifySlack(payload);
|
||||
}
|
||||
|
||||
public override void OnRename(Series series)
|
||||
{
|
||||
var payload = new SlackPayload
|
||||
|
||||
@@ -12,5 +12,6 @@
|
||||
ThreeLetterCode = threeLetterCode;
|
||||
Language = language;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace NzbDrone.Core.Tv
|
||||
|
||||
try
|
||||
{
|
||||
movieInfo = _movieInfo.GetMovieInfo(movie.TmdbId);
|
||||
movieInfo = _movieInfo.GetMovieInfo(movie.TmdbId, movie.Profile);
|
||||
}
|
||||
catch (MovieNotFoundException)
|
||||
{
|
||||
|
||||
@@ -328,7 +328,7 @@
|
||||
</div>
|
||||
|
||||
{{#if_mono}}
|
||||
<div class="alert alert-warning">Please see: <a href="https://github.com/NzbDrone/NzbDrone/wiki/Updating">the wiki</a> for more information</div>
|
||||
<div class="alert alert-warning">Please see: <a href="https://github.com/Radarr/Radarr/wiki">the wiki</a> for more information</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Automatic</label>
|
||||
|
||||
Reference in New Issue
Block a user