1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-03-30 18:25:57 -04:00

Compare commits

...

22 Commits

Author SHA1 Message Date
vertigo235
487c5e22ce Moviefile, what movie file? (#466)
Send the moviefile object.
2017-01-26 21:46:55 +01:00
vertigo235
6efd63a292 Remove mofilefile id for now (#464) 2017-01-26 21:13:27 +01:00
Devin Buhl
5ebd035b1c Merge pull request #460 from vertigo235/notifications
Download Movie Quality & Formatting
2017-01-25 21:36:25 -05:00
vertigo235
d50514f8bc Download Movie Quality & Formatting
Fix downloaded movie quality and add space between movie name and quality.
2017-01-25 21:19:59 -05:00
Devin Buhl
a417ac2716 Merge pull request #459 from jrdnlc/develop
Update GeneralViewTemplate.hbs
2017-01-25 19:59:50 -05:00
Jordan
a89e662721 Update GeneralViewTemplate.hbs
Updated Wiki link to Radarr
2017-01-25 16:34:35 -08:00
Devin Buhl
4b1e4eecfb Merge pull request #456 from Radarr/patch/lang
Change lang in UI to what profile / lang they choose when they add a …
2017-01-25 18:07:26 -05:00
Devin Buhl
8e452f8b6d Change lang in UI to what profile / lang they choose when they add a movie 2017-01-25 18:00:46 -05:00
Devin Buhl
7e6db89eff Merge pull request #454 from vertigo235/notifications
Custom Script Fix: Parse movie not episode
2017-01-25 17:02:33 -05:00
vertigo235
16214e666b Custom Script Fix: Parse movie not episode 2017-01-25 16:55:36 -05:00
Devin Buhl
2b25ce237f Merge pull request #448 from hotio/patch-1
Fixes issue #447 (Notification Icon for Join)
2017-01-25 11:55:31 -05:00
Devin Buhl
f0a9955447 Merge pull request #450 from Radarr/patch/ahd
only use internal for RSS Sync
2017-01-25 11:55:19 -05:00
Devin Buhl
d0439296fe only use internal for RSS Sync 2017-01-25 11:40:04 -05:00
Devin Buhl
bc3fdb0f80 Merge pull request #449 from Radarr/patch/ahd
include only internal for AHD
2017-01-25 11:31:04 -05:00
Devin Buhl
186b2ada36 include only internal for AHD 2017-01-25 11:24:20 -05:00
Devin Buhl
577125f345 Merge pull request #435 from vertigo235/notifications
Notification Fixes/Updates
2017-01-25 10:56:11 -05:00
hotio
687dd8a05f Update JoinProxy.cs 2017-01-25 16:54:57 +01:00
hotio
81861c6121 Fixes issue #447 (Notification Icon for Join) 2017-01-25 16:50:38 +01:00
Devin Buhl
302462f48c Merge pull request #441 from schumi2004/rss-sync
fix new rss-sync threshold
2017-01-25 06:22:48 -05:00
schumi2004
d132f55830 fix new rss-sync threshold 2017-01-25 10:52:29 +01:00
vertigo235
6bbd64e59a Update Plex Movie Sections 2017-01-24 21:32:20 -05:00
vertigo235
290c4e1f2e Update slack for movies. 2017-01-24 17:56:10 -05:00
15 changed files with 138 additions and 38 deletions

View File

@@ -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;
}

View File

@@ -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);
}
}

View File

@@ -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));

View File

@@ -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);
}
}

View File

@@ -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)

View File

@@ -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";

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);
}
}

View File

@@ -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);

View File

@@ -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)

View File

@@ -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

View File

@@ -12,5 +12,6 @@
ThreeLetterCode = threeLetterCode;
Language = language;
}
}
}

View File

@@ -51,7 +51,7 @@ namespace NzbDrone.Core.Tv
try
{
movieInfo = _movieInfo.GetMovieInfo(movie.TmdbId);
movieInfo = _movieInfo.GetMovieInfo(movie.TmdbId, movie.Profile);
}
catch (MovieNotFoundException)
{

View File

@@ -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>