1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-18 21:35:51 -04:00

Compare commits

...

44 Commits

Author SHA1 Message Date
Devin Buhl 792679fd81 Merge pull request #118 from lxh87/patch-1
Update SystemLayout.js
2017-01-10 16:50:15 -05:00
lxh87 ecf47d4b17 Update SystemLayout.js
Change restart/shutdown message from"Sonarr" to "Radarr"
2017-01-10 22:42:44 +01:00
Leonardo Galli 3b1d49a78f Update readme.md 2017-01-10 22:30:36 +01:00
Devin Buhl 753f3eb863 Merge pull request #117 from Radarr/wombles-patch
Fix Wombles for movies
2017-01-10 16:29:02 -05:00
Devin Buhl 9fc2d22d19 Fix Wombles for movies 2017-01-10 16:28:16 -05:00
Tim Turner 3cb42f06c2 Clean up Feature Requests 2017-01-10 16:05:56 -05:00
Devin Buhl a6c396a595 Merge pull request #111 from Radarr/addmovie-patch
fix #108 - Links to IMDB not working when searching for movies
2017-01-10 15:45:39 -05:00
Devin Buhl bac9076b1e fix #108 - Links to IMDB not working when searching for movies 2017-01-10 15:39:25 -05:00
Tim Turner b228273be0 Update Info page.
Updates #73
2017-01-10 15:34:43 -05:00
Leonardo Galli e7fa4cba19 Fix download rejections being ignored. 2017-01-10 21:25:36 +01:00
Leonardo Galli 0506cc4185 Merge branch 'develop' of https://github.com/galli-leo/Radarr into develop 2017-01-10 20:07:01 +01:00
Leonardo Galli cde8b4dd97 Added MovieFileResource. This allows the UI to interact with movie files better. Downloaded Quality is now shown in the table. 2017-01-10 20:06:53 +01:00
Leonardo Galli 0a0a44162c Merge pull request #105 from galli-leo/linux-tmp-path-patch
Fixes #104 - Backup/update fail Access to the path "/tmp/nzbdrone_backup/config.xml" is denied
2017-01-10 19:31:12 +01:00
Devin Buhl 125f46fbec Fixes #104 - Backup/update fail Access to the path "/tmp/nzbdrone_backup/config.xml" is denied 2017-01-10 13:21:54 -05:00
Leonardo Galli f3222ca7c7 Merge pull request #102 from galli-leo/addmovies-patch
When adding a movie, monitored toggle doesn't apply and always defaults to being monitored
2017-01-10 19:21:24 +01:00
Devin Buhl d252a8b232 Fixes #100 - When adding a movie, monitored toggle doesn't apply and always defaults to being monitored 2017-01-10 12:39:28 -05:00
Leonardo Galli 48559cf964 Updated legend with number of movies 2017-01-10 17:36:04 +01:00
Leonardo Galli c734e8bc7e Update legend for missing status colors. 2017-01-10 17:07:32 +01:00
Leonardo Galli 3c7d7756e6 Fix issues with media managment config not getting saved. 2017-01-10 17:05:37 +01:00
Leonardo Galli 683bda49d8 Movie Editor works now. Fixes #99. 2017-01-10 16:51:56 +01:00
Leonardo Galli 52fb29ee18 Fixes a few things with importing: Sample check is done even when file is already in movie folder. Fixed importing of movies with "DC". 2017-01-10 16:23:07 +01:00
Leonardo Galli 236e16c9a5 Update sample detection runtime minutes. Some trailers can be long. 2017-01-10 15:43:35 +01:00
Leonardo Galli 0584038273 Fix queue specification. 2017-01-10 15:33:39 +01:00
Leonardo Galli 6685aea144 Movie search should now work, even when titles returned from the TMDB do not have a release date set. Fixes #27. 2017-01-10 15:29:20 +01:00
Leonardo Galli e4f7aa52df History now correctly shows movie title. Fixes #92 2017-01-10 15:15:15 +01:00
Leonardo Galli f61c4feb00 Redownloading failed downloads works again. Fixes #89. 2017-01-10 14:15:27 +01:00
Leonardo Galli 04e8c635e0 Use correct Modal for editing movies in table view. Fixes #90 2017-01-10 14:05:01 +01:00
Leonardo Galli 93ea5cfdee Merge pull request #88 from schumi2004/develop
Replace Sonarr with Radarr in Test notification messages
2017-01-10 11:31:39 +01:00
schumi2004 1b7288e7cb Replace Sonarr with Radarr in Test notification messages 2017-01-10 11:21:09 +01:00
Tim Turner f1914082b8 Merge pull request #74 from fedoranimus/develop
Taking a pass at Library import and rename/organize
2017-01-09 17:31:25 -05:00
Tim Turner 6016948329 Merge remote-tracking branch 'refs/remotes/galli-leo/develop' into develop 2017-01-09 17:26:25 -05:00
Tim Turner 708db1a75c Organize & Rename work 2017-01-09 17:26:13 -05:00
Leonardo Galli 994e881ba6 Fixes an issue with movies not being added with same title slug as existing movies. 2017-01-09 23:16:54 +01:00
Leonardo Galli 893e20c27b Fix some links under status. Needs further changing further down the line. 2017-01-09 22:17:17 +01:00
Tim Turner 23aace6149 Merge remote-tracking branch 'refs/remotes/galli-leo/develop' into develop
# Conflicts:
#	src/NzbDrone.Api/Series/MovieResource.cs
2017-01-09 15:59:25 -05:00
Leonardo Galli e774e6a038 Fix for importing movie folders with the at the end. 2017-01-09 21:37:37 +01:00
Tim Turner 74c5664a7f Taking another pass at organization/renaming
Works once in a while
2017-01-08 22:16:14 -05:00
Tim Turner 4c9abe3d84 Merge remote-tracking branch 'refs/remotes/galli-leo/develop' into develop 2017-01-08 19:48:14 -05:00
Tim Turner 7a45394820 Unable to properly parse many movie titles 2017-01-08 19:48:04 -05:00
Tim Turner 14bf63e21d Merge remote-tracking branch 'refs/remotes/galli-leo/develop' into develop 2017-01-08 17:01:47 -05:00
Tim Turner b5d932866a Second Pass at rename/organize 2017-01-08 17:01:37 -05:00
Tim Turner cd4863b974 Display UI for MovieEditor, remove reference to SeasonPass 2017-01-08 09:16:24 -05:00
Tim Turner d006df8d7c Merge remote-tracking branch 'refs/remotes/galli-leo/develop' into develop 2017-01-08 06:51:47 -05:00
Tim Turner 1ebd639e36 Merge remote-tracking branch 'refs/remotes/galli-leo/develop' into develop 2017-01-07 21:05:30 -05:00
81 changed files with 1153 additions and 221 deletions
+1
View File
@@ -25,6 +25,7 @@ This fork of Sonarr aims to turn it into something like Couchpotato.
## Download ## Download
The latest precompiled binary versions can be found here: https://github.com/galli-leo/Radarr/releases. The latest precompiled binary versions can be found here: https://github.com/galli-leo/Radarr/releases.
A docker container can be found here: https://hub.docker.com/r/lsiodev/radarr/.
For more up to date versions (but also sometimes broken), daily builds can be found here: For more up to date versions (but also sometimes broken), daily builds can be found here:
* [OSX](https://leonardogalli.ch/radarr/builds/latest.php?os=osx) * [OSX](https://leonardogalli.ch/radarr/builds/latest.php?os=osx)
@@ -34,11 +34,11 @@ namespace NzbDrone.Api.Config
Get["/samples"] = x => GetExamples(this.Bind<NamingConfigResource>()); Get["/samples"] = x => GetExamples(this.Bind<NamingConfigResource>());
SharedValidator.RuleFor(c => c.MultiEpisodeStyle).InclusiveBetween(0, 5); SharedValidator.RuleFor(c => c.MultiEpisodeStyle).InclusiveBetween(0, 5);
SharedValidator.RuleFor(c => c.StandardEpisodeFormat).ValidEpisodeFormat(); /*SharedValidator.RuleFor(c => c.StandardEpisodeFormat).ValidEpisodeFormat();
SharedValidator.RuleFor(c => c.DailyEpisodeFormat).ValidDailyEpisodeFormat(); SharedValidator.RuleFor(c => c.DailyEpisodeFormat).ValidDailyEpisodeFormat();
SharedValidator.RuleFor(c => c.AnimeEpisodeFormat).ValidAnimeEpisodeFormat(); SharedValidator.RuleFor(c => c.AnimeEpisodeFormat).ValidAnimeEpisodeFormat();
SharedValidator.RuleFor(c => c.SeriesFolderFormat).ValidSeriesFolderFormat(); SharedValidator.RuleFor(c => c.SeriesFolderFormat).ValidSeriesFolderFormat();
SharedValidator.RuleFor(c => c.SeasonFolderFormat).ValidSeasonFolderFormat(); SharedValidator.RuleFor(c => c.SeasonFolderFormat).ValidSeasonFolderFormat();*/
SharedValidator.RuleFor(c => c.StandardMovieFormat).ValidMovieFormat(); SharedValidator.RuleFor(c => c.StandardMovieFormat).ValidMovieFormat();
SharedValidator.RuleFor(c => c.MovieFolderFormat).ValidMovieFolderFormat(); SharedValidator.RuleFor(c => c.MovieFolderFormat).ValidMovieFolderFormat();
} }
@@ -25,7 +25,7 @@ namespace NzbDrone.Api.Frontend.Mappers
public override bool CanHandle(string resourceUrl) public override bool CanHandle(string resourceUrl)
{ {
return resourceUrl.StartsWith("/backup/") && resourceUrl.ContainsIgnoreCase("nzbdrone_backup_") && resourceUrl.EndsWith(".zip"); return resourceUrl.StartsWith("/backup/") && resourceUrl.ContainsIgnoreCase("radarr_backup_") && resourceUrl.EndsWith(".zip");
} }
} }
} }
+3 -3
View File
@@ -107,8 +107,8 @@ namespace NzbDrone.Api.Indexers
ReleaseGroup = parsedMovieInfo.ReleaseGroup, ReleaseGroup = parsedMovieInfo.ReleaseGroup,
ReleaseHash = parsedMovieInfo.ReleaseHash, ReleaseHash = parsedMovieInfo.ReleaseHash,
Title = releaseInfo.Title, Title = releaseInfo.Title,
FullSeason = parsedMovieInfo.FullSeason, //FullSeason = parsedMovieInfo.FullSeason,
SeasonNumber = parsedMovieInfo.SeasonNumber, //SeasonNumber = parsedMovieInfo.SeasonNumber,
Language = parsedMovieInfo.Language, Language = parsedMovieInfo.Language,
AirDate = "", AirDate = "",
SeriesTitle = parsedMovieInfo.MovieTitle, SeriesTitle = parsedMovieInfo.MovieTitle,
@@ -138,7 +138,7 @@ namespace NzbDrone.Api.Indexers
IsDaily = false, IsDaily = false,
IsAbsoluteNumbering = false, IsAbsoluteNumbering = false,
IsPossibleSpecialEpisode = false, IsPossibleSpecialEpisode = false,
Special = parsedMovieInfo.Special, //Special = parsedMovieInfo.Special,
}; };
} }
@@ -0,0 +1,31 @@
using System.Collections.Generic;
using System.Linq;
using Nancy;
using NzbDrone.Api.Extensions;
using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Movie
{
public class MovieEditorModule : NzbDroneApiModule
{
private readonly IMovieService _movieService;
public MovieEditorModule(IMovieService movieService)
: base("/movie/editor")
{
_movieService = movieService;
Put["/"] = Movie => SaveAll();
}
private Response SaveAll()
{
var resources = Request.Body.FromJson<List<MovieResource>>();
var Movie = resources.Select(MovieResource => MovieResource.ToModel(_movieService.GetMovie(MovieResource.Id))).ToList();
return _movieService.UpdateMovie(Movie)
.ToResource()
.AsResponse(HttpStatusCode.Accepted);
}
}
}
+11
View File
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Api.Movies
{
class MovieModule
{
}
}
@@ -0,0 +1,35 @@
using NzbDrone.Api.REST;
using NzbDrone.Core.MediaFiles;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Api.Movies
{
public class RenameMovieModule : NzbDroneRestModule<RenameMovieResource>
{
private readonly IRenameMovieFileService _renameMovieFileService;
public RenameMovieModule(IRenameMovieFileService renameMovieFileService)
: base("rename")
{
_renameMovieFileService = renameMovieFileService;
GetResourceAll = GetMovies; //TODO: GetResourceSingle?
}
private List<RenameMovieResource> GetMovies()
{
if(!Request.Query.MovieId.HasValue)
{
throw new BadRequestException("movieId is missing");
}
var movieId = (int)Request.Query.MovieId;
return _renameMovieFileService.GetRenamePreviews(movieId).ToResource();
}
}
}
@@ -0,0 +1,35 @@
using NzbDrone.Api.REST;
using System.Collections.Generic;
using System.Linq;
namespace NzbDrone.Api.Movies
{
public class RenameMovieResource : RestResource
{
public int MovieId { get; set; }
public int MovieFileId { get; set; }
public string ExistingPath { get; set; }
public string NewPath { get; set; }
}
public static class RenameMovieResourceMapper
{
public static RenameMovieResource ToResource(this Core.MediaFiles.RenameMovieFilePreview model)
{
if (model == null) return null;
return new RenameMovieResource
{
MovieId = model.MovieId,
MovieFileId = model.MovieFileId,
ExistingPath = model.ExistingPath,
NewPath = model.NewPath
};
}
public static List<RenameMovieResource> ToResource(this IEnumerable<Core.MediaFiles.RenameMovieFilePreview> models)
{
return models.Select(ToResource).ToList();
}
}
}
+5
View File
@@ -116,6 +116,10 @@
<Compile Include="Frontend\Mappers\RobotsTxtMapper.cs" /> <Compile Include="Frontend\Mappers\RobotsTxtMapper.cs" />
<Compile Include="Indexers\ReleaseModuleBase.cs" /> <Compile Include="Indexers\ReleaseModuleBase.cs" />
<Compile Include="Indexers\ReleasePushModule.cs" /> <Compile Include="Indexers\ReleasePushModule.cs" />
<Compile Include="Movies\MovieModule.cs" />
<Compile Include="Movies\RenameMovieModule.cs" />
<Compile Include="Movies\RenameMovieResource.cs" />
<Compile Include="Movies\MovieEditorModule.cs" />
<Compile Include="Parse\ParseModule.cs" /> <Compile Include="Parse\ParseModule.cs" />
<Compile Include="Parse\ParseResource.cs" /> <Compile Include="Parse\ParseResource.cs" />
<Compile Include="ManualImport\ManualImportModule.cs" /> <Compile Include="ManualImport\ManualImportModule.cs" />
@@ -228,6 +232,7 @@
<Compile Include="RootFolders\RootFolderResource.cs" /> <Compile Include="RootFolders\RootFolderResource.cs" />
<Compile Include="SeasonPass\SeasonPassResource.cs" /> <Compile Include="SeasonPass\SeasonPassResource.cs" />
<Compile Include="Series\AlternateTitleResource.cs" /> <Compile Include="Series\AlternateTitleResource.cs" />
<Compile Include="Series\MovieFileResource.cs" />
<Compile Include="Series\SeasonResource.cs" /> <Compile Include="Series\SeasonResource.cs" />
<Compile Include="SeasonPass\SeasonPassModule.cs" /> <Compile Include="SeasonPass\SeasonPassModule.cs" />
<Compile Include="Series\SeriesEditorModule.cs" /> <Compile Include="Series\SeriesEditorModule.cs" />
@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Qualities;
using NzbDrone.Api.Series;
using NzbDrone.Core.MediaFiles;
namespace NzbDrone.Api.Movie
{
public class MovieFileResource : RestResource
{
public MovieFileResource()
{
}
//Todo: Sorters should be done completely on the client
//Todo: Is there an easy way to keep IgnoreArticlesWhenSorting in sync between, Series, History, Missing?
//Todo: We should get the entire Profile instead of ID and Name separately
public int MovieId { get; set; }
public string RelativePath { get; set; }
public string Path { get; set; }
public long Size { get; set; }
public DateTime DateAdded { get; set; }
public string SceneName { get; set; }
public string ReleaseGroup { get; set; }
public QualityModel Quality { get; set; }
public MovieResource Movie { get; set; }
//TODO: Add series statistics as a property of the series (instead of individual properties)
}
public static class MovieFileResourceMapper
{
public static MovieFileResource ToResource(this MovieFile model)
{
if (model == null) return null;
MovieResource movie = null;
if (model.Movie != null)
{
model.Movie.LazyLoad();
if (model.Movie.Value != null)
{
//movie = model.Movie.Value.ToResource();
}
}
return new MovieFileResource
{
Id = model.Id,
RelativePath = model.RelativePath,
Path = model.Path,
Size = model.Size,
DateAdded = model.DateAdded,
ReleaseGroup = model.ReleaseGroup,
Quality = model.Quality,
Movie = movie,
};
}
public static MovieFile ToModel(this MovieFileResource resource)
{
if (resource == null) return null;
return new MovieFile
{
};
}
public static List<MovieFileResource> ToResource(this IEnumerable<MovieFile> movies)
{
return movies.Select(ToResource).ToList();
}
}
}
+14 -4
View File
@@ -18,7 +18,7 @@ namespace NzbDrone.Api.Movie
//Todo: Sorters should be done completely on the client //Todo: Sorters should be done completely on the client
//Todo: Is there an easy way to keep IgnoreArticlesWhenSorting in sync between, Series, History, Missing? //Todo: Is there an easy way to keep IgnoreArticlesWhenSorting in sync between, Series, History, Missing?
//Todo: We should get the entire Profile instead of ID and Name separately //Todo: We should get the entire Profile instead of ID and Name separately
//View Only //View Only
public string Title { get; set; } public string Title { get; set; }
public List<AlternateTitleResource> AlternateTitles { get; set; } public List<AlternateTitleResource> AlternateTitles { get; set; }
@@ -33,6 +33,7 @@ namespace NzbDrone.Api.Movie
public bool Downloaded { get; set; } public bool Downloaded { get; set; }
public string RemotePoster { get; set; } public string RemotePoster { get; set; }
public int Year { get; set; } public int Year { get; set; }
public bool HasFile { get; set; }
//View & Edit //View & Edit
public string Path { get; set; } public string Path { get; set; }
@@ -54,6 +55,7 @@ namespace NzbDrone.Api.Movie
public AddMovieOptions AddOptions { get; set; } public AddMovieOptions AddOptions { get; set; }
public Ratings Ratings { get; set; } public Ratings Ratings { get; set; }
public List<string> AlternativeTitles { get; set; } public List<string> AlternativeTitles { get; set; }
public MovieFileResource MovieFile { get; set; }
//TODO: Add series statistics as a property of the series (instead of individual properties) //TODO: Add series statistics as a property of the series (instead of individual properties)
@@ -83,13 +85,20 @@ namespace NzbDrone.Api.Movie
long size = 0; long size = 0;
bool downloaded = false; bool downloaded = false;
MovieFileResource movieFile = null;
if(model.MovieFile != null)
{
model.MovieFile.LazyLoad();
}
if (model.MovieFile != null && model.MovieFile.IsLoaded && model.MovieFile.Value != null) if (model.MovieFile != null && model.MovieFile.IsLoaded && model.MovieFile.Value != null)
{ {
size = model.MovieFile.Value.Size; size = model.MovieFile.Value.Size;
downloaded = true; downloaded = true;
movieFile = model.MovieFile.Value.ToResource();
} }
//long Size = model.MovieFile != null ? model.MovieFile.Value.Size : 0;
return new MovieResource return new MovieResource
{ {
@@ -100,7 +109,7 @@ namespace NzbDrone.Api.Movie
SortTitle = model.SortTitle, SortTitle = model.SortTitle,
InCinemas = model.InCinemas, InCinemas = model.InCinemas,
PhysicalRelease = model.PhysicalRelease, PhysicalRelease = model.PhysicalRelease,
HasFile = model.HasFile,
Downloaded = downloaded, Downloaded = downloaded,
//TotalEpisodeCount //TotalEpisodeCount
//EpisodeCount //EpisodeCount
@@ -134,7 +143,8 @@ namespace NzbDrone.Api.Movie
Added = model.Added, Added = model.Added,
AddOptions = model.AddOptions, AddOptions = model.AddOptions,
AlternativeTitles = model.AlternativeTitles, AlternativeTitles = model.AlternativeTitles,
Ratings = model.Ratings Ratings = model.Ratings,
MovieFile = movieFile
}; };
} }
+3 -3
View File
@@ -33,7 +33,7 @@ namespace NzbDrone.Core.Backup
private string _backupTempFolder; private string _backupTempFolder;
private static readonly Regex BackupFileRegex = new Regex(@"nzbdrone_backup_[._0-9]+\.zip", RegexOptions.Compiled | RegexOptions.IgnoreCase); private static readonly Regex BackupFileRegex = new Regex(@"radarr_backup_[._0-9]+\.zip", RegexOptions.Compiled | RegexOptions.IgnoreCase);
public BackupService(IMainDatabase maindDb, public BackupService(IMainDatabase maindDb,
IDiskTransferService diskTransferService, IDiskTransferService diskTransferService,
@@ -49,7 +49,7 @@ namespace NzbDrone.Core.Backup
_archiveService = archiveService; _archiveService = archiveService;
_logger = logger; _logger = logger;
_backupTempFolder = Path.Combine(_appFolderInfo.TempFolder, "nzbdrone_backup"); _backupTempFolder = Path.Combine(_appFolderInfo.TempFolder, "radarr_backup");
} }
public void Backup(BackupType backupType) public void Backup(BackupType backupType)
@@ -59,7 +59,7 @@ namespace NzbDrone.Core.Backup
_diskProvider.EnsureFolder(_backupTempFolder); _diskProvider.EnsureFolder(_backupTempFolder);
_diskProvider.EnsureFolder(GetBackupFolder(backupType)); _diskProvider.EnsureFolder(GetBackupFolder(backupType));
var backupFilename = string.Format("nzbdrone_backup_{0:yyyy.MM.dd_HH.mm.ss}.zip", DateTime.Now); var backupFilename = string.Format("radarr_backup_{0:yyyy.MM.dd_HH.mm.ss}.zip", DateTime.Now);
var backupPath = Path.Combine(GetBackupFolder(backupType), backupFilename); var backupPath = Path.Combine(GetBackupFolder(backupType), backupFilename);
Cleanup(); Cleanup();
@@ -83,7 +83,7 @@ namespace NzbDrone.Core.DecisionEngine
{ {
if (parsedEpisodeInfo.Quality.HardcodedSubs.IsNotNullOrWhiteSpace()) if (parsedEpisodeInfo.Quality.HardcodedSubs.IsNotNullOrWhiteSpace())
{ {
remoteEpisode.DownloadAllowed = true; remoteEpisode.DownloadAllowed = false;
decision = new DownloadDecision(remoteEpisode, new Rejection("Hardcoded subs found: " + parsedEpisodeInfo.Quality.HardcodedSubs)); decision = new DownloadDecision(remoteEpisode, new Rejection("Hardcoded subs found: " + parsedEpisodeInfo.Quality.HardcodedSubs));
} }
else else
@@ -257,7 +257,7 @@ namespace NzbDrone.Core.DecisionEngine
} }
catch (NotImplementedException e) catch (NotImplementedException e)
{ {
_logger.Info("Spec " + spec.GetType().Name + " does not care about movies."); _logger.Trace("Spec " + spec.GetType().Name + " does not care about movies.");
} }
catch (Exception e) catch (Exception e)
{ {
@@ -60,7 +60,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
foreach (var remoteEpisode in matchingSeries) foreach (var remoteEpisode in matchingSeries)
{ {
_logger.Debug("Checking if existing release in queue meets cutoff. Queued quality is: {0}", remoteEpisode.ParsedEpisodeInfo.Quality); _logger.Debug("Checking if existing release in queue meets cutoff. Queued quality is: {0}", remoteEpisode.ParsedMovieInfo.Quality);
if (!_qualityUpgradableSpecification.CutoffNotMet(subject.Movie.Profile, remoteEpisode.ParsedMovieInfo.Quality, subject.ParsedMovieInfo.Quality)) if (!_qualityUpgradableSpecification.CutoffNotMet(subject.Movie.Profile, remoteEpisode.ParsedMovieInfo.Quality, subject.ParsedMovieInfo.Quality))
{ {
@@ -94,7 +94,6 @@ namespace NzbDrone.Core.Download
return; return;
} }
var series = _parsingService.GetSeries(trackedDownload.DownloadItem.Title); var series = _parsingService.GetSeries(trackedDownload.DownloadItem.Title);
if (series == null) if (series == null)
@@ -156,7 +155,7 @@ namespace NzbDrone.Core.Download
trackedDownload.Warn(statusMessages); trackedDownload.Warn(statusMessages);
} }
} }
else else if (trackedDownload.RemoteEpisode.Series != null)
{ {
var importResults = _downloadedEpisodesImportService.ProcessPath(outputPath, ImportMode.Auto, trackedDownload.RemoteEpisode.Series, trackedDownload.DownloadItem); var importResults = _downloadedEpisodesImportService.ProcessPath(outputPath, ImportMode.Auto, trackedDownload.RemoteEpisode.Series, trackedDownload.DownloadItem);
@@ -13,6 +13,7 @@ namespace NzbDrone.Core.Download
} }
public int SeriesId { get; set; } public int SeriesId { get; set; }
public int MovieId { get; set; }
public List<int> EpisodeIds { get; set; } public List<int> EpisodeIds { get; set; }
public QualityModel Quality { get; set; } public QualityModel Quality { get; set; }
public string SourceTitle { get; set; } public string SourceTitle { get; set; }
@@ -88,6 +88,7 @@ namespace NzbDrone.Core.Download
var downloadFailedEvent = new DownloadFailedEvent var downloadFailedEvent = new DownloadFailedEvent
{ {
SeriesId = historyItem.SeriesId, SeriesId = historyItem.SeriesId,
MovieId = historyItem.MovieId,
EpisodeIds = historyItems.Select(h => h.EpisodeId).ToList(), EpisodeIds = historyItems.Select(h => h.EpisodeId).ToList(),
Quality = historyItem.Quality, Quality = historyItem.Quality,
SourceTitle = historyItem.SourceTitle, SourceTitle = historyItem.SourceTitle,
@@ -51,6 +51,12 @@ namespace NzbDrone.Core.Download
continue; continue;
} }
if (report.Rejections.Any())
{
_logger.Debug("Rejecting release {0} because {1}", report.ToString(), report.Rejections.First().Reason);
continue;
}
if (remoteMovie == null || remoteMovie.Movie == null) if (remoteMovie == null || remoteMovie.Movie == null)
{ {
continue; continue;
@@ -34,6 +34,15 @@ namespace NzbDrone.Core.Download
return; return;
} }
if (message.MovieId != 0)
{
_logger.Debug("Failed download contains a movie, searching again.");
_commandQueueManager.Push(new MoviesSearchCommand { MovieId = message.MovieId });
return;
}
if (message.EpisodeIds.Count == 1) if (message.EpisodeIds.Count == 1)
{ {
_logger.Debug("Failed download only contains one episode, searching again"); _logger.Debug("Failed download only contains one episode, searching again");
+12
View File
@@ -111,6 +111,18 @@ namespace NzbDrone.Core.Extras
} }
} }
//TODO: Implementing this will fix a lot of our warning exceptions
//public void Handle(MediaCoversUpdatedEvent message)
//{
// var movie = message.Movie;
// var movieFiles = GetMovieFiles(movie.Id);
// foreach (var extraFileManager in _extraFileManagers)
// {
// extraFileManager.CreateAfterMovieScan(movie, movieFiles);
// }
//}
public void Handle(EpisodeFolderCreatedEvent message) public void Handle(EpisodeFolderCreatedEvent message)
{ {
var series = message.Series; var series = message.Series;
@@ -24,7 +24,7 @@ namespace NzbDrone.Core.Indexers.Wombles
public override IIndexerRequestGenerator GetRequestGenerator() public override IIndexerRequestGenerator GetRequestGenerator()
{ {
return new RssIndexerRequestGenerator("http://newshost.co.za/rss/?sec=TV&fr=false"); return new RssIndexerRequestGenerator("http://newshost.co.za/rss/?sec=Movies&fr=false");
} }
public Wombles(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger) public Wombles(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
@@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Core.MediaFiles.Commands namespace NzbDrone.Core.MediaFiles.Commands
@@ -0,0 +1,19 @@
using NzbDrone.Core.Messaging.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.MediaFiles.Commands
{
public class RenameMovieCommand : Command
{
public List<int> MovieIds { get; set; }
public override bool SendUpdatesToClient => true;
public RenameMovieCommand()
{
}
}
}
@@ -0,0 +1,26 @@
using NzbDrone.Core.Messaging.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.MediaFiles.Commands
{
public class RenameMovieFilesCommand : Command
{
public int MovieId { get; set; }
public List<int> Files { get; set; }
public override bool SendUpdatesToClient => true;
public RenameMovieFilesCommand()
{
}
public RenameMovieFilesCommand(int movieId, List<int> files)
{
MovieId = movieId;
Files = files;
}
}
}
@@ -38,6 +38,7 @@ namespace NzbDrone.Core.MediaFiles
private readonly IDiskProvider _diskProvider; private readonly IDiskProvider _diskProvider;
private readonly IMakeImportDecision _importDecisionMaker; private readonly IMakeImportDecision _importDecisionMaker;
private readonly IImportApprovedEpisodes _importApprovedEpisodes; private readonly IImportApprovedEpisodes _importApprovedEpisodes;
private readonly IImportApprovedMovie _importApprovedMovies;
private readonly IConfigService _configService; private readonly IConfigService _configService;
private readonly ISeriesService _seriesService; private readonly ISeriesService _seriesService;
private readonly IMediaFileTableCleanupService _mediaFileTableCleanupService; private readonly IMediaFileTableCleanupService _mediaFileTableCleanupService;
@@ -48,6 +49,7 @@ namespace NzbDrone.Core.MediaFiles
public DiskScanService(IDiskProvider diskProvider, public DiskScanService(IDiskProvider diskProvider,
IMakeImportDecision importDecisionMaker, IMakeImportDecision importDecisionMaker,
IImportApprovedEpisodes importApprovedEpisodes, IImportApprovedEpisodes importApprovedEpisodes,
IImportApprovedMovie importApprovedMovies,
IConfigService configService, IConfigService configService,
ISeriesService seriesService, ISeriesService seriesService,
IMediaFileTableCleanupService mediaFileTableCleanupService, IMediaFileTableCleanupService mediaFileTableCleanupService,
@@ -58,6 +60,7 @@ namespace NzbDrone.Core.MediaFiles
_diskProvider = diskProvider; _diskProvider = diskProvider;
_importDecisionMaker = importDecisionMaker; _importDecisionMaker = importDecisionMaker;
_importApprovedEpisodes = importApprovedEpisodes; _importApprovedEpisodes = importApprovedEpisodes;
_importApprovedMovies = importApprovedMovies;
_configService = configService; _configService = configService;
_seriesService = seriesService; _seriesService = seriesService;
_mediaFileTableCleanupService = mediaFileTableCleanupService; _mediaFileTableCleanupService = mediaFileTableCleanupService;
@@ -179,7 +182,8 @@ namespace NzbDrone.Core.MediaFiles
decisionsStopwatch.Stop(); decisionsStopwatch.Stop();
_logger.Trace("Import decisions complete for: {0} [{1}]", movie, decisionsStopwatch.Elapsed); _logger.Trace("Import decisions complete for: {0} [{1}]", movie, decisionsStopwatch.Elapsed);
_importApprovedEpisodes.Import(decisions, false); //_importApprovedEpisodes.Import(decisions, false);
_importApprovedMovies.Import(decisions, false);
_logger.Info("Completed scanning disk for {0}", movie.Title); _logger.Info("Completed scanning disk for {0}", movie.Title);
_eventAggregator.PublishEvent(new MovieScannedEvent(movie)); _eventAggregator.PublishEvent(new MovieScannedEvent(movie));
@@ -159,7 +159,7 @@ namespace NzbDrone.Core.MediaFiles
} }
var cleanedUpName = GetCleanedUpFolderName(directoryInfo.Name); var cleanedUpName = GetCleanedUpFolderName(directoryInfo.Name);
var folderInfo = Parser.Parser.ParseTitle(directoryInfo.Name); var folderInfo = Parser.Parser.ParseMovieTitle(directoryInfo.Name);
if (folderInfo != null) if (folderInfo != null)
{ {
@@ -153,7 +153,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
private int GetMinimumAllowedRuntime(Movie movie) private int GetMinimumAllowedRuntime(Movie movie)
{ {
return 120; //2 minutes return 360; //6 minutes
} }
private int GetMinimumAllowedRuntime(Series series) private int GetMinimumAllowedRuntime(Series series)
@@ -47,6 +47,8 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
public List<ImportResult> Import(List<ImportDecision> decisions, bool newDownload, DownloadClientItem downloadClientItem = null, ImportMode importMode = ImportMode.Auto) public List<ImportResult> Import(List<ImportDecision> decisions, bool newDownload, DownloadClientItem downloadClientItem = null, ImportMode importMode = ImportMode.Auto)
{ {
_logger.Debug("Decisions: {0}", decisions.Count);
var qualifiedImports = decisions.Where(c => c.Approved) var qualifiedImports = decisions.Where(c => c.Approved)
.GroupBy(c => c.LocalMovie.Movie.Id, (i, s) => s .GroupBy(c => c.LocalMovie.Movie.Id, (i, s) => s
.OrderByDescending(c => c.LocalMovie.Quality, new QualityModelComparer(s.First().LocalMovie.Movie.Profile)) .OrderByDescending(c => c.LocalMovie.Quality, new QualityModelComparer(s.First().LocalMovie.Movie.Profile))
@@ -80,7 +82,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
episodeFile.Quality = localMovie.Quality; episodeFile.Quality = localMovie.Quality;
episodeFile.MediaInfo = localMovie.MediaInfo; episodeFile.MediaInfo = localMovie.MediaInfo;
episodeFile.Movie = localMovie.Movie; episodeFile.Movie = localMovie.Movie;
episodeFile.ReleaseGroup = localMovie.ParsedEpisodeInfo.ReleaseGroup; episodeFile.ReleaseGroup = localMovie.ParsedMovieInfo.ReleaseGroup;
bool copyOnly; bool copyOnly;
switch (importMode) switch (importMode)
@@ -24,15 +24,15 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
{ {
LocalMovie = localMovie; LocalMovie = localMovie;
Rejections = rejections.ToList(); Rejections = rejections.ToList();
LocalEpisode = new LocalEpisode //LocalMovie = new LocalMovie
{ //{
Quality = localMovie.Quality, // Quality = localMovie.Quality,
ExistingFile = localMovie.ExistingFile, // ExistingFile = localMovie.ExistingFile,
MediaInfo = localMovie.MediaInfo, // MediaInfo = localMovie.MediaInfo,
ParsedEpisodeInfo = localMovie.ParsedEpisodeInfo, // ParsedMovieInfo = localMovie.ParsedMovieInfo,
Path = localMovie.Path, // Path = localMovie.Path,
Size = localMovie.Size // Size = localMovie.Size
}; //};
} }
} }
} }
@@ -19,7 +19,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
{ {
List<ImportDecision> GetImportDecisions(List<string> videoFiles, Series series); List<ImportDecision> GetImportDecisions(List<string> videoFiles, Series series);
List<ImportDecision> GetImportDecisions(List<string> videoFiles, Movie movie); List<ImportDecision> GetImportDecisions(List<string> videoFiles, Movie movie);
List<ImportDecision> GetImportDecisions(List<string> videoFiles, Movie movie, ParsedEpisodeInfo folderInfo, bool sceneSource); //TODO: Needs changing to ParsedMovieInfo!! List<ImportDecision> GetImportDecisions(List<string> videoFiles, Movie movie, ParsedMovieInfo folderInfo, bool sceneSource); //TODO: Needs changing to ParsedMovieInfo!!
List<ImportDecision> GetImportDecisions(List<string> videoFiles, Series series, ParsedEpisodeInfo folderInfo, bool sceneSource); List<ImportDecision> GetImportDecisions(List<string> videoFiles, Series series, ParsedEpisodeInfo folderInfo, bool sceneSource);
} }
@@ -77,7 +77,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
return decisions; return decisions;
} }
public List<ImportDecision> GetImportDecisions(List<string> videoFiles, Movie movie, ParsedEpisodeInfo folderInfo, bool sceneSource) public List<ImportDecision> GetImportDecisions(List<string> videoFiles, Movie movie, ParsedMovieInfo folderInfo, bool sceneSource)
{ {
var newFiles = _mediaFileService.FilterExistingFiles(videoFiles.ToList(), movie); var newFiles = _mediaFileService.FilterExistingFiles(videoFiles.ToList(), movie);
@@ -94,7 +94,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
return decisions; return decisions;
} }
private ImportDecision GetDecision(string file, Movie movie, ParsedEpisodeInfo folderInfo, bool sceneSource, bool shouldUseFolderName) private ImportDecision GetDecision(string file, Movie movie, ParsedMovieInfo folderInfo, bool sceneSource, bool shouldUseFolderName)
{ {
ImportDecision decision = null; ImportDecision decision = null;
@@ -123,18 +123,18 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
else else
{ {
var localEpisode = new LocalEpisode(); localMovie = new LocalMovie();
localEpisode.Path = file; localMovie.Path = file;
decision = new ImportDecision(localEpisode, new Rejection("Unable to parse file")); decision = new ImportDecision(localMovie, new Rejection("Unable to parse file"));
} }
} }
catch (Exception e) catch (Exception e)
{ {
_logger.Error(e, "Couldn't import file. " + file); _logger.Error(e, "Couldn't import file. " + file);
var localEpisode = new LocalEpisode { Path = file }; var localMovie = new LocalMovie { Path = file };
decision = new ImportDecision(localEpisode, new Rejection("Unexpected error processing file")); decision = new ImportDecision(localMovie, new Rejection("Unexpected error processing file"));
} }
//LocalMovie nullMovie = null; //LocalMovie nullMovie = null;
@@ -291,17 +291,17 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
}) == 1; }) == 1;
} }
private bool ShouldUseFolderName(List<string> videoFiles, Movie movie, ParsedEpisodeInfo folderInfo) private bool ShouldUseFolderName(List<string> videoFiles, Movie movie, ParsedMovieInfo folderInfo)
{ {
if (folderInfo == null) if (folderInfo == null)
{ {
return false; return false;
} }
if (folderInfo.FullSeason) //if (folderInfo.FullSeason)
{ //{
return false; // return false;
} //}
return videoFiles.Count(file => return videoFiles.Count(file =>
{ {
@@ -325,7 +325,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
}) == 1; }) == 1;
} }
private QualityModel GetQuality(ParsedEpisodeInfo folderInfo, QualityModel fileQuality, Movie movie) private QualityModel GetQuality(ParsedMovieInfo folderInfo, QualityModel fileQuality, Movie movie)
{ {
if (UseFolderQuality(folderInfo, fileQuality, movie)) if (UseFolderQuality(folderInfo, fileQuality, movie))
{ {
@@ -347,7 +347,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
return fileQuality; return fileQuality;
} }
private bool UseFolderQuality(ParsedEpisodeInfo folderInfo, QualityModel fileQuality, Movie movie) private bool UseFolderQuality(ParsedMovieInfo folderInfo, QualityModel fileQuality, Movie movie)
{ {
if (folderInfo == null) if (folderInfo == null)
{ {
@@ -40,12 +40,6 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
public Decision IsSatisfiedBy(LocalMovie localEpisode) public Decision IsSatisfiedBy(LocalMovie localEpisode)
{ {
if (localEpisode.ExistingFile)
{
_logger.Debug("Existing file, skipping sample check");
return Decision.Accept();
}
var sample = _detectSample.IsSample(localEpisode.Movie, var sample = _detectSample.IsSample(localEpisode.Movie,
localEpisode.Quality, localEpisode.Quality,
localEpisode.Path, localEpisode.Path,
@@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
@@ -1,4 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using NLog; using NLog;
@@ -13,9 +13,9 @@ namespace NzbDrone.Core.MediaFiles
{ {
public interface IMediaFileService public interface IMediaFileService
{ {
MovieFile Add(MovieFile episodeFile); MovieFile Add(MovieFile movieFile);
void Update(MovieFile episodeFile); void Update(MovieFile movieFile);
void Delete(MovieFile episodeFile, DeleteMediaFileReason reason); void Delete(MovieFile movieFile, DeleteMediaFileReason reason);
EpisodeFile Add(EpisodeFile episodeFile); EpisodeFile Add(EpisodeFile episodeFile);
void Update(EpisodeFile episodeFile); void Update(EpisodeFile episodeFile);
void Delete(EpisodeFile episodeFile, DeleteMediaFileReason reason); void Delete(EpisodeFile episodeFile, DeleteMediaFileReason reason);
@@ -27,7 +27,9 @@ namespace NzbDrone.Core.MediaFiles
List<string> FilterExistingFiles(List<string> files, Movie movie); List<string> FilterExistingFiles(List<string> files, Movie movie);
EpisodeFile Get(int id); EpisodeFile Get(int id);
List<EpisodeFile> Get(IEnumerable<int> ids); List<EpisodeFile> Get(IEnumerable<int> ids);
List<MovieFile> GetMovies(IEnumerable<int> ids);
//List<MovieFile> Get(IEnumerable<int> ids);
} }
public class MediaFileService : IMediaFileService, IHandleAsync<SeriesDeletedEvent> public class MediaFileService : IMediaFileService, IHandleAsync<SeriesDeletedEvent>
@@ -125,6 +127,11 @@ namespace NzbDrone.Core.MediaFiles
return _mediaFileRepository.Get(ids).ToList(); return _mediaFileRepository.Get(ids).ToList();
} }
public List<MovieFile> GetMovies(IEnumerable<int> ids)
{
return _movieFileRepository.Get(ids).ToList();
}
public void HandleAsync(SeriesDeletedEvent message) public void HandleAsync(SeriesDeletedEvent message)
{ {
var files = GetFilesBySeries(message.Series.Id); var files = GetFilesBySeries(message.Series.Id);
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Core.MediaFiles
{
public class RenameMovieFilePreview
{
public int MovieId { get; set; }
public int MovieFileId { get; set; }
public string ExistingPath { get; set; }
public string NewPath { get; set; }
}
}
@@ -0,0 +1,138 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using NLog;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.MediaFiles.Commands;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Core.Organizer;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.MediaFiles
{
public interface IRenameMovieFileService
{
List<RenameMovieFilePreview> GetRenamePreviews(int movieId);
}
public class RenameMovieFileService : IRenameMovieFileService,
IExecute<RenameMovieFilesCommand>,
IExecute<RenameMovieCommand>
{
private readonly IMovieService _movieService;
private readonly IMediaFileService _mediaFileService;
private readonly IMoveMovieFiles _movieFileMover;
private readonly IEventAggregator _eventAggregator;
private readonly IBuildFileNames _filenameBuilder;
private readonly Logger _logger;
public RenameMovieFileService(IMovieService movieService,
IMediaFileService mediaFileService,
IMoveMovieFiles movieFileMover,
IEventAggregator eventAggregator,
IBuildFileNames filenameBuilder,
Logger logger)
{
_movieService = movieService;
_mediaFileService = mediaFileService;
_movieFileMover = movieFileMover;
_eventAggregator = eventAggregator;
_filenameBuilder = filenameBuilder;
_logger = logger;
}
public List<RenameMovieFilePreview> GetRenamePreviews(int movieId)
{
var movie = _movieService.GetMovie(movieId);
var file = _mediaFileService.GetFilesByMovie(movieId);
return GetPreviews(movie, file).OrderByDescending(m => m.MovieId).ToList(); //TODO: Would really like to not have these be lists
}
private IEnumerable<RenameMovieFilePreview> GetPreviews(Movie movie, List<MovieFile> files)
{
foreach(var file in files)
{
var movieFilePath = Path.Combine(movie.Path, file.RelativePath);
var newName = _filenameBuilder.BuildFileName(movie, file);
var newPath = _filenameBuilder.BuildFilePath(movie, newName, Path.GetExtension(movieFilePath));
if(!movieFilePath.PathEquals(newPath, StringComparison.Ordinal))
{
yield return new RenameMovieFilePreview
{
MovieId = movie.Id,
MovieFileId = file.Id,
ExistingPath = file.RelativePath,
NewPath = movie.Path.GetRelativePath(newPath)
};
}
}
}
private void RenameFiles(List<MovieFile> movieFiles, Movie movie)
{
var renamed = new List<MovieFile>();
foreach(var movieFile in movieFiles)
{
var movieFilePath = Path.Combine(movie.Path, movieFile.RelativePath);
try
{
_logger.Debug("Renaming movie file: {0}", movieFile);
_movieFileMover.MoveMovieFile(movieFile, movie);
_mediaFileService.Update(movieFile);
renamed.Add(movieFile);
_logger.Debug("Renamed movie file: {0}", movieFile);
}
catch(SameFilenameException ex)
{
_logger.Debug("File not renamed, source and destination are the same: {0}", ex.Filename);
}
catch(Exception ex)
{
_logger.Error(ex, "Failed to rename file: " + movieFilePath);
}
}
}
public void Execute(RenameMovieFilesCommand message)
{
var movie = _movieService.GetMovie(message.MovieId);
var movieFiles = _mediaFileService.GetMovies(message.Files);
_logger.ProgressInfo("Renaming {0} files for {1}", movieFiles.Count, movie.Title);
RenameFiles(movieFiles, movie);
_logger.ProgressInfo("Selected movie files renamed for {0}", movie.Title);
}
public void Execute(RenameMovieCommand message)
{
_logger.Debug("Renaming all files for selected movie");
var moviesToRename = _movieService.GetMovies(message.MovieIds);
foreach(var movie in moviesToRename)
{
var movieFiles = _mediaFileService.GetFilesByMovie(movie.Id);
_logger.ProgressInfo("Renaming all files in movie: {0}", movie.Title);
RenameFiles(movieFiles, movie);
_logger.ProgressInfo("All movie files renamed for {0}", movie.Title);
}
}
}
}
@@ -24,13 +24,15 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
private readonly IHttpRequestBuilderFactory _requestBuilder; private readonly IHttpRequestBuilderFactory _requestBuilder;
private readonly IHttpRequestBuilderFactory _movieBuilder; private readonly IHttpRequestBuilderFactory _movieBuilder;
private readonly ITmdbConfigService _configService; private readonly ITmdbConfigService _configService;
private readonly IMovieService _movieService;
public SkyHookProxy(IHttpClient httpClient, ISonarrCloudRequestBuilder requestBuilder, ITmdbConfigService configService, Logger logger) public SkyHookProxy(IHttpClient httpClient, ISonarrCloudRequestBuilder requestBuilder, ITmdbConfigService configService, IMovieService movieService, Logger logger)
{ {
_httpClient = httpClient; _httpClient = httpClient;
_requestBuilder = requestBuilder.SkyHookTvdb; _requestBuilder = requestBuilder.SkyHookTvdb;
_movieBuilder = requestBuilder.TMDB; _movieBuilder = requestBuilder.TMDB;
_configService = configService; _configService = configService;
_movieService = movieService;
_logger = logger; _logger = logger;
} }
@@ -90,8 +92,18 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
movie.CleanTitle = Parser.Parser.CleanSeriesTitle(movie.Title); movie.CleanTitle = Parser.Parser.CleanSeriesTitle(movie.Title);
movie.Overview = resource.overview; movie.Overview = resource.overview;
movie.Website = resource.homepage; movie.Website = resource.homepage;
movie.InCinemas = DateTime.Parse(resource.release_date); if (resource.release_date.IsNotNullOrWhiteSpace())
movie.Year = movie.InCinemas.Value.Year; {
movie.InCinemas = DateTime.Parse(resource.release_date);
movie.Year = movie.InCinemas.Value.Year;
}
var slugResult = _movieService.FindByTitleSlug(movie.TitleSlug);
if (slugResult != null)
{
_logger.Debug("Movie with this title slug already exists. Adding year...");
}
movie.TitleSlug += "-" + movie.Year.ToString();
movie.Images.Add(_configService.GetCoverForURL(resource.poster_path, MediaCoverTypes.Poster));//TODO: Update to load image specs from tmdb page! movie.Images.Add(_configService.GetCoverForURL(resource.poster_path, MediaCoverTypes.Poster));//TODO: Update to load image specs from tmdb page!
movie.Images.Add(_configService.GetCoverForURL(resource.backdrop_path, MediaCoverTypes.Banner)); movie.Images.Add(_configService.GetCoverForURL(resource.backdrop_path, MediaCoverTypes.Banner));
@@ -165,10 +177,10 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
{ {
if(title.EndsWith(",the")) if(title.EndsWith(",the"))
{ {
title = title.Substring(title.Length - 4); title = title.Substring(0, title.Length - 4);
} else if(title.EndsWith(", the")) } else if(title.EndsWith(", the"))
{ {
title = title.Substring(title.Length - 5); title = title.Substring(0, title.Length - 5);
} }
return title; return title;
} }
@@ -319,7 +331,21 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
imdbMovie.Title = result.title; imdbMovie.Title = result.title;
string titleSlug = result.title; string titleSlug = result.title;
imdbMovie.TitleSlug = titleSlug.ToLower().Replace(" ", "-"); imdbMovie.TitleSlug = titleSlug.ToLower().Replace(" ", "-");
imdbMovie.Year = DateTime.Parse(result.release_date).Year;
if (result.release_date.IsNotNullOrWhiteSpace())
{
imdbMovie.Year = DateTime.Parse(result.release_date).Year;
}
var slugResult = _movieService.FindByTitleSlug(imdbMovie.TitleSlug);
if (slugResult != null)
{
_logger.Debug("Movie with this title slug already exists. Adding year...");
}
imdbMovie.TitleSlug += "-" + imdbMovie.Year.ToString();
imdbMovie.Images = new List<MediaCover.MediaCover>(); imdbMovie.Images = new List<MediaCover.MediaCover>();
imdbMovie.Overview = result.overview; imdbMovie.Overview = result.overview;
try try
@@ -43,7 +43,7 @@ namespace NzbDrone.Core.Notifications.Boxcar
try try
{ {
const string title = "Test Notification"; const string title = "Test Notification";
const string body = "This is a test message from Sonarr"; const string body = "This is a test message from Radarr";
SendNotification(title, body, settings); SendNotification(title, body, settings);
return null; return null;
@@ -146,7 +146,7 @@ namespace NzbDrone.Core.Notifications.Growl
Register(settings.Host, settings.Port, settings.Password); Register(settings.Host, settings.Port, settings.Password);
const string title = "Test Notification"; const string title = "Test Notification";
const string body = "This is a test message from Sonarr"; const string body = "This is a test message from Radarr";
SendNotification(title, body, "TEST", settings.Host, settings.Port, settings.Password); SendNotification(title, body, "TEST", settings.Host, settings.Port, settings.Password);
} }
@@ -41,7 +41,7 @@ namespace NzbDrone.Core.Notifications.Join
public ValidationFailure Test(JoinSettings settings) public ValidationFailure Test(JoinSettings settings)
{ {
const string title = "Test Notification"; const string title = "Test Notification";
const string body = "This is a test message from Sonarr."; const string body = "This is a test message from Radarr.";
try try
{ {
@@ -69,7 +69,7 @@ namespace NzbDrone.Core.Notifications.NotifyMyAndroid
try try
{ {
const string title = "Test Notification"; const string title = "Test Notification";
const string body = "This is a test message from Sonarr"; const string body = "This is a test message from Radarr";
Verify(settings.ApiKey); Verify(settings.ApiKey);
SendNotification(title, body, settings.ApiKey, (NotifyMyAndroidPriority)settings.Priority); SendNotification(title, body, settings.ApiKey, (NotifyMyAndroidPriority)settings.Priority);
} }
@@ -88,7 +88,7 @@ namespace NzbDrone.Core.Notifications.Prowl
Verify(settings.ApiKey); Verify(settings.ApiKey);
const string title = "Test Notification"; const string title = "Test Notification";
const string body = "This is a test message from Sonarr"; const string body = "This is a test message from Radarr";
SendNotification(title, body, settings.ApiKey); SendNotification(title, body, settings.ApiKey);
} }
@@ -93,7 +93,7 @@ namespace NzbDrone.Core.Notifications.PushBullet
try try
{ {
const string title = "Sonarr - Test Notification"; const string title = "Sonarr - Test Notification";
const string body = "This is a test message from Sonarr"; const string body = "This is a test message from Radarr";
SendNotification(title, body, settings); SendNotification(title, body, settings);
} }
@@ -65,7 +65,7 @@ namespace NzbDrone.Core.Notifications.Pushalot
try try
{ {
const string title = "Test Notification"; const string title = "Test Notification";
const string body = "This is a test message from Sonarr"; const string body = "This is a test message from Radarr";
SendNotification(title, body, settings); SendNotification(title, body, settings);
} }
@@ -53,7 +53,7 @@ namespace NzbDrone.Core.Notifications.Pushover
try try
{ {
const string title = "Test Notification"; const string title = "Test Notification";
const string body = "This is a test message from Sonarr"; const string body = "This is a test message from Radarr";
SendNotification(title, body, settings); SendNotification(title, body, settings);
} }
@@ -45,7 +45,7 @@ namespace NzbDrone.Core.Notifications.Telegram
try try
{ {
const string title = "Test Notification"; const string title = "Test Notification";
const string body = "This is a test message from Sonarr"; const string body = "This is a test message from Radarr";
SendNotification(title, body, settings); SendNotification(title, body, settings);
} }
+4
View File
@@ -707,6 +707,8 @@
<Compile Include="MediaFiles\Commands\BackendCommandAttribute.cs" /> <Compile Include="MediaFiles\Commands\BackendCommandAttribute.cs" />
<Compile Include="MediaFiles\Commands\CleanUpRecycleBinCommand.cs" /> <Compile Include="MediaFiles\Commands\CleanUpRecycleBinCommand.cs" />
<Compile Include="MediaFiles\Commands\DownloadedEpisodesScanCommand.cs" /> <Compile Include="MediaFiles\Commands\DownloadedEpisodesScanCommand.cs" />
<Compile Include="MediaFiles\Commands\RenameMovieCommand.cs" />
<Compile Include="MediaFiles\Commands\RenameMovieFilesCommand.cs" />
<Compile Include="MediaFiles\Commands\RescanMovieCommand.cs" /> <Compile Include="MediaFiles\Commands\RescanMovieCommand.cs" />
<Compile Include="MediaFiles\DownloadedMovieCommandService.cs" /> <Compile Include="MediaFiles\DownloadedMovieCommandService.cs" />
<Compile Include="MediaFiles\MovieFileMovingService.cs" /> <Compile Include="MediaFiles\MovieFileMovingService.cs" />
@@ -780,6 +782,8 @@
<Compile Include="MediaFiles\RecycleBinProvider.cs" /> <Compile Include="MediaFiles\RecycleBinProvider.cs" />
<Compile Include="MediaFiles\RenameEpisodeFilePreview.cs" /> <Compile Include="MediaFiles\RenameEpisodeFilePreview.cs" />
<Compile Include="MediaFiles\RenameEpisodeFileService.cs" /> <Compile Include="MediaFiles\RenameEpisodeFileService.cs" />
<Compile Include="MediaFiles\RenameMovieFilePreview.cs" />
<Compile Include="MediaFiles\RenameMovieFileService.cs" />
<Compile Include="MediaFiles\SameFilenameException.cs" /> <Compile Include="MediaFiles\SameFilenameException.cs" />
<Compile Include="MediaFiles\UpdateMovieFileService.cs" /> <Compile Include="MediaFiles\UpdateMovieFileService.cs" />
<Compile Include="MediaFiles\UpdateEpisodeFileService.cs" /> <Compile Include="MediaFiles\UpdateEpisodeFileService.cs" />
@@ -67,6 +67,8 @@ namespace NzbDrone.Core.Organizer
{ {
var value = context.PropertyValue as string; var value = context.PropertyValue as string;
return true;
if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) &&
!FileNameValidation.OriginalTokenRegex.IsMatch(value)) !FileNameValidation.OriginalTokenRegex.IsMatch(value))
{ {
@@ -89,6 +91,8 @@ namespace NzbDrone.Core.Organizer
{ {
var value = context.PropertyValue as string; var value = context.PropertyValue as string;
return true;
if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) &&
!FileNameBuilder.AirDateRegex.IsMatch(value) && !FileNameBuilder.AirDateRegex.IsMatch(value) &&
!FileNameValidation.OriginalTokenRegex.IsMatch(value)) !FileNameValidation.OriginalTokenRegex.IsMatch(value))
@@ -112,6 +116,8 @@ namespace NzbDrone.Core.Organizer
{ {
var value = context.PropertyValue as string; var value = context.PropertyValue as string;
return true;
if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) &&
!FileNameBuilder.AbsoluteEpisodePatternRegex.IsMatch(value) && !FileNameBuilder.AbsoluteEpisodePatternRegex.IsMatch(value) &&
!FileNameValidation.OriginalTokenRegex.IsMatch(value)) !FileNameValidation.OriginalTokenRegex.IsMatch(value))
+2 -2
View File
@@ -1,4 +1,4 @@
using System.Linq; using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
using NzbDrone.Core.Tv; using NzbDrone.Core.Tv;
@@ -14,7 +14,7 @@ namespace NzbDrone.Core.Parser.Model
public string Path { get; set; } public string Path { get; set; }
public long Size { get; set; } public long Size { get; set; }
public ParsedEpisodeInfo ParsedEpisodeInfo { get; set; } public ParsedMovieInfo ParsedMovieInfo { get; set; }
public Movie Movie { get; set; } public Movie Movie { get; set; }
public QualityModel Quality { get; set; } public QualityModel Quality { get; set; }
public MediaInfoModel MediaInfo { get; set; } public MediaInfoModel MediaInfo { get; set; }
@@ -1,4 +1,4 @@
using System.Linq; using System.Linq;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
@@ -9,10 +9,10 @@ namespace NzbDrone.Core.Parser.Model
public string MovieTitle { get; set; } public string MovieTitle { get; set; }
public SeriesTitleInfo MovieTitleInfo { get; set; } public SeriesTitleInfo MovieTitleInfo { get; set; }
public QualityModel Quality { get; set; } public QualityModel Quality { get; set; }
public int SeasonNumber { get; set; } //public int SeasonNumber { get; set; }
public Language Language { get; set; } public Language Language { get; set; }
public bool FullSeason { get; set; } //public bool FullSeason { get; set; }
public bool Special { get; set; } //public bool Special { get; set; }
public string ReleaseGroup { get; set; } public string ReleaseGroup { get; set; }
public string ReleaseHash { get; set; } public string ReleaseHash { get; set; }
public string Edition { get; set;} public string Edition { get; set;}
+22
View File
@@ -323,6 +323,28 @@ namespace NzbDrone.Core.Parser
return result; return result;
} }
public static ParsedMovieInfo ParseMoviePath(string path)
{
var fileInfo = new FileInfo(path);
var result = ParseMovieTitle(fileInfo.Name);
if (result == null)
{
Logger.Debug("Attempting to parse episode info using directory and file names. {0}", fileInfo.Directory.Name);
result = ParseMovieTitle(fileInfo.Directory.Name + " " + fileInfo.Name);
}
if (result == null)
{
Logger.Debug("Attempting to parse episode info using directory name. {0}", fileInfo.Directory.Name);
result = ParseMovieTitle(fileInfo.Directory.Name + fileInfo.Extension);
}
return result;
}
public static ParsedMovieInfo ParseMovieTitle(string title) public static ParsedMovieInfo ParseMovieTitle(string title)
{ {
+15 -10
View File
@@ -16,7 +16,7 @@ namespace NzbDrone.Core.Parser
LocalEpisode GetLocalEpisode(string filename, Series series); LocalEpisode GetLocalEpisode(string filename, Series series);
LocalEpisode GetLocalEpisode(string filename, Series series, ParsedEpisodeInfo folderInfo, bool sceneSource); LocalEpisode GetLocalEpisode(string filename, Series series, ParsedEpisodeInfo folderInfo, bool sceneSource);
LocalMovie GetLocalMovie(string filename, Movie movie); LocalMovie GetLocalMovie(string filename, Movie movie);
LocalMovie GetLocalMovie(string filename, Movie movie, ParsedEpisodeInfo folderInfo, bool sceneSource); LocalMovie GetLocalMovie(string filename, Movie movie, ParsedMovieInfo folderInfo, bool sceneSource);
Series GetSeries(string title); Series GetSeries(string title);
Movie GetMovie(string title); Movie GetMovie(string title);
RemoteEpisode Map(ParsedEpisodeInfo parsedEpisodeInfo, int tvdbId, int tvRageId, SearchCriteriaBase searchCriteria = null); RemoteEpisode Map(ParsedEpisodeInfo parsedEpisodeInfo, int tvdbId, int tvRageId, SearchCriteriaBase searchCriteria = null);
@@ -120,26 +120,26 @@ namespace NzbDrone.Core.Parser
return GetLocalMovie(filename, movie, null, false); return GetLocalMovie(filename, movie, null, false);
} }
public LocalMovie GetLocalMovie(string filename, Movie movie, ParsedEpisodeInfo folderInfo, bool sceneSource) public LocalMovie GetLocalMovie(string filename, Movie movie, ParsedMovieInfo folderInfo, bool sceneSource)
{ {
ParsedEpisodeInfo parsedEpisodeInfo; ParsedMovieInfo parsedMovieInfo;
if (folderInfo != null) if (folderInfo != null)
{ {
parsedEpisodeInfo = folderInfo.JsonClone(); parsedMovieInfo = folderInfo.JsonClone();
parsedEpisodeInfo.Quality = QualityParser.ParseQuality(Path.GetFileName(filename)); parsedMovieInfo.Quality = QualityParser.ParseQuality(Path.GetFileName(filename));
} }
else else
{ {
parsedEpisodeInfo = Parser.ParsePath(filename); parsedMovieInfo = Parser.ParseMoviePath(filename);
} }
if (parsedEpisodeInfo == null) if (parsedMovieInfo == null)
{ {
if (MediaFileExtensions.Extensions.Contains(Path.GetExtension(filename))) if (MediaFileExtensions.Extensions.Contains(Path.GetExtension(filename)))
{ {
_logger.Warn("Unable to parse episode info from path {0}", filename); _logger.Warn("Unable to parse movie info from path {0}", filename);
} }
return null; return null;
@@ -148,9 +148,9 @@ namespace NzbDrone.Core.Parser
return new LocalMovie return new LocalMovie
{ {
Movie = movie, Movie = movie,
Quality = parsedEpisodeInfo.Quality, Quality = parsedMovieInfo.Quality,
Path = filename, Path = filename,
ParsedEpisodeInfo = parsedEpisodeInfo, ParsedMovieInfo = parsedMovieInfo,
ExistingFile = movie.Path.IsParentPath(filename) ExistingFile = movie.Path.IsParentPath(filename)
}; };
} }
@@ -192,6 +192,11 @@ namespace NzbDrone.Core.Parser
parsedEpisodeInfo.MovieTitleInfo.Year); parsedEpisodeInfo.MovieTitleInfo.Year);
} }
if (series == null)
{
series = _movieService.FindByTitle(parsedEpisodeInfo.MovieTitle.Replace("DC", "").Trim());
}
return series; return series;
} }
+3
View File
@@ -48,6 +48,9 @@ namespace NzbDrone.Core.Tv
public LazyLoaded<MovieFile> MovieFile { get; set; } public LazyLoaded<MovieFile> MovieFile { get; set; }
public int MovieFileId { get; set; } public int MovieFileId { get; set; }
public List<string> AlternativeTitles { get; set; } public List<string> AlternativeTitles { get; set; }
public bool HasFile => MovieFileId > 0;
public override string ToString() public override string ToString()
{ {
return string.Format("[{0}][{1}]", ImdbId, Title.NullSafe()); return string.Format("[{0}][{1}]", ImdbId, Title.NullSafe());
+8 -3
View File
@@ -13,6 +13,7 @@ namespace NzbDrone.Core.Tv
Movie FindByTitle(string cleanTitle); Movie FindByTitle(string cleanTitle);
Movie FindByTitle(string cleanTitle, int year); Movie FindByTitle(string cleanTitle, int year);
Movie FindByImdbId(string imdbid); Movie FindByImdbId(string imdbid);
Movie FindByTitleSlug(string slug);
List<Movie> GetMoviesByFileId(int fileId); List<Movie> GetMoviesByFileId(int fileId);
void SetFileId(int fileId, int movieId); void SetFileId(int fileId, int movieId);
} }
@@ -62,11 +63,11 @@ namespace NzbDrone.Core.Tv
cleanNum = cleanNum.Replace(roman, num); cleanNum = cleanNum.Replace(roman, num);
} }
var result = Query.Where(s => s.CleanTitle == cleanTitle).SingleOrDefault(); var result = Query.Where(s => s.CleanTitle == cleanTitle).FirstOrDefault();
if (result == null) if (result == null)
{ {
result = Query.Where(s => s.CleanTitle == cleanNum).OrWhere(s => s.CleanTitle == cleanRoman).SingleOrDefault(); result = Query.Where(s => s.CleanTitle == cleanNum).OrWhere(s => s.CleanTitle == cleanRoman).FirstOrDefault();
if (result == null) if (result == null)
{ {
@@ -74,7 +75,7 @@ namespace NzbDrone.Core.Tv
result = movies.Where(m => m.AlternativeTitles.Any(t => Parser.Parser.CleanSeriesTitle(t.ToLower()) == cleanTitle || result = movies.Where(m => m.AlternativeTitles.Any(t => Parser.Parser.CleanSeriesTitle(t.ToLower()) == cleanTitle ||
Parser.Parser.CleanSeriesTitle(t.ToLower()) == cleanRoman || Parser.Parser.CleanSeriesTitle(t.ToLower()) == cleanRoman ||
Parser.Parser.CleanSeriesTitle(t.ToLower()) == cleanNum)).SingleOrDefault(); Parser.Parser.CleanSeriesTitle(t.ToLower()) == cleanNum)).FirstOrDefault();
return result; return result;
} }
@@ -114,5 +115,9 @@ namespace NzbDrone.Core.Tv
SetFields(new Movie { Id = episodeId, MovieFileId = fileId }, movie => movie.MovieFileId); SetFields(new Movie { Id = episodeId, MovieFileId = fileId }, movie => movie.MovieFileId);
} }
public Movie FindByTitleSlug(string slug)
{
return Query.Where(m => m.TitleSlug == slug).FirstOrDefault();
}
} }
} }
+6
View File
@@ -24,6 +24,7 @@ namespace NzbDrone.Core.Tv
Movie FindByTitle(string title); Movie FindByTitle(string title);
Movie FindByTitle(string title, int year); Movie FindByTitle(string title, int year);
Movie FindByTitleInexact(string title); Movie FindByTitleInexact(string title);
Movie FindByTitleSlug(string slug);
Movie GetMovieByFileId(int fileId); Movie GetMovieByFileId(int fileId);
void DeleteMovie(int movieId, bool deleteFiles); void DeleteMovie(int movieId, bool deleteFiles);
List<Movie> GetAllMovies(); List<Movie> GetAllMovies();
@@ -218,5 +219,10 @@ namespace NzbDrone.Core.Tv
{ {
return _movieRepository.GetMoviesByFileId(fileId).First(); return _movieRepository.GetMoviesByFileId(fileId).First();
} }
public Movie FindByTitleSlug(string slug)
{
return _movieRepository.FindByTitleSlug(slug);
}
} }
} }
+2 -2
View File
@@ -2,7 +2,7 @@ var Marionette = require('marionette');
var Backgrid = require('backgrid'); var Backgrid = require('backgrid');
var HistoryCollection = require('./HistoryCollection'); var HistoryCollection = require('./HistoryCollection');
var EventTypeCell = require('../../Cells/EventTypeCell'); var EventTypeCell = require('../../Cells/EventTypeCell');
var MovieTitleCell = require('../../Cells/MovieTitleCell'); var MovieTitleCell = require('../../Cells/MovieTitleHistoryCell');
var EpisodeNumberCell = require('../../Cells/EpisodeNumberCell'); var EpisodeNumberCell = require('../../Cells/EpisodeNumberCell');
var EpisodeTitleCell = require('../../Cells/EpisodeTitleCell'); var EpisodeTitleCell = require('../../Cells/EpisodeTitleCell');
var HistoryQualityCell = require('./HistoryQualityCell'); var HistoryQualityCell = require('./HistoryQualityCell');
@@ -31,7 +31,7 @@ module.exports = Marionette.Layout.extend({
{ {
name : 'movies', name : 'movies',
label : 'Movie Title', label : 'Movie Title',
cell : MovieTitleCell cell : MovieTitleCell,
}, },
/*{ /*{
name : 'episode', name : 'episode',
+4 -37
View File
@@ -58,7 +58,7 @@ var view = Marionette.ItemView.extend({
var defaultProfile = Config.getValue(Config.Keys.DefaultProfileId); var defaultProfile = Config.getValue(Config.Keys.DefaultProfileId);
var defaultRoot = Config.getValue(Config.Keys.DefaultRootFolderId); var defaultRoot = Config.getValue(Config.Keys.DefaultRootFolderId);
var useSeasonFolder = Config.getValueBoolean(Config.Keys.UseSeasonFolder, true); var useSeasonFolder = Config.getValueBoolean(Config.Keys.UseSeasonFolder, true);
var defaultMonitorEpisodes = Config.getValue(Config.Keys.MonitorEpisodes, 'missing'); var defaultMonitorEpisodes = Config.getValue(Config.Keys.MonitorEpisodes, 'all');
if (Profiles.get(defaultProfile)) { if (Profiles.get(defaultProfile)) {
this.ui.profile.val(defaultProfile); this.ui.profile.val(defaultProfile);
@@ -169,6 +169,7 @@ var view = Marionette.ItemView.extend({
var profile = this.ui.profile.val(); var profile = this.ui.profile.val();
var rootFolderPath = this.ui.rootFolder.children(':selected').text(); var rootFolderPath = this.ui.rootFolder.children(':selected').text();
var monitor = this.ui.monitor.val();
var options = this._getAddMoviesOptions(); var options = this._getAddMoviesOptions();
options.searchForMovie = searchForMovie; options.searchForMovie = searchForMovie;
@@ -178,7 +179,7 @@ var view = Marionette.ItemView.extend({
profileId : profile, profileId : profile,
rootFolderPath : rootFolderPath, rootFolderPath : rootFolderPath,
addOptions : options, addOptions : options,
monitored : true monitored : (monitor === 'all' ? true : false)
}, { silent : true }); }, { silent : true });
var self = this; var self = this;
@@ -229,44 +230,10 @@ var view = Marionette.ItemView.extend({
}, },
_getAddMoviesOptions : function() { _getAddMoviesOptions : function() {
var monitor = this.ui.monitor.val(); return {
var options = {
ignoreEpisodesWithFiles : false, ignoreEpisodesWithFiles : false,
ignoreEpisodesWithoutFiles : false ignoreEpisodesWithoutFiles : false
}; };
if (monitor === 'all') {
return options;
}
else if (monitor === 'future') {
options.ignoreEpisodesWithFiles = true;
options.ignoreEpisodesWithoutFiles = true;
}
// else if (monitor === 'latest') {
// this.model.setSeasonPass(lastSeason.seasonNumber);
// }
// else if (monitor === 'first') {
// this.model.setSeasonPass(lastSeason.seasonNumber + 1);
// this.model.setSeasonMonitored(firstSeason.seasonNumber);
// }
else if (monitor === 'missing') {
options.ignoreEpisodesWithFiles = true;
}
else if (monitor === 'existing') {
options.ignoreEpisodesWithoutFiles = true;
}
// else if (monitor === 'none') {
// this.model.setSeasonPass(lastSeason.seasonNumber + 1);
// }
return options;
} }
}); });
@@ -1,7 +1,7 @@
<div class="search-item {{#unless isExisting}}search-item-new{{/unless}}"> <div class="search-item {{#unless isExisting}}search-item-new{{/unless}}">
<div class="row"> <div class="row">
<div class="col-md-2"> <div class="col-md-2">
<a href="{{imdbUrl}}" target="_blank"> <a href="{{tmdbUrl}}" target="_blank">
{{#if remotePoster}} {{#if remotePoster}}
{{remotePoster}} {{remotePoster}}
{{else}} {{else}}
@@ -41,9 +41,9 @@
<div class="form-group col-md-2"> <div class="form-group col-md-2">
<label>Monitor <i class="icon-sonarr-form-info monitor-tooltip x-monitor-tooltip"></i></label> <label>Monitor <i class="icon-sonarr-form-info monitor-tooltip x-monitor-tooltip"></i></label>
<select class="form-control col-md-2 x-monitor"> <select class="form-control col-md-2 x-monitor">
<option value="all">All</option> <option value="all">Yes</option>
<option value="missing">Missing</option> <!-- <option value="missing">Missing</option> -->
<option value="none">None</option> <option value="none">No</option>
</select> </select>
</div> </div>
@@ -52,7 +52,7 @@
{{> ProfileSelectionPartial profiles}} {{> ProfileSelectionPartial profiles}}
</div> </div>
<div class="form-group col-md-2"> {{!--<div class="form-group col-md-2">
<label>Season Folders</label> <label>Season Folders</label>
<div class="input-group"> <div class="input-group">
@@ -65,7 +65,7 @@
<div class="btn btn-primary slide-button"/> <div class="btn btn-primary slide-button"/>
</label> </label>
</div> </div>
</div> </div>--}}
{{/unless}} {{/unless}}
{{#unless existing}} {{#unless existing}}
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = NzbDroneCell.extend({
}, },
_editSeries : function() { _editSeries : function() {
vent.trigger(vent.Commands.EditSeriesCommand, { series : this.model }); vent.trigger(vent.Commands.EditMovieCommand, { movie : this.model });
}, },
_refreshSeries : function() { _refreshSeries : function() {
+1 -1
View File
@@ -1 +1 @@
<span class="label label-{{DownloadedStatusColor}}">{{DownloadedStatus}}</span> <span class="label label-{{DownloadedStatusColor}}" title="{{DownloadedQuality}}">{{DownloadedStatus}}</span>
-4
View File
@@ -4,8 +4,4 @@ module.exports = TemplatedCell.extend({
className : 'series-title-cell', className : 'series-title-cell',
template : 'Cells/SeriesTitleTemplate', template : 'Cells/SeriesTitleTemplate',
render : function() {
this.$el.html(this.model.get("movie").get("title")); //Hack, but somehow handlebar helper does not work.
return this;
}
}); });
-6
View File
@@ -1,6 +0,0 @@
var TemplatedCell = require('./TemplatedCell');
module.exports = TemplatedCell.extend({
className : 'series-title-cell',
template : 'Cells/SeriesTitleTemplate',
});
+14
View File
@@ -0,0 +1,14 @@
var TemplatedCell = require('./TemplatedCell');
module.exports = TemplatedCell.extend({
className : 'series-title-cell',
template : 'Cells/SeriesTitleTemplate',
render : function() {
this.$el.html(this.model.get("movie").get("title")); //Hack, but somehow handlebar helper does not work.
debugger;
return this;
}
});
+6
View File
@@ -11,6 +11,7 @@ var ReleaseLayout = require('./Release/ReleaseLayout');
var SystemLayout = require('./System/SystemLayout'); var SystemLayout = require('./System/SystemLayout');
var SeasonPassLayout = require('./SeasonPass/SeasonPassLayout'); var SeasonPassLayout = require('./SeasonPass/SeasonPassLayout');
var SeriesEditorLayout = require('./Series/Editor/SeriesEditorLayout'); var SeriesEditorLayout = require('./Series/Editor/SeriesEditorLayout');
var MovieEditorLayout = require('./Movies/Editor/MovieEditorLayout');
module.exports = NzbDroneController.extend({ module.exports = NzbDroneController.extend({
addSeries : function(action) { addSeries : function(action) {
@@ -61,5 +62,10 @@ module.exports = NzbDroneController.extend({
seriesEditor : function() { seriesEditor : function() {
this.setTitle('Series Editor'); this.setTitle('Series Editor');
this.showMainRegion(new SeriesEditorLayout()); this.showMainRegion(new SeriesEditorLayout());
},
movieEditor : function() {
this.setTitle('Movie Editor');
this.showMainRegion(new MovieEditorLayout());
} }
}); });
+8
View File
@@ -161,6 +161,14 @@ Handlebars.registerHelper('DownloadedStatus', function() {
return "Missing"; return "Missing";
}); });
Handlebars.registerHelper("DownloadedQuality", function() {
if (this.movieFile) {
return this.movieFile.quality.quality.name;
}
return "";
})
Handlebars.registerHelper('inCinemas', function() { Handlebars.registerHelper('inCinemas', function() {
var monthNames = ["January", "February", "March", "April", "May", "June", var monthNames = ["January", "February", "March", "April", "May", "June",
+1 -1
View File
@@ -26,7 +26,7 @@
{{else}} {{else}}
<span class="label label-default">Announced</span> <span class="label label-default">Announced</span>
{{/if_eq}} {{/if_eq}}
<span class="label label-{{DownloadedStatusColor}}">{{DownloadedStatus}}</span> <span class="label label-{{DownloadedStatusColor}}" title="{{DownloadedQuality}}">{{DownloadedStatus}}</span>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<span class="series-info-links"> <span class="series-info-links">
+2 -2
View File
@@ -97,7 +97,7 @@ module.exports = Marionette.Layout.extend({
CommandController.bindToCommand({ CommandController.bindToCommand({
element : this.ui.rename, element : this.ui.rename,
command : { command : {
name : 'renameFiles', name : 'renameMovieFiles',
movieId : this.model.id, movieId : this.model.id,
seasonNumber : -1 seasonNumber : -1
} }
@@ -237,7 +237,7 @@ module.exports = Marionette.Layout.extend({
}, },
_commandComplete : function(options) { _commandComplete : function(options) {
if (options.command.get('name') === 'renamefiles') { if (options.command.get('name') === 'renameMoviefiles') {
if (options.command.get('moviesId') === this.model.get('id')) { if (options.command.get('moviesId') === this.model.get('id')) {
this._refresh(); this._refresh();
} }
@@ -15,7 +15,7 @@
<i class="icon-sonarr-refresh icon-can-spin" title="Update movie info and scan disk"/> <i class="icon-sonarr-refresh icon-can-spin" title="Update movie info and scan disk"/>
</div> </div>
<div class="x-rename"> <div class="x-rename">
<i class="icon-sonarr-rename" title="Preview rename for all episodes"/> <i class="icon-sonarr-rename" title="Preview rename for movie"/>
</div> </div>
<div class="x-search"> <div class="x-search">
<i class="icon-sonarr-search" title="Search for movie"/> <i class="icon-sonarr-search" title="Search for movie"/>
@@ -0,0 +1,126 @@
var _ = require('underscore');
var Marionette = require('marionette');
var vent = require('vent');
var Profiles = require('../../Profile/ProfileCollection');
var RootFolders = require('../../AddMovies/RootFolders/RootFolderCollection');
var RootFolderLayout = require('../../AddMovies/RootFolders/RootFolderLayout');
var UpdateFilesMoviesView = require('./Organize/OrganizeFilesView');
var Config = require('../../Config');
module.exports = Marionette.ItemView.extend({
template : 'Movies/Editor/MovieEditorFooterViewTemplate',
ui : {
monitored : '.x-monitored',
profile : '.x-profiles',
seasonFolder : '.x-season-folder',
rootFolder : '.x-root-folder',
selectedCount : '.x-selected-count',
container : '.series-editor-footer',
actions : '.x-action'
},
events : {
'click .x-save' : '_updateAndSave',
'change .x-root-folder' : '_rootFolderChanged',
'click .x-organize-files' : '_organizeFiles'
},
templateHelpers : function() {
return {
profiles : Profiles,
rootFolders : RootFolders.toJSON()
};
},
initialize : function(options) {
this.moviesCollection = options.collection;
RootFolders.fetch().done(function() {
RootFolders.synced = true;
});
this.editorGrid = options.editorGrid;
this.listenTo(this.moviesCollection, 'backgrid:selected', this._updateInfo);
this.listenTo(RootFolders, 'all', this.render);
},
onRender : function() {
this._updateInfo();
},
_updateAndSave : function() {
var selected = this.editorGrid.getSelectedModels();
var monitored = this.ui.monitored.val();
var profile = this.ui.profile.val();
var seasonFolder = this.ui.seasonFolder.val();
var rootFolder = this.ui.rootFolder.val();
_.each(selected, function(model) {
if (monitored === 'true') {
model.set('monitored', true);
} else if (monitored === 'false') {
model.set('monitored', false);
}
if (profile !== 'noChange') {
model.set('profileId', parseInt(profile, 10));
}
if (seasonFolder === 'true') {
model.set('seasonFolder', true);
} else if (seasonFolder === 'false') {
model.set('seasonFolder', false);
}
if (rootFolder !== 'noChange') {
var rootFolderPath = RootFolders.get(parseInt(rootFolder, 10));
model.set('rootFolderPath', rootFolderPath.get('path'));
}
model.edited = true;
});
this.moviesCollection.save();
},
_updateInfo : function() {
var selected = this.editorGrid.getSelectedModels();
var selectedCount = selected.length;
this.ui.selectedCount.html('{0} movies selected'.format(selectedCount));
if (selectedCount === 0) {
this.ui.actions.attr('disabled', 'disabled');
} else {
this.ui.actions.removeAttr('disabled');
}
},
_rootFolderChanged : function() {
var rootFolderValue = this.ui.rootFolder.val();
if (rootFolderValue === 'addNew') {
var rootFolderLayout = new RootFolderLayout();
this.listenToOnce(rootFolderLayout, 'folderSelected', this._setRootFolder);
vent.trigger(vent.Commands.OpenModalCommand, rootFolderLayout);
} else {
Config.setValue(Config.Keys.DefaultRootFolderId, rootFolderValue);
}
},
_setRootFolder : function(options) {
vent.trigger(vent.Commands.CloseModalCommand);
this.ui.rootFolder.val(options.model.id);
this._rootFolderChanged();
},
_organizeFiles : function() {
var selected = this.editorGrid.getSelectedModels();
var updateFilesMoviesView = new UpdateFilesMoviesView({ movies : selected });
this.listenToOnce(updateFilesMoviesView, 'updatingFiles', this._afterSave);
vent.trigger(vent.Commands.OpenModalCommand, updateFilesMoviesView);
}
});
@@ -0,0 +1,54 @@
<div class="series-editor-footer">
<div class="row">
<div class="form-group col-md-2">
<label>Monitored</label>
<select class="form-control x-action x-monitored">
<option value="noChange">No change</option>
<option value="true">Monitored</option>
<option value="false">Unmonitored</option>
</select>
</div>
<div class="form-group col-md-2">
<label>Profile</label>
<select class="form-control x-action x-profiles">
<option value="noChange">No change</option>
{{#each profiles.models}}
<option value="{{id}}">{{attributes.name}}</option>
{{/each}}
</select>
</div>
{{!--<div class="form-group col-md-2">
<label>Season Folder</label>
<select class="form-control x-action x-season-folder">
<option value="noChange">No change</option>
<option value="true">Yes</option>
<option value="false">No</option>
</select>
</div>--}}
<div class="form-group col-md-3">
<label>Root Folder</label>
<select class="form-control x-action x-root-folder" validation-name="RootFolderPath">
<option value="noChange">No change</option>
{{#each rootFolders}}
<option value="{{id}}">{{path}}</option>
{{/each}}
<option value="addNew">Add a different path</option>
</select>
</div>
<div class="form-group col-md-3 actions">
<label class="x-selected-count">0 movies selected</label>
<div>
<button class="btn btn-primary x-action x-save">Save</button>
<button class="btn btn-danger x-action x-organize-files" title="Organize and rename movie files">Organize</button>
</div>
</div>
</div>
</div>
+153
View File
@@ -0,0 +1,153 @@
var vent = require('vent');
var Marionette = require('marionette');
var Backgrid = require('backgrid');
var EmptyView = require('../Index/EmptyView');
var MoviesCollection = require('../MoviesCollection');
var MovieTitleCell = require('../../Cells/MovieTitleCell');
var ProfileCell = require('../../Cells/ProfileCell');
var SelectAllCell = require('../../Cells/SelectAllCell');
var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout');
var FooterView = require('./MovieEditorFooterView');
require('../../Mixins/backbone.signalr.mixin');
module.exports = Marionette.Layout.extend({
template : 'Movies/Editor/MovieEditorLayoutTemplate',
regions : {
seriesRegion : '#x-series-editor',
toolbar : '#x-toolbar'
},
ui : {
monitored : '.x-monitored',
profiles : '.x-profiles',
rootFolder : '.x-root-folder',
selectedCount : '.x-selected-count'
},
events : {
'click .x-save' : '_updateAndSave',
'change .x-root-folder' : '_rootFolderChanged'
},
columns : [
{
name : '',
cell : SelectAllCell,
headerCell : 'select-all',
sortable : false
},
{
name : 'title',
label : 'Title',
cell : MovieTitleCell,
cellValue : 'this'
},
{
name : 'profileId',
label : 'Profile',
cell : ProfileCell
},
{
name : 'path',
label : 'Path',
cell : 'string'
}
],
leftSideButtons : {
type : 'default',
storeState : false,
items : [
{
title : 'Update Library',
icon : 'icon-sonarr-refresh',
command : 'refreshseries',
successMessage : 'Library was updated!',
errorMessage : 'Library update failed!'
}
]
},
initialize : function() {
this.movieCollection = MoviesCollection.clone();
this.movieCollection.shadowCollection.bindSignalR();
this.listenTo(this.movieCollection, 'save', this.render);
this.filteringOptions = {
type : 'radio',
storeState : true,
menuKey : 'serieseditor.filterMode',
defaultAction : 'all',
items : [
{
key : 'all',
title : '',
tooltip : 'All',
icon : 'icon-sonarr-all',
callback : this._setFilter
},
{
key : 'monitored',
title : '',
tooltip : 'Monitored Only',
icon : 'icon-sonarr-monitored',
callback : this._setFilter
}
]
};
},
onRender : function() {
this._showToolbar();
this._showTable();
},
onClose : function() {
vent.trigger(vent.Commands.CloseControlPanelCommand);
},
_showTable : function() {
if (this.movieCollection.shadowCollection.length === 0) {
this.seriesRegion.show(new EmptyView());
this.toolbar.close();
return;
}
this.columns[0].sortedCollection = this.movieCollection;
this.editorGrid = new Backgrid.Grid({
collection : this.movieCollection,
columns : this.columns,
className : 'table table-hover'
});
this.seriesRegion.show(this.editorGrid);
this._showFooter();
},
_showToolbar : function() {
this.toolbar.show(new ToolbarLayout({
left : [
this.leftSideButtons
],
right : [
this.filteringOptions
],
context : this
}));
},
_showFooter : function() {
vent.trigger(vent.Commands.OpenControlPanelCommand, new FooterView({
editorGrid : this.editorGrid,
collection : this.movieCollection
}));
},
_setFilter : function(buttonContext) {
var mode = buttonContext.model.get('key');
this.movieCollection.setFilterMode(mode);
}
});
@@ -0,0 +1,7 @@
<div id="x-toolbar"></div>
<div class="row">
<div class="col-md-12">
<div id="x-series-editor" class="table-responsive"></div>
</div>
</div>
@@ -0,0 +1,33 @@
var _ = require('underscore');
var vent = require('vent');
var Backbone = require('backbone');
var Marionette = require('marionette');
var CommandController = require('../../../Commands/CommandController');
module.exports = Marionette.ItemView.extend({
template : 'Movies/Editor/Organize/OrganizeFilesViewTemplate',
events : {
'click .x-confirm-organize' : '_organize'
},
initialize : function(options) {
this.movies = options.movies;
this.templateHelpers = {
numberOfMovies : this.movies.length,
movies : new Backbone.Collection(this.movies).toJSON()
};
},
_organize : function() {
var movieIds = _.pluck(this.movies, 'id');
CommandController.Execute('renameMovie', {
name : 'renameMovie',
movieIds : movieIds
});
this.trigger('organizingFiles');
vent.trigger(vent.Commands.CloseModalCommand);
}
});
@@ -0,0 +1,25 @@
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Organize Selected Movies</h3>
</div>
<div class="modal-body update-files-series-modal">
<div class="alert alert-info">
<button type="button" class="close" data-dismiss="alert">&times;</button>
Tip: To preview a rename... select "Cancel" then any movie title and use the <i data-original-title="" class="icon-sonarr-rename" title=""></i>
</div>
Are you sure you want to update all files in the {{numberOfMovies}} selected movies?
{{debug}}
<ul class="selected-series">
{{#each movie}}
<li>{{title}}</li>
{{/each}}
</ul>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">Cancel</button>
<button class="btn btn-danger x-confirm-organize">Organize</button>
</div>
</div>
+9 -9
View File
@@ -1,24 +1,24 @@
<div class="row"> <div class="row">
<div class="series-legend legend col-xs-6 col-sm-4"> <div class="series-legend legend col-xs-6 col-sm-4">
<ul class='legend-labels'> <ul class='legend-labels'>
<li><span class="progress-bar"></span>Continuing (All episodes downloaded)</li> <li><span class="progress-bar"></span>Missing, but not yet available.</li>
<li><span class="progress-bar-success"></span>Ended (All episodes downloaded)</li> <li><span class="progress-bar-success"></span>Downloaded and imported.</li>
<li><span class="progress-bar-danger"></span>Missing Episodes (Series monitored)</li> <li><span class="progress-bar-danger"></span>Missing and monitored.</li>
<li><span class="progress-bar-warning"></span>Missing Episodes (Series not monitored)</li> <li><span class="progress-bar-warning"></span>Missing, but not monitored.</li>
</ul> </ul>
</div> </div>
<div class="col-xs-5 col-sm-7"> <div class="col-xs-5 col-sm-7">
<div class="row"> <div class="row">
<div class="series-stats col-sm-4"> <div class="series-stats col-sm-4">
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Series</dt> <dt>Movies</dt>
<dd>{{series}}</dd> <dd>{{series}}</dd>
<dt>Ended</dt> <dt>Released</dt>
<dd>{{ended}}</dd> <dd>{{released}}</dd>
<dt>Continuing</dt> <dt>Announced</dt>
<dd>{{continuing}}</dd> <dd>{{announced}}</dd>
</dl> </dl>
</div> </div>
+11 -16
View File
@@ -6,7 +6,7 @@ var ListCollectionView = require('./Overview/SeriesOverviewCollectionView');
var EmptyView = require('./EmptyView'); var EmptyView = require('./EmptyView');
var MoviesCollection = require('../MoviesCollection'); var MoviesCollection = require('../MoviesCollection');
var InCinemasCell = require('../../Cells/InCinemasCell'); var InCinemasCell = require('../../Cells/InCinemasCell');
var MovieTitleCell = require('../../Cells/MovieTitleCell2'); var MovieTitleCell = require('../../Cells/MovieTitleCell');
var TemplatedCell = require('../../Cells/TemplatedCell'); var TemplatedCell = require('../../Cells/TemplatedCell');
var ProfileCell = require('../../Cells/ProfileCell'); var ProfileCell = require('../../Cells/ProfileCell');
var MovieLinksCell = require('../../Cells/MovieLinksCell'); var MovieLinksCell = require('../../Cells/MovieLinksCell');
@@ -80,14 +80,9 @@ module.exports = Marionette.Layout.extend({
route : 'addmovies' route : 'addmovies'
}, },
{ {
title : 'Season Pass', title : 'Movie Editor',
icon : 'icon-sonarr-monitored',
route : 'seasonpass'
},
{
title : 'Series Editor',
icon : 'icon-sonarr-edit', icon : 'icon-sonarr-edit',
route : 'serieseditor' route : 'movieeditor'
}, },
{ {
title : 'RSS Sync', title : 'RSS Sync',
@@ -286,18 +281,18 @@ module.exports = Marionette.Layout.extend({
var series = MoviesCollection.models.length; var series = MoviesCollection.models.length;
var episodes = 0; var episodes = 0;
var episodeFiles = 0; var episodeFiles = 0;
var ended = 0; var announced = 0;
var continuing = 0; var released = 0;
var monitored = 0; var monitored = 0;
_.each(MoviesCollection.models, function(model) { _.each(MoviesCollection.models, function(model) {
episodes += model.get('episodeCount'); episodes += model.get('episodeCount');
episodeFiles += model.get('episodeFileCount'); episodeFiles += model.get('episodeFileCount');
if (model.get('status').toLowerCase() === 'ended') { if (model.get('status').toLowerCase() === 'released') {
ended++; released++;
} else { } else {
continuing++; announced++;
} }
if (model.get('monitored')) { if (model.get('monitored')) {
@@ -307,9 +302,9 @@ module.exports = Marionette.Layout.extend({
footerModel.set({ footerModel.set({
series : series, series : series,
ended : ended, released : released,
continuing : continuing, announced : announced,
monitored : monitored, monitored : monitored,
unmonitored : series - monitored, unmonitored : series - monitored,
episodes : episodes, episodes : episodes,
episodeFiles : episodeFiles episodeFiles : episodeFiles
@@ -41,7 +41,7 @@
{{profile profileId}} {{profile profileId}}
<span class="label label-{{DownloadedStatusColor}}">{{DownloadedStatus}}</span> <span class="label label-{{DownloadedStatusColor}}" title="{{DownloadedQuality}}">{{DownloadedStatus}}</span>
</div> </div>
<div class="col-md-4 col-xs-4"> <div class="col-md-4 col-xs-4">
<span class="movie-info-links"> <span class="movie-info-links">
+45 -10
View File
@@ -1,3 +1,38 @@
// var Backbone = require('backbone');
// var RenamePreviewModel = require('./RenamePreviewModel');
// module.exports = Backbone.Collection.extend({
// url : window.NzbDrone.ApiRoot + '/rename',
// model : RenamePreviewModel,
// originalFetch : Backbone.Collection.prototype.fetch,
// initialize : function(options) {
// if (!options.seriesId) {
// throw 'seriesId is required';
// }
// this.seriesId = options.seriesId;
// this.seasonNumber = options.seasonNumber;
// },
// fetch : function(options) {
// if (!this.seriesId) {
// throw 'seriesId is required';
// }
// options = options || {};
// options.data = {};
// options.data.seriesId = this.seriesId;
// if (this.seasonNumber !== undefined) {
// options.data.seasonNumber = this.seasonNumber;
// }
// return this.originalFetch.call(this, options);
// }
// });
var Backbone = require('backbone'); var Backbone = require('backbone');
var RenamePreviewModel = require('./RenamePreviewModel'); var RenamePreviewModel = require('./RenamePreviewModel');
@@ -8,26 +43,26 @@ module.exports = Backbone.Collection.extend({
originalFetch : Backbone.Collection.prototype.fetch, originalFetch : Backbone.Collection.prototype.fetch,
initialize : function(options) { initialize : function(options) {
if (!options.seriesId) { if (!options.movieId) {
throw 'seriesId is required'; throw 'movieId is required';
} }
this.seriesId = options.seriesId; this.movieId = options.movieId;
this.seasonNumber = options.seasonNumber; //this.seasonNumber = options.seasonNumber;
}, },
fetch : function(options) { fetch : function(options) {
if (!this.seriesId) { if (!this.movieId) {
throw 'seriesId is required'; throw 'movieId is required';
} }
options = options || {}; options = options || {};
options.data = {}; options.data = {};
options.data.seriesId = this.seriesId; options.data.movieId = this.movieId;
if (this.seasonNumber !== undefined) { // if (this.seasonNumber !== undefined) {
options.data.seasonNumber = this.seasonNumber; // options.data.seasonNumber = this.seasonNumber;
} //}
return this.originalFetch.call(this, options); return this.originalFetch.call(this, options);
} }
+11 -19
View File
@@ -29,12 +29,13 @@ module.exports = Marionette.Layout.extend({
}, },
initialize : function(options) { initialize : function(options) {
this.model = options.series; this.model = options.movie;
this.seasonNumber = options.seasonNumber; this.seasonNumber = options.seasonNumber;
var viewOptions = {}; var viewOptions = {};
viewOptions.seriesId = this.model.id; //viewOptions.seriesId = this.model.id;
viewOptions.seasonNumber = this.seasonNumber; //viewOptions.seasonNumber = this.seasonNumber;
viewOptions.movieId = this.model.id;
this.collection = new RenamePreviewCollection(viewOptions); this.collection = new RenamePreviewCollection(viewOptions);
this.listenTo(this.collection, 'sync', this._showPreviews); this.listenTo(this.collection, 'sync', this._showPreviews);
@@ -66,7 +67,8 @@ module.exports = Marionette.Layout.extend({
} }
var files = _.map(this.collection.where({ rename : true }), function(model) { var files = _.map(this.collection.where({ rename : true }), function(model) {
return model.get('episodeFileId'); //return model.get('episodeFileId');
return model.get('movieFileId');
}); });
if (files.length === 0) { if (files.length === 0) {
@@ -74,21 +76,11 @@ module.exports = Marionette.Layout.extend({
return; return;
} }
if (this.seasonNumber) { CommandController.Execute('renameMovieFiles', {
CommandController.Execute('renameFiles', { name : 'renameMovieFiles',
name : 'renameFiles', movieId : this.model.id,
seriesId : this.model.id, files : files
seasonNumber : this.seasonNumber, });
files : files
});
} else {
CommandController.Execute('renameFiles', {
name : 'renameFiles',
seriesId : this.model.id,
seasonNumber : -1,
files : files
});
}
vent.trigger(vent.Commands.CloseModalCommand); vent.trigger(vent.Commands.CloseModalCommand);
}, },
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = Marionette.AppRouter.extend({
'system' : 'system', 'system' : 'system',
'system/:action' : 'system', 'system/:action' : 'system',
'seasonpass' : 'seasonPass', 'seasonpass' : 'seasonPass',
'serieseditor' : 'seriesEditor', 'movieeditor' : 'movieEditor',
':whatever' : 'showNotFound' ':whatever' : 'showNotFound'
} }
}); });
@@ -2,11 +2,16 @@
<legend>More Info</legend> <legend>More Info</legend>
<dl class="dl-horizontal info"> <dl class="dl-horizontal info">
<dt>Home page</dt> <dt>Discord</dt>
<dd><a href="https://sonarr.tv/">sonarr.tv</a></dd> <dd><a href="https://discord.gg/AD3UP37">Radarr on Discord</a>
<dt>Reddit</dt>
<dd><a href="https://www.reddit.com/r/radarr/">Radarr Subreddit</a>
{{!--<dt>Home page</dt>
<dd><a href="https://radarr.tdb/">radarr.tdb</a></dd>
<dt>Wiki</dt> <dt>Wiki</dt>
<dd><a href="https://wiki.sonarr.tv/">wiki.sonarr.tv</a></dd> <dd><a href="https://wiki.radarr.tdb/">wiki.radarr.tdb</a></dd>
<dt>Forums</dt> <dt>Forums</dt>
<dd><a href="https://forums.sonarr.tv/">forums.sonarr.tv</a></dd> <dd><a href="https://forums.sonarr.tv/">forums.sonarr.tv</a></dd>
@@ -15,14 +20,13 @@
<dd><a href="https://twitter.com/sonarrtv">@sonarrtv</a></dd> <dd><a href="https://twitter.com/sonarrtv">@sonarrtv</a></dd>
<dt>IRC</dt> <dt>IRC</dt>
<dd><a href="irc://irc.freenode.net/#sonarr">#sonarr on Freenode</a> or (<a href="http://webchat.freenode.net/?channels=#sonarr">webchat</a>)</dd> <dd><a href="irc://irc.freenode.net/#sonarr">#sonarr on Freenode</a> or (<a href="http://webchat.freenode.net/?channels=#sonarr">webchat</a>)</dd>--}}
<dt>Source</dt> <dt>Source</dt>
<dd><a href="https://github.com/Sonarr/Sonarr/">github.com/Sonarr/Sonarr</a></dd> <dd><a href="https://github.com/Radarr/Radarr">Radarr on Github</a></dd>
<dt>Feature Requests</dt> <dt>Feature Requests</dt>
<dd><a href="https://forums.sonarr.tv/">forums.sonarr.tv</a></dd> <!--<dd><a href="https://forums.sonarr.tv/">forums.sonarr.tv</a></dd>-->
<dd><a href="https://github.com/Sonarr/Sonarr/issues">github.com/Sonarr/Sonarr/issues</a> <b>(Please post issues on the forum first and not on github)</b></dd> <dd><a href="https://github.com/Radarr/Radarr/issues">Github Issues</a></dd>
</dl> </dl>
</fieldset> </fieldset>
+3 -3
View File
@@ -131,7 +131,7 @@ module.exports = Marionette.Layout.extend({
}); });
Messenger.show({ Messenger.show({
message : 'Sonarr will shutdown shortly', message : 'Radarr will shutdown shortly',
type : 'info' type : 'info'
}); });
}, },
@@ -143,8 +143,8 @@ module.exports = Marionette.Layout.extend({
}); });
Messenger.show({ Messenger.show({
message : 'Sonarr will restart shortly', message : 'Radarr will restart shortly',
type : 'info' type : 'info'
}); });
} }
}); });