From 997ff74fb96ea5d2d481682bbd8fe94783b41266 Mon Sep 17 00:00:00 2001 From: ta264 Date: Sun, 22 Dec 2019 21:24:10 +0000 Subject: [PATCH] Replace tabs with 4 spaces --- src/Marr.Data/QGen/RowCountQueryDecorator.cs | 10 +- src/Marr.Data/QGen/WhereBuilder.cs | 2 +- .../Reflection/SimpleReflectionStrategy.cs | 2 +- src/MonoTorrent/ToolBox.cs | 32 ++-- src/MonoTorrent/Torrent.cs | 22 +-- .../Config/IndexerConfigResource.cs | 12 +- .../Movies/MovieBulkImportModule.cs | 112 +++++------ src/NzbDrone.Api/Movies/MovieResource.cs | 6 +- src/NzbDrone.Common/TinyIoC.cs | 172 ++++++++--------- .../BulkImport/AddMultiMoviesFixture.cs | 96 +++++----- .../PrioritizeDownloadDecisionFixture.cs | 78 ++++---- .../RssSync/DelaySpecificationFixture.cs | 12 +- .../CompletedDownloadServiceFixture.cs | 10 +- .../DownloadApprovedFixture.cs | 46 ++--- .../SabnzbdTests/SabnzbdFixture.cs | 2 +- .../PendingReleaseServiceTests/AddFixture.cs | 4 +- .../RemoveRejectedFixture.cs | 4 +- .../TrackedDownloadServiceFixture.cs | 4 +- .../CleanupOrphanedHistoryItemsFixture.cs | 2 +- .../FixFutureRunScheduledTasksFixture.cs | 2 +- .../NewznabRequestGeneratorFixture.cs | 4 +- .../MovieImport/ImportDecisionMakerFixture.cs | 2 +- .../MovieServiceTests/AddMovieFixture.cs | 42 ++-- .../ParserTests/ParserFixture.cs | 36 ++-- .../ParsingServiceTests/MapFixture.cs | 98 +++++----- .../ParserTests/PathParserFixture.cs | 2 +- .../ParserTests/QualityParserFixture.cs | 12 +- .../RootFolderServiceFixture.cs | 20 +- .../UpdateTests/UpdateServiceFixture.cs | 2 +- .../Configuration/IConfigService.cs | 10 +- .../131_make_parsed_episode_info_nullable.cs | 6 +- .../Migration/133_add_minimumavailability.cs | 8 +- .../135_add_haspredbentry_to_movies.cs | 2 +- .../Migration/136_add_pathstate_to_movies.cs | 2 +- .../138_add_physical_release_note.cs | 2 +- .../DecisionEngine/DownloadDecisionMaker.cs | 4 +- .../AcceptableSizeSpecification.cs | 8 +- .../Download/CompletedDownloadService.cs | 4 +- .../Download/Pending/PendingReleaseService.cs | 22 +-- .../Housekeepers/CleanupAdditionalUsers.cs | 20 +- .../FixWronglyMatchedMovieFiles.cs | 34 ++-- .../PassThePopcorn/PassThePopcornParser.cs | 4 +- .../Indexers/Torznab/TorznabRssParser.cs | 12 +- .../Commands/RenameMovieFolderCommand.cs | 2 +- .../MediaFiles/DiskScanService.cs | 6 +- .../MediaFiles/MovieFileMovingService.cs | 2 +- .../MediaFiles/RenameMovieFileService.cs | 82 ++++---- .../MediaFiles/UpgradeMediaFileService.cs | 14 +- .../MetadataSource/PreDB/PreDBService.cs | 96 +++++----- .../MetadataSource/SkyHook/SkyHookProxy.cs | 180 +++++++++--------- .../AlternativeTitleRepository.cs | 4 +- src/NzbDrone.Core/Movies/Movie.cs | 22 +-- src/NzbDrone.Core/Movies/MovieRepository.cs | 30 +-- src/NzbDrone.Core/Movies/MovieService.cs | 30 +-- .../NetImport/HttpNetImportBase.cs | 2 +- .../ImportExclusionsRepository.cs | 4 +- .../NetImport/NetImportSearchService.cs | 2 +- .../NetImport/Trakt/TraktRequestGenerator.cs | 4 +- .../NotifyMyAndroid/NotifyMyAndroid.cs | 2 +- .../Notifications/Pushalot/Pushalot.cs | 2 +- .../Organizer/FileNameBuilder.cs | 10 +- src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs | 28 +-- src/NzbDrone.Core/Parser/Parser.cs | 70 +++---- .../RootFolders/RootFolderService.cs | 2 +- src/NzbDrone.Host.Test/ContainerFixture.cs | 2 +- src/NzbDrone.Host/CancelHandler.cs | 4 +- .../Config/IndexerConfigResource.cs | 12 +- .../Config/NetImportConfigResource.cs | 8 +- src/Radarr.Api.V3/Movies/MovieResource.cs | 6 +- 69 files changed, 806 insertions(+), 806 deletions(-) diff --git a/src/Marr.Data/QGen/RowCountQueryDecorator.cs b/src/Marr.Data/QGen/RowCountQueryDecorator.cs index f7c225389..384620a5c 100644 --- a/src/Marr.Data/QGen/RowCountQueryDecorator.cs +++ b/src/Marr.Data/QGen/RowCountQueryDecorator.cs @@ -110,11 +110,11 @@ private Table GetBaseTable() /* WITH GroupCTE AS ( - SELECT [t0].[ID],[t0].[OrderName],[t1].[ID] AS OrderItemID,[t1].[OrderID],[t1].[ItemDescription],[t1].[Price], - ROW_NUMBER() OVER (PARTITION BY [t0].[ID] ORDER BY [t0].[OrderName]) As GroupRow - FROM [Order] [t0] - LEFT JOIN [OrderItem] [t1] ON (([t0].[ID] = [t1].[OrderID])) - --WHERE (([t0].[OrderName] = @P0)) + SELECT [t0].[ID],[t0].[OrderName],[t1].[ID] AS OrderItemID,[t1].[OrderID],[t1].[ItemDescription],[t1].[Price], + ROW_NUMBER() OVER (PARTITION BY [t0].[ID] ORDER BY [t0].[OrderName]) As GroupRow + FROM [Order] [t0] + LEFT JOIN [OrderItem] [t1] ON (([t0].[ID] = [t1].[OrderID])) + --WHERE (([t0].[OrderName] = @P0)) ) SELECT * FROM GroupCTE WHERE GroupRow = 1 diff --git a/src/Marr.Data/QGen/WhereBuilder.cs b/src/Marr.Data/QGen/WhereBuilder.cs index 0a7c217f7..0b5d9c49e 100644 --- a/src/Marr.Data/QGen/WhereBuilder.cs +++ b/src/Marr.Data/QGen/WhereBuilder.cs @@ -148,7 +148,7 @@ protected override Expression VisitConstant(ConstantExpression expression) private object GetRightValue(Expression expression) { object rightValue = null; - + var simpleConstExp = expression as ConstantExpression; if (simpleConstExp == null) // Value is not directly passed in as a constant { diff --git a/src/Marr.Data/Reflection/SimpleReflectionStrategy.cs b/src/Marr.Data/Reflection/SimpleReflectionStrategy.cs index 9e741b013..afc38e97d 100644 --- a/src/Marr.Data/Reflection/SimpleReflectionStrategy.cs +++ b/src/Marr.Data/Reflection/SimpleReflectionStrategy.cs @@ -114,7 +114,7 @@ private static GetterDelegate GetPropertyGetter(PropertyInfo propertyInfo) if (getMethodInfo == null) return null; #if NO_EXPRESSIONS - return o => propertyInfo.GetGetMethod().Invoke(o, new object[] { }); + return o => propertyInfo.GetGetMethod().Invoke(o, new object[] { }); #else try { diff --git a/src/MonoTorrent/ToolBox.cs b/src/MonoTorrent/ToolBox.cs index 227977a7b..a22c1a5a2 100644 --- a/src/MonoTorrent/ToolBox.cs +++ b/src/MonoTorrent/ToolBox.cs @@ -4,31 +4,31 @@ namespace MonoTorrent { - public delegate long Operation(T target); + public delegate long Operation(T target); public static class Toolbox { private static Random r = new Random(); - public static int Count(IEnumerable enumerable, Predicate predicate) - { - int count = 0; + public static int Count(IEnumerable enumerable, Predicate predicate) + { + int count = 0; - foreach (T t in enumerable) - if (predicate(t)) - count++; + foreach (T t in enumerable) + if (predicate(t)) + count++; - return count; - } + return count; + } - public static long Accumulate(IEnumerable enumerable, Operation action) - { + public static long Accumulate(IEnumerable enumerable, Operation action) + { long count = 0; - foreach (T t in enumerable) - count += action(t); - - return count; - } + foreach (T t in enumerable) + count += action(t); + + return count; + } public static void RaiseAsyncEvent(EventHandler e, object o, T args) where T : EventArgs diff --git a/src/MonoTorrent/Torrent.cs b/src/MonoTorrent/Torrent.cs index 726131f94..1ccfc19ae 100644 --- a/src/MonoTorrent/Torrent.cs +++ b/src/MonoTorrent/Torrent.cs @@ -62,17 +62,17 @@ public IList AnnounceUrls /// /// This dictionary is specific for azureus client /// It can contain - /// dht_backup_enable (number) - /// Content (dictionnary) - /// Publisher - /// Description - /// Title - /// Creation Date - /// Content Hash - /// Revision Date - /// Thumbnail (string) = Base64 encoded image - /// Progressive - /// Speed Bps (number) + /// dht_backup_enable (number) + /// Content (dictionnary) + /// Publisher + /// Description + /// Title + /// Creation Date + /// Content Hash + /// Revision Date + /// Thumbnail (string) = Base64 encoded image + /// Progressive + /// Speed Bps (number) /// but not useful for MT /// public BEncodedValue AzureusProperties diff --git a/src/NzbDrone.Api/Config/IndexerConfigResource.cs b/src/NzbDrone.Api/Config/IndexerConfigResource.cs index 854ea6b51..71264e988 100644 --- a/src/NzbDrone.Api/Config/IndexerConfigResource.cs +++ b/src/NzbDrone.Api/Config/IndexerConfigResource.cs @@ -11,9 +11,9 @@ public class IndexerConfigResource : RestResource public int Retention { get; set; } public int RssSyncInterval { get; set; } public bool PreferIndexerFlags { get; set; } - public int AvailabilityDelay { get; set; } - public bool AllowHardcodedSubs { get; set; } - public string WhitelistedHardcodedSubs { get; set; } + public int AvailabilityDelay { get; set; } + public bool AllowHardcodedSubs { get; set; } + public string WhitelistedHardcodedSubs { get; set; } public ParsingLeniencyType ParsingLeniency { get; set; } } @@ -28,9 +28,9 @@ public static IndexerConfigResource ToResource(IConfigService model) Retention = model.Retention, RssSyncInterval = model.RssSyncInterval, PreferIndexerFlags = model.PreferIndexerFlags, - AvailabilityDelay = model.AvailabilityDelay, - AllowHardcodedSubs = model.AllowHardcodedSubs, - WhitelistedHardcodedSubs = model.WhitelistedHardcodedSubs, + AvailabilityDelay = model.AvailabilityDelay, + AllowHardcodedSubs = model.AllowHardcodedSubs, + WhitelistedHardcodedSubs = model.WhitelistedHardcodedSubs, ParsingLeniency = model.ParsingLeniency, }; } diff --git a/src/NzbDrone.Api/Movies/MovieBulkImportModule.cs b/src/NzbDrone.Api/Movies/MovieBulkImportModule.cs index 81a04fa0d..7c29f8467 100644 --- a/src/NzbDrone.Api/Movies/MovieBulkImportModule.cs +++ b/src/NzbDrone.Api/Movies/MovieBulkImportModule.cs @@ -34,14 +34,14 @@ public class MovieBulkImportModule : RadarrRestModule private readonly IRootFolderService _rootFolderService; private readonly IMakeImportDecision _importDecisionMaker; private readonly IDiskScanService _diskScanService; - private readonly ICached _mappedMovies; + private readonly ICached _mappedMovies; private readonly IParsingService _parsingService; private readonly IProfileService _profileService; private readonly IMovieService _movieService; public MovieBulkImportModule(ISearchForNewMovie searchProxy, IRootFolderService rootFolderService, IMakeImportDecision importDecisionMaker, - IDiskScanService diskScanService, ICacheManager cacheManager, + IDiskScanService diskScanService, ICacheManager cacheManager, IParsingService parsingService, IProfileService profileService, IMovieService movieService) : base("/movies/bulkimport") { @@ -49,7 +49,7 @@ public MovieBulkImportModule(ISearchForNewMovie searchProxy, IRootFolderService _rootFolderService = rootFolderService; _importDecisionMaker = importDecisionMaker; _diskScanService = diskScanService; - _mappedMovies = cacheManager.GetCache(GetType(), "mappedMoviesCache"); + _mappedMovies = cacheManager.GetCache(GetType(), "mappedMoviesCache"); _movieService = movieService; _profileService = profileService; _parsingService = parsingService; @@ -89,73 +89,73 @@ private object Search() var paged = unmapped.GetRange(min, max-min); var mapped = paged.Select(f => - { - Core.Movies.Movie m = null; + { + Core.Movies.Movie m = null; - var mappedMovie = _mappedMovies.Find(f.Name); + var mappedMovie = _mappedMovies.Find(f.Name); - if (mappedMovie != null) - { - return mappedMovie; - } + if (mappedMovie != null) + { + return mappedMovie; + } - var parsedTitle = _parsingService.ParseMinimalPathMovieInfo(f.Name); - if (parsedTitle == null) - { - m = new Core.Movies.Movie - { - Title = f.Name.Replace(".", " ").Replace("-", " "), - Path = f.Path, - Profile = tempProfile - }; - } - else - { - parsedTitle.ImdbId = Parser.ParseImdbId(parsedTitle.SimpleReleaseTitle); + var parsedTitle = _parsingService.ParseMinimalPathMovieInfo(f.Name); + if (parsedTitle == null) + { + m = new Core.Movies.Movie + { + Title = f.Name.Replace(".", " ").Replace("-", " "), + Path = f.Path, + Profile = tempProfile + }; + } + else + { + parsedTitle.ImdbId = Parser.ParseImdbId(parsedTitle.SimpleReleaseTitle); - m = new Core.Movies.Movie - { - Title = parsedTitle.MovieTitle, - Year = parsedTitle.Year, - ImdbId = parsedTitle.ImdbId, - Path = f.Path, - Profile = tempProfile - }; - } + m = new Core.Movies.Movie + { + Title = parsedTitle.MovieTitle, + Year = parsedTitle.Year, + ImdbId = parsedTitle.ImdbId, + Path = f.Path, + Profile = tempProfile + }; + } - var files = _diskScanService.GetVideoFiles(f.Path); + var files = _diskScanService.GetVideoFiles(f.Path); - var decisions = _importDecisionMaker.GetImportDecisions(files.ToList(), m); + var decisions = _importDecisionMaker.GetImportDecisions(files.ToList(), m); - var decision = decisions.Where(d => d.Approved && !d.Rejections.Any()).FirstOrDefault(); + var decision = decisions.Where(d => d.Approved && !d.Rejections.Any()).FirstOrDefault(); - if (decision != null) - { - var local = decision.LocalMovie; + if (decision != null) + { + var local = decision.LocalMovie; - m.MovieFile = new MovieFile - { - Path = local.Path, - Edition = local.Edition, - Quality = local.Quality, - MediaInfo = local.MediaInfo, - ReleaseGroup = local.ReleaseGroup, - RelativePath = f.Path.GetRelativePath(local.Path) - }; - } + m.MovieFile = new MovieFile + { + Path = local.Path, + Edition = local.Edition, + Quality = local.Quality, + MediaInfo = local.MediaInfo, + ReleaseGroup = local.ReleaseGroup, + RelativePath = f.Path.GetRelativePath(local.Path) + }; + } - mappedMovie = _searchProxy.MapMovieToTmdbMovie(m); + mappedMovie = _searchProxy.MapMovieToTmdbMovie(m); - if (mappedMovie != null) - { - mappedMovie.Monitored = true; + if (mappedMovie != null) + { + mappedMovie.Monitored = true; - _mappedMovies.Set(f.Name, mappedMovie, TimeSpan.FromDays(2)); + _mappedMovies.Set(f.Name, mappedMovie, TimeSpan.FromDays(2)); - return mappedMovie; - } + return mappedMovie; + } - return null; + return null; }); return new PagingResource diff --git a/src/NzbDrone.Api/Movies/MovieResource.cs b/src/NzbDrone.Api/Movies/MovieResource.cs index 6d3f86f11..8baf81f7f 100644 --- a/src/NzbDrone.Api/Movies/MovieResource.cs +++ b/src/NzbDrone.Api/Movies/MovieResource.cs @@ -47,7 +47,7 @@ public MovieResource() //Editing Only public bool Monitored { get; set; } - public MovieStatusType MinimumAvailability { get; set; } + public MovieStatusType MinimumAvailability { get; set; } public bool IsAvailable { get; set; } public string FolderName { get; set; } @@ -145,7 +145,7 @@ public static MovieResource ToResource(this Core.Movies.Movie model) Monitored = model.Monitored, MinimumAvailability = model.MinimumAvailability, - + IsAvailable = model.IsAvailable(), FolderName = model.FolderName(), @@ -205,7 +205,7 @@ public static Core.Movies.Movie ToModel(this MovieResource resource) Monitored = resource.Monitored, MinimumAvailability = resource.MinimumAvailability, - + Runtime = resource.Runtime, LastInfoSync = resource.LastInfoSync, CleanTitle = resource.CleanTitle, diff --git a/src/NzbDrone.Common/TinyIoC.cs b/src/NzbDrone.Common/TinyIoC.cs index 7c5d7196f..5572b71ab 100644 --- a/src/NzbDrone.Common/TinyIoC.cs +++ b/src/NzbDrone.Common/TinyIoC.cs @@ -81,10 +81,10 @@ namespace TinyIoC #endif #if NETFX_CORE - using System.Threading.Tasks; - using Windows.Storage.Search; + using System.Threading.Tasks; + using Windows.Storage.Search; using Windows.Storage; - using Windows.UI.Xaml.Shapes; + using Windows.UI.Xaml.Shapes; #endif #region SafeDictionary @@ -322,32 +322,32 @@ static TypeExtensions() } //#if NETFX_CORE - // /// - // /// Gets a generic method from a type given the method name, generic types and parameter types - // /// - // /// Source type - // /// Name of the method - // /// Generic types to use to make the method generic - // /// Method parameters - // /// MethodInfo or null if no matches found - // /// - // /// - // public static MethodInfo GetGenericMethod(this Type sourceType, string methodName, Type[] genericTypes, Type[] parameterTypes) - // { - // MethodInfo method; - // var cacheKey = new GenericMethodCacheKey(sourceType, methodName, genericTypes, parameterTypes); + // /// + // /// Gets a generic method from a type given the method name, generic types and parameter types + // /// + // /// Source type + // /// Name of the method + // /// Generic types to use to make the method generic + // /// Method parameters + // /// MethodInfo or null if no matches found + // /// + // /// + // public static MethodInfo GetGenericMethod(this Type sourceType, string methodName, Type[] genericTypes, Type[] parameterTypes) + // { + // MethodInfo method; + // var cacheKey = new GenericMethodCacheKey(sourceType, methodName, genericTypes, parameterTypes); - // // Shouldn't need any additional locking - // // we don't care if we do the method info generation - // // more than once before it gets cached. - // if (!_genericMethodCache.TryGetValue(cacheKey, out method)) - // { - // method = GetMethod(sourceType, methodName, genericTypes, parameterTypes); - // _genericMethodCache[cacheKey] = method; - // } + // // Shouldn't need any additional locking + // // we don't care if we do the method info generation + // // more than once before it gets cached. + // if (!_genericMethodCache.TryGetValue(cacheKey, out method)) + // { + // method = GetMethod(sourceType, methodName, genericTypes, parameterTypes); + // _genericMethodCache[cacheKey] = method; + // } - // return method; - // } + // return method; + // } //#else /// /// Gets a generic method from a type given the method name, binding flags, generic types and parameter types @@ -514,14 +514,14 @@ private int GenerateHashCode() // @mbrit - 2012-05-22 - shim for ForEach call on List... #if NETFX_CORE - internal static class ListExtender - { - internal static void ForEach(this List list, Action callback) - { - foreach (T obj in list) - callback(obj); - } - } + internal static class ListExtender + { + internal static void ForEach(this List list, Action callback) + { + foreach (T obj in list) + callback(obj); + } + } #endif #endregion @@ -771,33 +771,33 @@ static AppDomain() CurrentDomain = new AppDomain(); } - // @mbrit - 2012-05-30 - in WinRT, this should be done async... + // @mbrit - 2012-05-30 - in WinRT, this should be done async... public async Task> GetAssembliesAsync() { var folder = Windows.ApplicationModel.Package.Current.InstalledLocation; List assemblies = new List(); - var files = await folder.GetFilesAsync(); + var files = await folder.GetFilesAsync(); foreach (StorageFile file in files) { if (file.FileType == ".dll" || file.FileType == ".exe") { AssemblyName name = new AssemblyName() { Name = System.IO.Path.GetFileNameWithoutExtension(file.Name) }; - try - { - var asm = Assembly.Load(name); - assemblies.Add(asm); - } - catch - { - // ignore exceptions here... - } + try + { + var asm = Assembly.Load(name); + assemblies.Add(asm); + } + catch + { + // ignore exceptions here... + } } } - return assemblies; + return assemblies; } } #endif @@ -1387,7 +1387,7 @@ public MultiRegisterOptions RegisterMultiple(Type registrationType, IEnumerable< foreach (var type in implementationTypes) //#if NETFX_CORE - // if (!registrationType.GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) + // if (!registrationType.GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())) //#else if (!registrationType.IsAssignableFrom(type)) //#endif @@ -2446,8 +2446,8 @@ private class MultiInstanceFactory : ObjectFactoryBase public MultiInstanceFactory(Type registerType, Type registerImplementation) { //#if NETFX_CORE - // if (registerImplementation.GetTypeInfo().IsAbstract() || registerImplementation.GetTypeInfo().IsInterface()) - // throw new TinyIoCRegistrationTypeException(registerImplementation, "MultiInstanceFactory"); + // if (registerImplementation.GetTypeInfo().IsAbstract() || registerImplementation.GetTypeInfo().IsInterface()) + // throw new TinyIoCRegistrationTypeException(registerImplementation, "MultiInstanceFactory"); //#else if (registerImplementation.IsAbstract() || registerImplementation.IsInterface()) throw new TinyIoCRegistrationTypeException(registerImplementation, "MultiInstanceFactory"); @@ -2713,7 +2713,7 @@ private class SingletonFactory : ObjectFactoryBase, IDisposable public SingletonFactory(Type registerType, Type registerImplementation) { //#if NETFX_CORE - // if (registerImplementation.GetTypeInfo().IsAbstract() || registerImplementation.GetTypeInfo().IsInterface()) + // if (registerImplementation.GetTypeInfo().IsAbstract() || registerImplementation.GetTypeInfo().IsInterface()) //#else if (registerImplementation.IsAbstract() || registerImplementation.IsInterface()) //#endif @@ -2789,7 +2789,7 @@ public CustomObjectLifetimeFactory(Type registerType, Type registerImplementatio throw new TinyIoCRegistrationTypeException(registerImplementation, "SingletonFactory"); //#if NETFX_CORE - // if (registerImplementation.GetTypeInfo().IsAbstract() || registerImplementation.GetTypeInfo().IsInterface()) + // if (registerImplementation.GetTypeInfo().IsAbstract() || registerImplementation.GetTypeInfo().IsInterface()) //#else if (registerImplementation.IsAbstract() || registerImplementation.IsInterface()) //#endif @@ -3093,7 +3093,7 @@ private void RemoveRegistration(TypeRegistration typeRegistration) private ObjectFactoryBase GetDefaultObjectFactory(Type registerType, Type registerImplementation) { //#if NETFX_CORE - // if (registerType.GetTypeInfo().IsInterface() || registerType.GetTypeInfo().IsAbstract()) + // if (registerType.GetTypeInfo().IsInterface() || registerType.GetTypeInfo().IsAbstract()) //#else if (registerType.IsInterface() || registerType.IsAbstract()) //#endif @@ -3185,7 +3185,7 @@ private bool IsAutomaticLazyFactoryRequest(Type type) // 2 parameter func with string as first parameter (name) //#if NETFX_CORE - // if ((genericType == typeof(Func<,>) && type.GetTypeInfo().GenericTypeArguments[0] == typeof(string))) + // if ((genericType == typeof(Func<,>) && type.GetTypeInfo().GenericTypeArguments[0] == typeof(string))) //#else if ((genericType == typeof(Func<,>) && type.GetGenericArguments()[0] == typeof(string))) //#endif @@ -3193,7 +3193,7 @@ private bool IsAutomaticLazyFactoryRequest(Type type) // 3 parameter func with string as first parameter (name) and IDictionary as second (parameters) //#if NETFX_CORE - // if ((genericType == typeof(Func<,,>) && type.GetTypeInfo().GenericTypeArguments[0] == typeof(string) && type.GetTypeInfo().GenericTypeArguments[1] == typeof(IDictionary))) + // if ((genericType == typeof(Func<,,>) && type.GetTypeInfo().GenericTypeArguments[0] == typeof(string) && type.GetTypeInfo().GenericTypeArguments[1] == typeof(IDictionary))) //#else if ((genericType == typeof(Func<,,>) && type.GetGenericArguments()[0] == typeof(string) && type.GetGenericArguments()[1] == typeof(IDictionary))) //#endif @@ -3331,7 +3331,7 @@ private object GetLazyAutomaticFactoryRequest(Type type) Type genericType = type.GetGenericTypeDefinition(); //#if NETFX_CORE - // Type[] genericArguments = type.GetTypeInfo().GenericTypeArguments.ToArray(); + // Type[] genericArguments = type.GetTypeInfo().GenericTypeArguments.ToArray(); //#else Type[] genericArguments = type.GetGenericArguments(); //#endif @@ -3342,7 +3342,7 @@ private object GetLazyAutomaticFactoryRequest(Type type) Type returnType = genericArguments[0]; //#if NETFX_CORE - // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => !mi.GetParameters().Any()); + // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => !mi.GetParameters().Any()); //#else MethodInfo resolveMethod = typeof(TinyIoCContainer).GetMethod("Resolve", new Type[] { }); //#endif @@ -3361,7 +3361,7 @@ private object GetLazyAutomaticFactoryRequest(Type type) Type returnType = genericArguments[1]; //#if NETFX_CORE - // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => mi.GetParameters().Length == 1 && mi.GetParameters()[0].GetType() == typeof(String)); + // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => mi.GetParameters().Length == 1 && mi.GetParameters()[0].GetType() == typeof(String)); //#else MethodInfo resolveMethod = typeof(TinyIoCContainer).GetMethod("Resolve", new Type[] { typeof(string) }); //#endif @@ -3377,7 +3377,7 @@ private object GetLazyAutomaticFactoryRequest(Type type) // 3 parameter func with string as first parameter (name) and IDictionary as second (parameters) //#if NETFX_CORE - // if ((genericType == typeof(Func<,,>) && type.GenericTypeArguments[0] == typeof(string) && type.GenericTypeArguments[1] == typeof(IDictionary))) + // if ((genericType == typeof(Func<,,>) && type.GenericTypeArguments[0] == typeof(string) && type.GenericTypeArguments[1] == typeof(IDictionary))) //#else if ((genericType == typeof(Func<,,>) && type.GetGenericArguments()[0] == typeof(string) && type.GetGenericArguments()[1] == typeof(IDictionary))) //#endif @@ -3388,7 +3388,7 @@ private object GetLazyAutomaticFactoryRequest(Type type) var parameters = Expression.Parameter(typeof(IDictionary), "parameters"); //#if NETFX_CORE - // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => mi.GetParameters().Length == 2 && mi.GetParameters()[0].GetType() == typeof(String) && mi.GetParameters()[1].GetType() == typeof(NamedParameterOverloads)); + // MethodInfo resolveMethod = typeof(TinyIoCContainer).GetTypeInfo().GetDeclaredMethods("Resolve").First(mi => mi.GetParameters().Length == 2 && mi.GetParameters()[0].GetType() == typeof(String) && mi.GetParameters()[1].GetType() == typeof(NamedParameterOverloads)); //#else MethodInfo resolveMethod = typeof(TinyIoCContainer).GetMethod("Resolve", new Type[] { typeof(string), typeof(NamedParameterOverloads) }); //#endif @@ -3407,7 +3407,7 @@ private object GetLazyAutomaticFactoryRequest(Type type) private object GetIEnumerableRequest(Type type) { //#if NETFX_CORE - // var genericResolveAllMethod = this.GetType().GetGenericMethod("ResolveAll", type.GenericTypeArguments, new[] { typeof(bool) }); + // var genericResolveAllMethod = this.GetType().GetGenericMethod("ResolveAll", type.GenericTypeArguments, new[] { typeof(bool) }); //#else var genericResolveAllMethod = this.GetType().GetGenericMethod(BindingFlags.Public | BindingFlags.Instance, "ResolveAll", type.GetGenericArguments(), new[] { typeof(bool) }); //#endif @@ -3428,7 +3428,7 @@ private bool CanConstruct(ConstructorInfo ctor, NamedParameterOverloads paramete var isParameterOverload = parameters.ContainsKey(parameter.Name); //#if NETFX_CORE - // if (parameter.ParameterType.GetTypeInfo().IsPrimitive && !isParameterOverload) + // if (parameter.ParameterType.GetTypeInfo().IsPrimitive && !isParameterOverload) //#else if (parameter.ParameterType.IsPrimitive() && !isParameterOverload) //#endif @@ -3447,7 +3447,7 @@ private ConstructorInfo GetBestConstructor(Type type, NamedParameterOverloads pa throw new ArgumentNullException("parameters"); //#if NETFX_CORE - // if (type.GetTypeInfo().IsValueType) + // if (type.GetTypeInfo().IsValueType) //#else if (type.IsValueType()) //#endif @@ -3469,7 +3469,7 @@ private ConstructorInfo GetBestConstructor(Type type, NamedParameterOverloads pa private IEnumerable GetTypeConstructors(Type type) { //#if NETFX_CORE - // return type.GetTypeInfo().DeclaredConstructors.OrderByDescending(ctor => ctor.GetParameters().Count()); + // return type.GetTypeInfo().DeclaredConstructors.OrderByDescending(ctor => ctor.GetParameters().Count()); //#else return type.GetConstructors().OrderByDescending(ctor => ctor.GetParameters().Count()); //#endif @@ -3605,9 +3605,9 @@ private static ObjectConstructor CreateObjectConstructionDelegateWithCache(Const private void BuildUpInternal(object input, ResolveOptions resolveOptions) { //#if NETFX_CORE - // var properties = from property in input.GetType().GetTypeInfo().DeclaredProperties - // where (property.GetMethod != null) && (property.SetMethod != null) && !property.PropertyType.GetTypeInfo().IsValueType - // select property; + // var properties = from property in input.GetType().GetTypeInfo().DeclaredProperties + // where (property.GetMethod != null) && (property.SetMethod != null) && !property.PropertyType.GetTypeInfo().IsValueType + // select property; //#else var properties = from property in input.GetType().GetProperties() where (property.GetGetMethod() != null) && (property.GetSetMethod() != null) && !property.PropertyType.IsValueType() @@ -3653,26 +3653,26 @@ private IEnumerable ResolveAllInternal(Type resolveType, bool includeUnn private static bool IsValidAssignment(Type registerType, Type registerImplementation) { //#if NETFX_CORE - // var registerTypeDef = registerType.GetTypeInfo(); - // var registerImplementationDef = registerImplementation.GetTypeInfo(); + // var registerTypeDef = registerType.GetTypeInfo(); + // var registerImplementationDef = registerImplementation.GetTypeInfo(); - // if (!registerTypeDef.IsGenericTypeDefinition) - // { - // if (!registerTypeDef.IsAssignableFrom(registerImplementationDef)) - // return false; - // } - // else - // { - // if (registerTypeDef.IsInterface()) - // { - // if (!registerImplementationDef.ImplementedInterfaces.Any(t => t.GetTypeInfo().Name == registerTypeDef.Name)) - // return false; - // } - // else if (registerTypeDef.IsAbstract() && registerImplementationDef.BaseType() != registerType) - // { - // return false; - // } - // } + // if (!registerTypeDef.IsGenericTypeDefinition) + // { + // if (!registerTypeDef.IsAssignableFrom(registerImplementationDef)) + // return false; + // } + // else + // { + // if (registerTypeDef.IsInterface()) + // { + // if (!registerImplementationDef.ImplementedInterfaces.Any(t => t.GetTypeInfo().Name == registerTypeDef.Name)) + // return false; + // } + // else if (registerTypeDef.IsAbstract() && registerImplementationDef.BaseType() != registerType) + // { + // return false; + // } + // } //#else if (!registerType.IsGenericTypeDefinition()) { diff --git a/src/NzbDrone.Core.Test/BulkImport/AddMultiMoviesFixture.cs b/src/NzbDrone.Core.Test/BulkImport/AddMultiMoviesFixture.cs index fcad2a48e..daa94367f 100644 --- a/src/NzbDrone.Core.Test/BulkImport/AddMultiMoviesFixture.cs +++ b/src/NzbDrone.Core.Test/BulkImport/AddMultiMoviesFixture.cs @@ -10,66 +10,66 @@ namespace NzbDrone.Core.Test.BulkImport { - [TestFixture] - public class AddMultiMoviesFixture : CoreTest - { - private List fakeMovies; + [TestFixture] + public class AddMultiMoviesFixture : CoreTest + { + private List fakeMovies; - [SetUp] - public void Setup() - { - fakeMovies = Builder.CreateListOfSize(3).BuildList(); - fakeMovies.ForEach(m => - { - m.Path = null; - m.RootFolderPath = @"C:\Test\TV"; - }); - } + [SetUp] + public void Setup() + { + fakeMovies = Builder.CreateListOfSize(3).BuildList(); + fakeMovies.ForEach(m => + { + m.Path = null; + m.RootFolderPath = @"C:\Test\TV"; + }); + } - [Test] - public void movies_added_event_should_have_proper_path() - { - Mocker.GetMock() - .Setup(s => s.GetMovieFolder(It.IsAny(), null)) - .Returns((Movie m, NamingConfig n) => m.Title); + [Test] + public void movies_added_event_should_have_proper_path() + { + Mocker.GetMock() + .Setup(s => s.GetMovieFolder(It.IsAny(), null)) + .Returns((Movie m, NamingConfig n) => m.Title); - var movies = Subject.AddMovies(fakeMovies); + var movies = Subject.AddMovies(fakeMovies); - foreach (Movie movie in movies) - { - movie.Path.Should().NotBeNullOrEmpty(); - } + foreach (Movie movie in movies) + { + movie.Path.Should().NotBeNullOrEmpty(); + } - //Subject.GetAllMovies().Should().HaveCount(3); - } + //Subject.GetAllMovies().Should().HaveCount(3); + } - [Test] - public void movies_added_should_ignore_already_added() - { - Mocker.GetMock() - .Setup(s => s.GetMovieFolder(It.IsAny(), null)) - .Returns((Movie m, NamingConfig n) => m.Title); + [Test] + public void movies_added_should_ignore_already_added() + { + Mocker.GetMock() + .Setup(s => s.GetMovieFolder(It.IsAny(), null)) + .Returns((Movie m, NamingConfig n) => m.Title); - Mocker.GetMock().Setup(s => s.All()).Returns(new List { fakeMovies[0] }); + Mocker.GetMock().Setup(s => s.All()).Returns(new List { fakeMovies[0] }); - var movies = Subject.AddMovies(fakeMovies); + var movies = Subject.AddMovies(fakeMovies); - Mocker.GetMock().Verify(v => v.InsertMany(It.Is>(l => l.Count == 2))); - } + Mocker.GetMock().Verify(v => v.InsertMany(It.Is>(l => l.Count == 2))); + } - [Test] - public void movies_added_should_ignore_duplicates() - { - Mocker.GetMock() - .Setup(s => s.GetMovieFolder(It.IsAny(), null)) - .Returns((Movie m, NamingConfig n) => m.Title); + [Test] + public void movies_added_should_ignore_duplicates() + { + Mocker.GetMock() + .Setup(s => s.GetMovieFolder(It.IsAny(), null)) + .Returns((Movie m, NamingConfig n) => m.Title); - fakeMovies[2].TmdbId = fakeMovies[0].TmdbId; + fakeMovies[2].TmdbId = fakeMovies[0].TmdbId; - var movies = Subject.AddMovies(fakeMovies); + var movies = Subject.AddMovies(fakeMovies); - Mocker.GetMock().Verify(v => v.InsertMany(It.Is>(l => l.Count == 2))); - } + Mocker.GetMock().Verify(v => v.InsertMany(It.Is>(l => l.Count == 2))); + } - } + } } \ No newline at end of file diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/PrioritizeDownloadDecisionFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/PrioritizeDownloadDecisionFixture.cs index 243333e8e..7826542d3 100644 --- a/src/NzbDrone.Core.Test/DecisionEngineTests/PrioritizeDownloadDecisionFixture.cs +++ b/src/NzbDrone.Core.Test/DecisionEngineTests/PrioritizeDownloadDecisionFixture.cs @@ -36,26 +36,26 @@ public void Setup() CustomFormatsFixture.GivenCustomFormats(CustomFormats.CustomFormat.None, _customFormat1, _customFormat2); } - private RemoteMovie GivenRemoteMovie(QualityModel quality, int age = 0, long size = 0, DownloadProtocol downloadProtocol = DownloadProtocol.Usenet) - { - var remoteMovie = new RemoteMovie(); - remoteMovie.ParsedMovieInfo = new ParsedMovieInfo(); - remoteMovie.ParsedMovieInfo.MovieTitle = "A Movie"; - remoteMovie.ParsedMovieInfo.Year = 1998; - remoteMovie.ParsedMovieInfo.Quality = quality; + private RemoteMovie GivenRemoteMovie(QualityModel quality, int age = 0, long size = 0, DownloadProtocol downloadProtocol = DownloadProtocol.Usenet) + { + var remoteMovie = new RemoteMovie(); + remoteMovie.ParsedMovieInfo = new ParsedMovieInfo(); + remoteMovie.ParsedMovieInfo.MovieTitle = "A Movie"; + remoteMovie.ParsedMovieInfo.Year = 1998; + remoteMovie.ParsedMovieInfo.Quality = quality; - remoteMovie.Movie = Builder.CreateNew().With(m => m.Profile = new Profile { Items = Qualities.QualityFixture.GetDefaultQualities(), - PreferredTags = new List { "DTS-HD", "SPARKS"}, FormatItems = CustomFormatsFixture.GetSampleFormatItems() }) - .With(m => m.Title = "A Movie").Build(); + remoteMovie.Movie = Builder.CreateNew().With(m => m.Profile = new Profile { Items = Qualities.QualityFixture.GetDefaultQualities(), + PreferredTags = new List { "DTS-HD", "SPARKS"}, FormatItems = CustomFormatsFixture.GetSampleFormatItems() }) + .With(m => m.Title = "A Movie").Build(); - remoteMovie.Release = new ReleaseInfo(); - remoteMovie.Release.PublishDate = DateTime.Now.AddDays(-age); - remoteMovie.Release.Size = size; - remoteMovie.Release.DownloadProtocol = downloadProtocol; - remoteMovie.Release.Title = "A Movie 1998"; + remoteMovie.Release = new ReleaseInfo(); + remoteMovie.Release.PublishDate = DateTime.Now.AddDays(-age); + remoteMovie.Release.Size = size; + remoteMovie.Release.DownloadProtocol = downloadProtocol; + remoteMovie.Release.Title = "A Movie 1998"; - return remoteMovie; - } + return remoteMovie; + } private void GivenPreferredDownloadProtocol(DownloadProtocol downloadProtocol) { @@ -70,7 +70,7 @@ private void GivenPreferredDownloadProtocol(DownloadProtocol downloadProtocol) [Test] public void should_put_propers_before_non_propers() { - var remoteEpisode1 = GivenRemoteMovie(new QualityModel(Quality.HDTV720p, new Revision(version: 1))); + var remoteEpisode1 = GivenRemoteMovie(new QualityModel(Quality.HDTV720p, new Revision(version: 1))); var remoteEpisode2 = GivenRemoteMovie(new QualityModel(Quality.HDTV720p, new Revision(version: 2))); var decisions = new List(); @@ -177,8 +177,8 @@ public void should_prefer_releases_with_more_seeders() remoteEpisode1.Release = torrentInfo1; remoteEpisode1.Release.Title = "A Movie 1998"; - remoteEpisode2.Release = torrentInfo2; - remoteEpisode2.Release.Title = "A Movie 1998"; + remoteEpisode2.Release = torrentInfo2; + remoteEpisode2.Release.Title = "A Movie 1998"; var decisions = new List(); decisions.Add(new DownloadDecision(remoteEpisode1)); @@ -207,8 +207,8 @@ public void should_prefer_releases_with_more_peers_given_equal_number_of_seeds() remoteEpisode1.Release = torrentInfo1; remoteEpisode1.Release.Title = "A Movie 1998"; - remoteEpisode2.Release = torrentInfo2; - remoteEpisode2.Release.Title = "A Movie 1998"; + remoteEpisode2.Release = torrentInfo2; + remoteEpisode2.Release.Title = "A Movie 1998"; var decisions = new List(); decisions.Add(new DownloadDecision(remoteEpisode1)); @@ -238,8 +238,8 @@ public void should_prefer_releases_with_more_peers_no_seeds() remoteEpisode1.Release = torrentInfo1; remoteEpisode1.Release.Title = "A Movie 1998"; - remoteEpisode2.Release = torrentInfo2; - remoteEpisode2.Release.Title = "A Movie 1998"; + remoteEpisode2.Release = torrentInfo2; + remoteEpisode2.Release.Title = "A Movie 1998"; var decisions = new List(); decisions.Add(new DownloadDecision(remoteEpisode1)); @@ -268,9 +268,9 @@ public void should_prefer_first_release_if_peers_and_size_are_too_similar() torrentInfo1.Size = 250.Megabytes(); remoteEpisode1.Release = torrentInfo1; - remoteEpisode1.Release.Title = "A Movie 1998"; + remoteEpisode1.Release.Title = "A Movie 1998"; remoteEpisode2.Release = torrentInfo2; - remoteEpisode2.Release.Title = "A Movie 1998"; + remoteEpisode2.Release.Title = "A Movie 1998"; var decisions = new List(); decisions.Add(new DownloadDecision(remoteEpisode1)); @@ -300,22 +300,22 @@ public void should_prefer_first_release_if_age_and_size_are_too_similar() qualifiedReports.First().RemoteMovie.Release.Should().Be(remoteEpisode1.Release); } - [Test] - public void should_prefer_more_prioritized_words() - { - var remoteEpisode1 = GivenRemoteMovie(new QualityModel(Quality.HDTV720p)); - var remoteEpisode2 = GivenRemoteMovie(new QualityModel(Quality.HDTV720p)); + [Test] + public void should_prefer_more_prioritized_words() + { + var remoteEpisode1 = GivenRemoteMovie(new QualityModel(Quality.HDTV720p)); + var remoteEpisode2 = GivenRemoteMovie(new QualityModel(Quality.HDTV720p)); - remoteEpisode1.Release.Title += " DTS-HD"; - remoteEpisode2.Release.Title += " DTS-HD SPARKS"; + remoteEpisode1.Release.Title += " DTS-HD"; + remoteEpisode2.Release.Title += " DTS-HD SPARKS"; - var decisions = new List(); - decisions.Add(new DownloadDecision(remoteEpisode1)); - decisions.Add(new DownloadDecision(remoteEpisode2)); + var decisions = new List(); + decisions.Add(new DownloadDecision(remoteEpisode1)); + decisions.Add(new DownloadDecision(remoteEpisode2)); - var qualifiedReports = Subject.PrioritizeDecisionsForMovies(decisions); - qualifiedReports.First().RemoteMovie.Release.Should().Be(remoteEpisode2.Release); - } + var qualifiedReports = Subject.PrioritizeDecisionsForMovies(decisions); + qualifiedReports.First().RemoteMovie.Release.Should().Be(remoteEpisode2.Release); + } [Test] public void should_prefer_better_custom_format() diff --git a/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/DelaySpecificationFixture.cs b/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/DelaySpecificationFixture.cs index 83f009722..d356e4bcf 100644 --- a/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/DelaySpecificationFixture.cs +++ b/src/NzbDrone.Core.Test/DecisionEngineTests/RssSync/DelaySpecificationFixture.cs @@ -71,14 +71,14 @@ public void Setup() private void GivenExistingFile(QualityModel quality) { - //_remoteEpisode.Episodes.First().EpisodeFileId = 1; + //_remoteEpisode.Episodes.First().EpisodeFileId = 1; - //_remoteEpisode.Episodes.First().EpisodeFile = new LazyLoaded(new EpisodeFile - // { - // Quality = quality - // }); + //_remoteEpisode.Episodes.First().EpisodeFile = new LazyLoaded(new EpisodeFile + // { + // Quality = quality + // }); - _remoteEpisode.Movie.MovieFile = new LazyLoaded(new MovieFile { Quality = quality }); + _remoteEpisode.Movie.MovieFile = new LazyLoaded(new MovieFile { Quality = quality }); } private void GivenUpgradeForExistingFile() diff --git a/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceFixture.cs b/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceFixture.cs index fee3f798c..07f33b026 100644 --- a/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceFixture.cs +++ b/src/NzbDrone.Core.Test/Download/CompletedDownloadServiceFixture.cs @@ -63,9 +63,9 @@ public void Setup() private RemoteMovie BuildRemoteMovie() { - return new RemoteMovie - { - Movie = new Movie() + return new RemoteMovie + { + Movie = new Movie() }; } @@ -221,7 +221,7 @@ public void should_not_mark_as_imported_if_no_episodes_were_parsed() new LocalMovie {Path = @"C:\TestPath\Droned.1998.mkv"},new Rejection("Rejected!")), "Test Failure") }); - _trackedDownload.RemoteMovie.Movie = null; + _trackedDownload.RemoteMovie.Movie = null; Subject.Process(_trackedDownload); @@ -318,7 +318,7 @@ public void should_not_import_when_there_is_a_title_mismatch() [Test] public void should_mark_as_import_title_mismatch_if_ignore_warnings_is_true() - { + { Mocker.GetMock() .Setup(v => v.ProcessPath(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) diff --git a/src/NzbDrone.Core.Test/Download/DownloadApprovedReportsTests/DownloadApprovedFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadApprovedReportsTests/DownloadApprovedFixture.cs index 2828286d7..1e6da9404 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadApprovedReportsTests/DownloadApprovedFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadApprovedReportsTests/DownloadApprovedFixture.cs @@ -34,19 +34,19 @@ private Movie GetMovie(int id) { return Builder.CreateNew() .With(e => e.Id = id) - .With(m => m.Tags = new HashSet()) + .With(m => m.Tags = new HashSet()) .Build(); } - private RemoteMovie GetRemoteMovie(QualityModel quality, Movie movie = null, DownloadProtocol downloadProtocol = DownloadProtocol.Usenet) - { - if (movie == null) - { - movie = GetMovie(1); - } + private RemoteMovie GetRemoteMovie(QualityModel quality, Movie movie = null, DownloadProtocol downloadProtocol = DownloadProtocol.Usenet) + { + if (movie == null) + { + movie = GetMovie(1); + } - movie.Profile = new Profile { Items = Qualities.QualityFixture.GetDefaultQualities(), PreferredTags = new List() }; + movie.Profile = new Profile { Items = Qualities.QualityFixture.GetDefaultQualities(), PreferredTags = new List() }; var remoteMovie = new RemoteMovie() { @@ -67,8 +67,8 @@ private RemoteMovie GetRemoteMovie(QualityModel quality, Movie movie = null, Dow } }; - return remoteMovie; - } + return remoteMovie; + } [Test] public void should_download_report_if_movie_was_not_already_downloaded() @@ -129,14 +129,14 @@ public void should_return_downloaded_reports() public void should_return_all_downloaded_reports() { var remoteMovie1 = GetRemoteMovie( - new QualityModel(Quality.HDTV720p), - GetMovie(1) - ); + new QualityModel(Quality.HDTV720p), + GetMovie(1) + ); var remoteMovie2 = GetRemoteMovie( - new QualityModel(Quality.HDTV720p), - GetMovie(2) - ); + new QualityModel(Quality.HDTV720p), + GetMovie(2) + ); var decisions = new List(); decisions.Add(new DownloadDecision(remoteMovie1)); @@ -149,18 +149,18 @@ public void should_return_all_downloaded_reports() public void should_only_return_downloaded_reports() { var remoteMovie1 = GetRemoteMovie( - new QualityModel(Quality.HDTV720p), - GetMovie(1) - ); + new QualityModel(Quality.HDTV720p), + GetMovie(1) + ); var remoteMovie2 = GetRemoteMovie( - new QualityModel(Quality.HDTV720p), - GetMovie(2) - ); + new QualityModel(Quality.HDTV720p), + GetMovie(2) + ); var remoteMovie3 = GetRemoteMovie( new QualityModel(Quality.HDTV720p), - GetMovie(2) + GetMovie(2) ); var decisions = new List(); diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs index e3e1a19ec..fa554f5f1 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/SabnzbdTests/SabnzbdFixture.cs @@ -345,7 +345,7 @@ public void should_report_diskspace_unpack_error_as_warning() } [Test] - [Ignore("Series")] + [Ignore("Series")] public void Download_should_use_sabRecentTvPriority_when_recentEpisode_is_true() { Mocker.GetMock() diff --git a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/AddFixture.cs b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/AddFixture.cs index 39d526e2c..14a05518b 100644 --- a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/AddFixture.cs +++ b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/AddFixture.cs @@ -24,7 +24,7 @@ public class AddFixture : CoreTest private Movie _movie; private Profile _profile; private ReleaseInfo _release; - private ParsedMovieInfo _parsedMovieInfo; + private ParsedMovieInfo _parsedMovieInfo; private RemoteMovie _remoteMovie; private List _heldReleases; @@ -54,7 +54,7 @@ public void Setup() _parsedMovieInfo.Quality = new QualityModel(Quality.HDTV720p); _remoteMovie = new RemoteMovie(); - _remoteMovie.Movie = _movie; + _remoteMovie.Movie = _movie; _remoteMovie.ParsedMovieInfo = _parsedMovieInfo; _remoteMovie.Release = _release; diff --git a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveRejectedFixture.cs b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveRejectedFixture.cs index 3c0cc0ef9..43f8c2246 100644 --- a/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveRejectedFixture.cs +++ b/src/NzbDrone.Core.Test/Download/Pending/PendingReleaseServiceTests/RemoveRejectedFixture.cs @@ -25,7 +25,7 @@ public class RemoveRejectedFixture : CoreTest private Movie _movie; private Profile _profile; private ReleaseInfo _release; - private ParsedMovieInfo _parsedMovieInfo; + private ParsedMovieInfo _parsedMovieInfo; private RemoteMovie _remoteMovie; [SetUp] @@ -75,7 +75,7 @@ public void Setup() .Returns(new List { _movie }); Mocker.GetMock() - .Setup(s => s.GetMovie(It.IsAny())) + .Setup(s => s.GetMovie(It.IsAny())) .Returns(_movie); Mocker.GetMock() diff --git a/src/NzbDrone.Core.Test/Download/TrackedDownloads/TrackedDownloadServiceFixture.cs b/src/NzbDrone.Core.Test/Download/TrackedDownloads/TrackedDownloadServiceFixture.cs index 76d3a1d2f..cb6d5433b 100644 --- a/src/NzbDrone.Core.Test/Download/TrackedDownloads/TrackedDownloadServiceFixture.cs +++ b/src/NzbDrone.Core.Test/Download/TrackedDownloads/TrackedDownloadServiceFixture.cs @@ -30,7 +30,7 @@ private void GivenDownloadHistory() new History.History(){ DownloadId = "35238", SourceTitle = "TV Series S01", - MovieId = 3, + MovieId = 3, } }); } @@ -74,7 +74,7 @@ public void should_track_downloads_using_the_source_title_if_it_cannot_be_found_ trackedDownload.Should().NotBeNull(); trackedDownload.RemoteMovie.Should().NotBeNull(); trackedDownload.RemoteMovie.Movie.Should().NotBeNull(); - trackedDownload.RemoteMovie.Movie.Id.Should().Be(3); + trackedDownload.RemoteMovie.Movie.Id.Should().Be(3); } diff --git a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedHistoryItemsFixture.cs b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedHistoryItemsFixture.cs index adba4307d..d6bd721d7 100644 --- a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedHistoryItemsFixture.cs +++ b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupOrphanedHistoryItemsFixture.cs @@ -54,7 +54,7 @@ public void should_not_delete_unorphaned() Db.Insert(history); Subject.Clean(); - AllStoredModels.Should().HaveCount(1); + AllStoredModels.Should().HaveCount(1); } } } diff --git a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/FixFutureRunScheduledTasksFixture.cs b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/FixFutureRunScheduledTasksFixture.cs index 8b12b6d1a..68e4c87e6 100644 --- a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/FixFutureRunScheduledTasksFixture.cs +++ b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/FixFutureRunScheduledTasksFixture.cs @@ -24,7 +24,7 @@ public void should_set_last_execution_time_to_now_when_its_in_the_future() Subject.Clean(); - AllStoredModels.ToList().ForEach(t => t.LastExecution.Should().NotBeAfter(DateTime.UtcNow)); + AllStoredModels.ToList().ForEach(t => t.LastExecution.Should().NotBeAfter(DateTime.UtcNow)); } [Test] diff --git a/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs index 498a82ac0..613cfe5fd 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs @@ -27,7 +27,7 @@ public void SetUp() _movieSearchCriteria = new MovieSearchCriteria { - Movie = new Movies.Movie { ImdbId = "tt0076759", Title = "Star Wars", Year = 1977 } + Movie = new Movies.Movie { ImdbId = "tt0076759", Title = "Star Wars", Year = 1977 } }; _capabilities = new NewznabCapabilities(); @@ -107,7 +107,7 @@ public void should_not_search_by_imdbid_if_not_supported() [Test] public void should_search_by_imdbid_if_supported() { - _capabilities.SupportedMovieSearchParameters = new[] { "q", "imdbid" }; + _capabilities.SupportedMovieSearchParameters = new[] { "q", "imdbid" }; var results = Subject.GetSearchRequests(_movieSearchCriteria); results.GetTier(0).Should().HaveCount(1); diff --git a/src/NzbDrone.Core.Test/MediaFiles/MovieImport/ImportDecisionMakerFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/MovieImport/ImportDecisionMakerFixture.cs index 9f096eaaa..13090bd13 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/MovieImport/ImportDecisionMakerFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/MovieImport/ImportDecisionMakerFixture.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.Test.MediaFiles.MovieImport { [TestFixture] - //TODO: Add tests to ensure helpers for augmenters are correctly passed. + //TODO: Add tests to ensure helpers for augmenters are correctly passed. public class ImportDecisionMakerFixture : CoreTest { private List _videoFiles; diff --git a/src/NzbDrone.Core.Test/MovieTests/MovieServiceTests/AddMovieFixture.cs b/src/NzbDrone.Core.Test/MovieTests/MovieServiceTests/AddMovieFixture.cs index 9013c9776..91fadf320 100644 --- a/src/NzbDrone.Core.Test/MovieTests/MovieServiceTests/AddMovieFixture.cs +++ b/src/NzbDrone.Core.Test/MovieTests/MovieServiceTests/AddMovieFixture.cs @@ -8,32 +8,32 @@ namespace NzbDrone.Core.Test.MovieTests.MovieServiceTests { - [TestFixture] - public class AddMovieFixture : CoreTest - { - private Movie fakeMovie; + [TestFixture] + public class AddMovieFixture : CoreTest + { + private Movie fakeMovie; - [SetUp] - public void Setup() - { - fakeMovie = Builder.CreateNew().Build(); - } + [SetUp] + public void Setup() + { + fakeMovie = Builder.CreateNew().Build(); + } - [Test] - public void movie_added_event_should_have_proper_path() - { - fakeMovie.Path = null; - fakeMovie.RootFolderPath = @"C:\Test\Movies"; + [Test] + public void movie_added_event_should_have_proper_path() + { + fakeMovie.Path = null; + fakeMovie.RootFolderPath = @"C:\Test\Movies"; - Mocker.GetMock() - .Setup(s => s.GetMovieFolder(fakeMovie, null)) - .Returns(fakeMovie.Title); + Mocker.GetMock() + .Setup(s => s.GetMovieFolder(fakeMovie, null)) + .Returns(fakeMovie.Title); - var series = Subject.AddMovie(fakeMovie); + var series = Subject.AddMovie(fakeMovie); - series.Path.Should().NotBeNull(); + series.Path.Should().NotBeNull(); - } + } - } + } } diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index 383987d52..be65345b8 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -32,17 +32,17 @@ public void should_remove_accents_from_title() } //Note: This assumes extended language parser is activated - [TestCase("The.Man.from.U.N.C.L.E.2015.1080p.BluRay.x264-SPARKS", "The Man from U.N.C.L.E.")] - [TestCase("1941.1979.EXTENDED.720p.BluRay.X264-AMIABLE", "1941")] - [TestCase("MY MOVIE (2016) [R][Action, Horror][720p.WEB-DL.AVC.8Bit.6ch.AC3].mkv", "MY MOVIE")] - [TestCase("R.I.P.D.2013.720p.BluRay.x264-SPARKS", "R.I.P.D.")] - [TestCase("V.H.S.2.2013.LIMITED.720p.BluRay.x264-GECKOS", "V.H.S. 2")] - [TestCase("This Is A Movie (1999) [IMDB #] {ACTORS} !DIRECTOR +MORE_SILLY_STUFF_NO_ONE_NEEDS ?", "This Is A Movie")] - [TestCase("We Are the Best!.2013.720p.H264.mkv", "We Are the Best!")] - [TestCase("(500).Days.Of.Summer.(2009).DTS.1080p.BluRay.x264.NLsubs", "(500) Days Of Summer")] - [TestCase("To.Live.and.Die.in.L.A.1985.1080p.BluRay", "To Live and Die in L.A.")] - [TestCase("A.I.Artificial.Intelligence.(2001)", "A.I. Artificial Intelligence")] - [TestCase("A.Movie.Name.(1998)", "A Movie Name")] + [TestCase("The.Man.from.U.N.C.L.E.2015.1080p.BluRay.x264-SPARKS", "The Man from U.N.C.L.E.")] + [TestCase("1941.1979.EXTENDED.720p.BluRay.X264-AMIABLE", "1941")] + [TestCase("MY MOVIE (2016) [R][Action, Horror][720p.WEB-DL.AVC.8Bit.6ch.AC3].mkv", "MY MOVIE")] + [TestCase("R.I.P.D.2013.720p.BluRay.x264-SPARKS", "R.I.P.D.")] + [TestCase("V.H.S.2.2013.LIMITED.720p.BluRay.x264-GECKOS", "V.H.S. 2")] + [TestCase("This Is A Movie (1999) [IMDB #] {ACTORS} !DIRECTOR +MORE_SILLY_STUFF_NO_ONE_NEEDS ?", "This Is A Movie")] + [TestCase("We Are the Best!.2013.720p.H264.mkv", "We Are the Best!")] + [TestCase("(500).Days.Of.Summer.(2009).DTS.1080p.BluRay.x264.NLsubs", "(500) Days Of Summer")] + [TestCase("To.Live.and.Die.in.L.A.1985.1080p.BluRay", "To Live and Die in L.A.")] + [TestCase("A.I.Artificial.Intelligence.(2001)", "A.I. Artificial Intelligence")] + [TestCase("A.Movie.Name.(1998)", "A Movie Name")] [TestCase("www.Torrenting.com - Revenge.2008.720p.X264-DIMENSION", "Revenge")] [TestCase("Thor: The Dark World 2013", "Thor The Dark World")] [TestCase("Resident.Evil.The.Final.Chapter.2016", "Resident Evil The Final Chapter")] @@ -51,14 +51,14 @@ public void should_remove_accents_from_title() [TestCase("Valana la Legende FRENCH BluRay 720p 2016 kjhlj", "Valana la Legende")] [TestCase("Valana la Legende TRUEFRENCH BluRay 720p 2016 kjhlj", "Valana la Legende")] [TestCase("Mission Impossible: Rogue Nation (2015)�[XviD - Ita Ac3 - SoftSub Ita]azione, spionaggio, thriller *Prima Visione* Team mulnic Tom Cruise", "Mission Impossible Rogue Nation")] - [TestCase("Scary.Movie.2000.FRENCH..BluRay.-AiRLiNE", "Scary Movie")] - [TestCase("My Movie 1999 German Bluray", "My Movie")] + [TestCase("Scary.Movie.2000.FRENCH..BluRay.-AiRLiNE", "Scary Movie")] + [TestCase("My Movie 1999 German Bluray", "My Movie")] [TestCase("Leaving Jeruselem by Railway (1897) [DVD].mp4", "Leaving Jeruselem by Railway")] [TestCase("Climax.2018.1080p.AMZN.WEB-DL.DD5.1.H.264-NTG", "Climax")] [TestCase("Movie.Title.Imax.2018.1080p.AMZN.WEB-DL.DD5.1.H.264-NTG", "Movie Title")] public void should_parse_movie_title(string postTitle, string title) - { - Parser.Parser.ParseMovieTitle(postTitle, true).MovieTitle.Should().Be(title); + { + Parser.Parser.ParseMovieTitle(postTitle, true).MovieTitle.Should().Be(title); } [TestCase("(1995) Ghost in the Shell", "Ghost in the Shell")] @@ -72,9 +72,9 @@ public void should_parse_movie_folder_name(string postTitle, string title) [TestCase("Der.Soldat.James.German.Bluray.FuckYou.Pso.Why.cant.you.follow.scene.rules.1998", 1998)] [TestCase("Leaving Jeruselem by Railway (1897) [DVD].mp4", 1897)] public void should_parse_movie_year(string postTitle, int year) - { - Parser.Parser.ParseMovieTitle(postTitle, false).Year.Should().Be(year); - } + { + Parser.Parser.ParseMovieTitle(postTitle, false).Year.Should().Be(year); + } [TestCase("Prometheus 2012 Directors Cut", "Directors Cut")] [TestCase("Star Wars Episode IV - A New Hope 1999 (Despecialized).mkv", "Despecialized")] diff --git a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/MapFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/MapFixture.cs index d65bb83a8..02daf6d11 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/MapFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/MapFixture.cs @@ -18,39 +18,39 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests [TestFixture] public class MapFixture : TestBase { - private Movie _movie; - private ParsedMovieInfo _parsedMovieInfo; - private ParsedMovieInfo _wrongYearInfo; + private Movie _movie; + private ParsedMovieInfo _parsedMovieInfo; + private ParsedMovieInfo _wrongYearInfo; private ParsedMovieInfo _wrongTitleInfo; - private ParsedMovieInfo _romanTitleInfo; - private ParsedMovieInfo _alternativeTitleInfo; + private ParsedMovieInfo _romanTitleInfo; + private ParsedMovieInfo _alternativeTitleInfo; private ParsedMovieInfo _umlautInfo; private ParsedMovieInfo _umlautAltInfo; - private MovieSearchCriteria _movieSearchCriteria; + private MovieSearchCriteria _movieSearchCriteria; [SetUp] public void Setup() { - _movie = Builder.CreateNew() - .With(m => m.Title = "Fack Ju Göthe 2") - .With(m => m.CleanTitle = "fackjugoethe2") - .With(m => m.Year = 2015) - .With(m => m.AlternativeTitles = new LazyList( new List {new AlternativeTitle("Fack Ju Göthe 2: Same same")})) - .Build(); + _movie = Builder.CreateNew() + .With(m => m.Title = "Fack Ju Göthe 2") + .With(m => m.CleanTitle = "fackjugoethe2") + .With(m => m.Year = 2015) + .With(m => m.AlternativeTitles = new LazyList( new List {new AlternativeTitle("Fack Ju Göthe 2: Same same")})) + .Build(); - _parsedMovieInfo = new ParsedMovieInfo - { - MovieTitle = _movie.Title, - Year = _movie.Year, + _parsedMovieInfo = new ParsedMovieInfo + { + MovieTitle = _movie.Title, + Year = _movie.Year, - }; + }; - _wrongYearInfo = new ParsedMovieInfo - { - MovieTitle = _movie.Title, - Year = 1900, - }; + _wrongYearInfo = new ParsedMovieInfo + { + MovieTitle = _movie.Title, + Year = 1900, + }; _wrongTitleInfo = new ParsedMovieInfo { @@ -58,17 +58,17 @@ public void Setup() Year = 2015 }; - _alternativeTitleInfo = new ParsedMovieInfo - { - MovieTitle = _movie.AlternativeTitles.First().Title, - Year = _movie.Year, - }; + _alternativeTitleInfo = new ParsedMovieInfo + { + MovieTitle = _movie.AlternativeTitles.First().Title, + Year = _movie.Year, + }; - _romanTitleInfo = new ParsedMovieInfo - { - MovieTitle = "Fack Ju Göthe II", - Year = _movie.Year, - }; + _romanTitleInfo = new ParsedMovieInfo + { + MovieTitle = "Fack Ju Göthe II", + Year = _movie.Year, + }; _umlautInfo = new ParsedMovieInfo { @@ -82,10 +82,10 @@ public void Setup() Year = _movie.Year }; - _movieSearchCriteria = new MovieSearchCriteria - { - Movie = _movie - }; + _movieSearchCriteria = new MovieSearchCriteria + { + Movie = _movie + }; } private void GivenMatchByMovieTitle() @@ -119,9 +119,9 @@ public void should_use_search_criteria_movie_title() [Test] public void should_not_match_with_wrong_year() - { - GivenMatchByMovieTitle(); - Subject.Map(_wrongYearInfo, "", _movieSearchCriteria).MappingResultType.Should().Be(MappingResultType.WrongYear); + { + GivenMatchByMovieTitle(); + Subject.Map(_wrongYearInfo, "", _movieSearchCriteria).MappingResultType.Should().Be(MappingResultType.WrongYear); } [Test] @@ -141,17 +141,17 @@ public void should_return_title_not_found_when_all_is_null() .Be(MappingResultType.TitleNotFound); } - [Test] - public void should_match_alternative_title() - { - Subject.Map(_alternativeTitleInfo, "", _movieSearchCriteria).Movie.Should().Be(_movieSearchCriteria.Movie); - } + [Test] + public void should_match_alternative_title() + { + Subject.Map(_alternativeTitleInfo, "", _movieSearchCriteria).Movie.Should().Be(_movieSearchCriteria.Movie); + } - [Test] - public void should_match_roman_title() - { - Subject.Map(_romanTitleInfo, "", _movieSearchCriteria).Movie.Should().Be(_movieSearchCriteria.Movie); - } + [Test] + public void should_match_roman_title() + { + Subject.Map(_romanTitleInfo, "", _movieSearchCriteria).Movie.Should().Be(_movieSearchCriteria.Movie); + } [Test] public void should_match_umlauts() diff --git a/src/NzbDrone.Core.Test/ParserTests/PathParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/PathParserFixture.cs index 56de9ae88..e15c1e961 100644 --- a/src/NzbDrone.Core.Test/ParserTests/PathParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/PathParserFixture.cs @@ -7,7 +7,7 @@ namespace NzbDrone.Core.Test.ParserTests { /* [TestFixture] - [Ignore("Series")]//Is this really necessary with movies? I dont think so + [Ignore("Series")]//Is this really necessary with movies? I dont think so public class PathParserFixture : CoreTest { [TestCase(@"z:\tv shows\battlestar galactica (2003)\Season 3\S03E05 - Collaborators.mkv", 3, 5)] diff --git a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs index 2387c1017..658833b55 100644 --- a/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/QualityParserFixture.cs @@ -235,12 +235,12 @@ public void should_parse_bluray1080p_quality(string title, bool proper) ParseAndVerifyQuality(title, Source.BLURAY, proper, Resolution.R1080p); } - [TestCase("Movie.Name.2004.576p.BDRip.x264-HANDJOB")] - [TestCase("Hannibal.S01E05.576p.BluRay.DD5.1.x264-HiSD")] - public void should_parse_bluray576p_quality(string title) - { - ParseAndVerifyQuality(title, Source.BLURAY, false, Resolution.R576p); - } + [TestCase("Movie.Name.2004.576p.BDRip.x264-HANDJOB")] + [TestCase("Hannibal.S01E05.576p.BluRay.DD5.1.x264-HiSD")] + public void should_parse_bluray576p_quality(string title) + { + ParseAndVerifyQuality(title, Source.BLURAY, false, Resolution.R576p); + } [TestCase("Contract.to.Kill.2016.REMUX.1080p.BluRay.AVC.DTS-HD.MA.5.1-iFT")] [TestCase("27.Dresses.2008.REMUX.1080p.Bluray.AVC.DTS-HR.MA.5.1-LEGi0N")] diff --git a/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs b/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs index cc1a085ad..84cbe5142 100644 --- a/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs +++ b/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs @@ -110,12 +110,12 @@ public void should_get_root_folder_with_subfolders_excluding_special_sub_folders var rootFolder = Builder.CreateNew() .With(r => r.Path = @"C:\Test\TV") .Build(); - if (OsInfo.IsNotWindows) - { - rootFolder = Builder.CreateNew() - .With(r => r.Path = @"/Test/TV") - .Build(); - } + if (OsInfo.IsNotWindows) + { + rootFolder = Builder.CreateNew() + .With(r => r.Path = @"/Test/TV") + .Build(); + } var subFolders = new[] @@ -128,10 +128,10 @@ public void should_get_root_folder_with_subfolders_excluding_special_sub_folders var folders = subFolders.Select(f => Path.Combine(@"C:\Test\TV", f)).ToArray(); - if (OsInfo.IsNotWindows) - { - folders = subFolders.Select(f => Path.Combine(@"/Test/TV", f)).ToArray(); - } + if (OsInfo.IsNotWindows) + { + folders = subFolders.Select(f => Path.Combine(@"/Test/TV", f)).ToArray(); + } Mocker.GetMock() .Setup(s => s.Get(It.IsAny())) diff --git a/src/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs b/src/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs index de66bcfd8..29c13762c 100644 --- a/src/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs +++ b/src/NzbDrone.Core.Test/UpdateTests/UpdateServiceFixture.cs @@ -31,7 +31,7 @@ public class UpdateServiceFixture : CoreTest [SetUp] public void Setup() { - if (OsInfo.IsLinux || OsInfo.IsOsx) + if (OsInfo.IsLinux || OsInfo.IsOsx) { _updatePackage = new UpdatePackage { diff --git a/src/NzbDrone.Core/Configuration/IConfigService.cs b/src/NzbDrone.Core/Configuration/IConfigService.cs index 48b498cb4..4b3cf0978 100644 --- a/src/NzbDrone.Core/Configuration/IConfigService.cs +++ b/src/NzbDrone.Core/Configuration/IConfigService.cs @@ -57,15 +57,15 @@ public interface IConfigService bool PreferIndexerFlags { get; set; } - int AvailabilityDelay { get; set; } + int AvailabilityDelay { get; set; } - bool AllowHardcodedSubs { get; set; } - string WhitelistedHardcodedSubs { get; set; } + bool AllowHardcodedSubs { get; set; } + string WhitelistedHardcodedSubs { get; set; } ParsingLeniencyType ParsingLeniency { get; set; } int NetImportSyncInterval { get; set; } - string ListSyncLevel { get; set; } - string ImportExclusions { get; set; } + string ListSyncLevel { get; set; } + string ImportExclusions { get; set; } //UI int FirstDayOfWeek { get; set; } diff --git a/src/NzbDrone.Core/Datastore/Migration/131_make_parsed_episode_info_nullable.cs b/src/NzbDrone.Core/Datastore/Migration/131_make_parsed_episode_info_nullable.cs index ca4ab582e..d52b6f974 100644 --- a/src/NzbDrone.Core/Datastore/Migration/131_make_parsed_episode_info_nullable.cs +++ b/src/NzbDrone.Core/Datastore/Migration/131_make_parsed_episode_info_nullable.cs @@ -8,12 +8,12 @@ namespace NzbDrone.Core.Datastore.Migration { - [Migration(131)] - public class make_parsed_episode_info_nullable : NzbDroneMigrationBase + [Migration(131)] + public class make_parsed_episode_info_nullable : NzbDroneMigrationBase { protected override void MainDbUpgrade() { - Alter.Table("PendingReleases").AlterColumn("ParsedEpisodeInfo").AsString().Nullable(); + Alter.Table("PendingReleases").AlterColumn("ParsedEpisodeInfo").AsString().Nullable(); } } } diff --git a/src/NzbDrone.Core/Datastore/Migration/133_add_minimumavailability.cs b/src/NzbDrone.Core/Datastore/Migration/133_add_minimumavailability.cs index 7c85f54ad..84909dd6c 100644 --- a/src/NzbDrone.Core/Datastore/Migration/133_add_minimumavailability.cs +++ b/src/NzbDrone.Core/Datastore/Migration/133_add_minimumavailability.cs @@ -14,10 +14,10 @@ protected override void MainDbUpgrade() { Alter.Table("NetImport").AddColumn("MinimumAvailability").AsInt32().WithDefaultValue(MovieStatusType.PreDB); } - if (!this.Schema.Schema("dbo").Table("Movies").Column("MinimumAvailability").Exists()) - { - Alter.Table("Movies").AddColumn("MinimumAvailability").AsInt32().WithDefaultValue(MovieStatusType.PreDB); - } + if (!this.Schema.Schema("dbo").Table("Movies").Column("MinimumAvailability").Exists()) + { + Alter.Table("Movies").AddColumn("MinimumAvailability").AsInt32().WithDefaultValue(MovieStatusType.PreDB); + } } } } diff --git a/src/NzbDrone.Core/Datastore/Migration/135_add_haspredbentry_to_movies.cs b/src/NzbDrone.Core/Datastore/Migration/135_add_haspredbentry_to_movies.cs index 05d8b766f..c375fed5f 100644 --- a/src/NzbDrone.Core/Datastore/Migration/135_add_haspredbentry_to_movies.cs +++ b/src/NzbDrone.Core/Datastore/Migration/135_add_haspredbentry_to_movies.cs @@ -9,7 +9,7 @@ public class add_haspredbentry_to_movies : NzbDroneMigrationBase { protected override void MainDbUpgrade() { - Alter.Table("Movies").AddColumn("HasPreDBEntry").AsBoolean().WithDefaultValue(false); + Alter.Table("Movies").AddColumn("HasPreDBEntry").AsBoolean().WithDefaultValue(false); } } } diff --git a/src/NzbDrone.Core/Datastore/Migration/136_add_pathstate_to_movies.cs b/src/NzbDrone.Core/Datastore/Migration/136_add_pathstate_to_movies.cs index 2b205ff27..01dd58e46 100644 --- a/src/NzbDrone.Core/Datastore/Migration/136_add_pathstate_to_movies.cs +++ b/src/NzbDrone.Core/Datastore/Migration/136_add_pathstate_to_movies.cs @@ -10,7 +10,7 @@ public class add_pathstate_to_movies : NzbDroneMigrationBase { protected override void MainDbUpgrade() { - Alter.Table("Movies").AddColumn("PathState").AsInt32().WithDefaultValue(2); + Alter.Table("Movies").AddColumn("PathState").AsInt32().WithDefaultValue(2); } } } diff --git a/src/NzbDrone.Core/Datastore/Migration/138_add_physical_release_note.cs b/src/NzbDrone.Core/Datastore/Migration/138_add_physical_release_note.cs index 42bc11aef..661a8f4c2 100644 --- a/src/NzbDrone.Core/Datastore/Migration/138_add_physical_release_note.cs +++ b/src/NzbDrone.Core/Datastore/Migration/138_add_physical_release_note.cs @@ -10,7 +10,7 @@ public class add_physical_release_note : NzbDroneMigrationBase { protected override void MainDbUpgrade() { - Alter.Table("Movies").AddColumn("PhysicalReleaseNote").AsString().Nullable(); + Alter.Table("Movies").AddColumn("PhysicalReleaseNote").AsString().Nullable(); } } } diff --git a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs index 922f4001b..88ad820a9 100644 --- a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs +++ b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs @@ -25,7 +25,7 @@ public class DownloadDecisionMaker : IMakeDownloadDecision { private readonly IEnumerable _specifications; private readonly IParsingService _parsingService; - private readonly IConfigService _configService; + private readonly IConfigService _configService; private readonly IQualityDefinitionService _definitionService; private readonly Logger _logger; @@ -35,7 +35,7 @@ public DownloadDecisionMaker(IEnumerable specifica { _specifications = specifications; _parsingService = parsingService; - _configService = configService; + _configService = configService; _definitionService = qualityDefinitionService; _logger = logger; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs index ab9fd3db5..a9dec0804 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs @@ -38,10 +38,10 @@ public Decision IsSatisfiedBy(RemoteMovie subject, SearchCriteriaBase searchCrit var qualityDefinition = _qualityDefinitionService.Get(quality); if (subject.Movie.Runtime == 0) - { - _logger.Warn("{0} has no runtime information using median movie runtime of 110 minutes.", subject.Movie); - subject.Movie.Runtime = 110; - } + { + _logger.Warn("{0} has no runtime information using median movie runtime of 110 minutes.", subject.Movie); + subject.Movie.Runtime = 110; + } if (qualityDefinition.MinSize.HasValue) { diff --git a/src/NzbDrone.Core/Download/CompletedDownloadService.cs b/src/NzbDrone.Core/Download/CompletedDownloadService.cs index 6320b2485..6bf98ea79 100644 --- a/src/NzbDrone.Core/Download/CompletedDownloadService.cs +++ b/src/NzbDrone.Core/Download/CompletedDownloadService.cs @@ -124,9 +124,9 @@ private void Import(TrackedDownload trackedDownload) .Select(v => { if (v.ImportDecision.LocalMovie == null) - { + { return new TrackedDownloadStatusMessage("", v.Errors); - } + } return new TrackedDownloadStatusMessage(Path.GetFileName(v.ImportDecision.LocalMovie.Path), v.Errors); }) .ToArray(); diff --git a/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs b/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs index 2e5cb6bfa..7be49b99a 100644 --- a/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs +++ b/src/NzbDrone.Core/Download/Pending/PendingReleaseService.cs @@ -291,22 +291,22 @@ private List IncludeRemoteMovies(List releases, private void Insert(DownloadDecision decision, PendingReleaseReason reason) { - var release = new PendingRelease + var release = new PendingRelease { - MovieId = decision.RemoteMovie.Movie.Id, - ParsedMovieInfo = decision.RemoteMovie.ParsedMovieInfo, - Release = decision.RemoteMovie.Release, - Title = decision.RemoteMovie.Release.Title, - Added = DateTime.UtcNow, + MovieId = decision.RemoteMovie.Movie.Id, + ParsedMovieInfo = decision.RemoteMovie.ParsedMovieInfo, + Release = decision.RemoteMovie.Release, + Title = decision.RemoteMovie.Release.Title, + Added = DateTime.UtcNow, Reason = reason }; if (release.ParsedMovieInfo == null) - { - _logger.Warn("Pending release {0} does not have ParsedMovieInfo, will cause issues.", release.Title); - } + { + _logger.Warn("Pending release {0} does not have ParsedMovieInfo, will cause issues.", release.Title); + } - _repository.Insert(release); + _repository.Insert(release); _eventAggregator.PublishEvent(new PendingReleasesUpdatedEvent()); } @@ -338,7 +338,7 @@ private void RemoveGrabbed(RemoteMovie remoteMovie) var pendingReleases = GetPendingReleases(remoteMovie.Movie.Id); - var existingReports = pendingReleases.Where(r => r.RemoteMovie.Movie.Id == remoteMovie.Movie.Id) + var existingReports = pendingReleases.Where(r => r.RemoteMovie.Movie.Id == remoteMovie.Movie.Id) .ToList(); if (existingReports.Empty()) diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalUsers.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalUsers.cs index 9103dc4c1..4dde12d14 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalUsers.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalUsers.cs @@ -2,17 +2,17 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers { - public class CleanupAdditionalUsers : IHousekeepingTask - { - private readonly IMainDatabase _database; + public class CleanupAdditionalUsers : IHousekeepingTask + { + private readonly IMainDatabase _database; - public CleanupAdditionalUsers(IMainDatabase database) - { - _database = database; - } + public CleanupAdditionalUsers(IMainDatabase database) + { + _database = database; + } - public void Clean() - { + public void Clean() + { using (var mapper = _database.GetDataMapper()) { @@ -22,6 +22,6 @@ SELECT ID FROM Users LIMIT 1)"); } } - } + } } diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/FixWronglyMatchedMovieFiles.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/FixWronglyMatchedMovieFiles.cs index f6756cce4..951c35d03 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/FixWronglyMatchedMovieFiles.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/FixWronglyMatchedMovieFiles.cs @@ -2,24 +2,24 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers { - public class FixWronglyMatchedMovieFiles : IHousekeepingTask - { - private readonly IMainDatabase _database; + public class FixWronglyMatchedMovieFiles : IHousekeepingTask + { + private readonly IMainDatabase _database; - public FixWronglyMatchedMovieFiles(IMainDatabase database) - { - _database = database; - } + public FixWronglyMatchedMovieFiles(IMainDatabase database) + { + _database = database; + } - public void Clean() - { - /*var mapper = _database.GetDataMapper(); + public void Clean() + { + /*var mapper = _database.GetDataMapper(); - mapper.ExecuteNonQuery(@"UPDATE Movies - SET MovieFileId = - (Select Id FROM MovieFiles WHERE Movies.Id == MovieFiles.MovieId) - WHERE MovieFileId != - (SELECT Id FROM MovieFiles WHERE Movies.Id == MovieFiles.MovieId)");*/ - } - } + mapper.ExecuteNonQuery(@"UPDATE Movies + SET MovieFileId = + (Select Id FROM MovieFiles WHERE Movies.Id == MovieFiles.MovieId) + WHERE MovieFileId != + (SELECT Id FROM MovieFiles WHERE Movies.Id == MovieFiles.MovieId)");*/ + } + } } diff --git a/src/NzbDrone.Core/Indexers/PassThePopcorn/PassThePopcornParser.cs b/src/NzbDrone.Core/Indexers/PassThePopcorn/PassThePopcornParser.cs index 95d55eb32..9caec8fed 100644 --- a/src/NzbDrone.Core/Indexers/PassThePopcorn/PassThePopcornParser.cs +++ b/src/NzbDrone.Core/Indexers/PassThePopcorn/PassThePopcornParser.cs @@ -62,11 +62,11 @@ public IList ParseResponse(IndexerResponse indexerResponse) { var id = torrent.Id; var title = torrent.ReleaseName; - IndexerFlags flags = 0; + IndexerFlags flags = 0; if (torrent.GoldenPopcorn) { - flags |= IndexerFlags.PTP_Golden;//title = $"{title} 🍿"; + flags |= IndexerFlags.PTP_Golden;//title = $"{title} 🍿"; } if (torrent.Checked) diff --git a/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs b/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs index e4febd1e1..0d9fd16b7 100644 --- a/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs +++ b/src/NzbDrone.Core/Indexers/Torznab/TorznabRssParser.cs @@ -167,11 +167,11 @@ protected override string GetMagnetUrl(XElement item) return base.GetPeers(item); } - protected IndexerFlags GetFlags(XElement item) - { - IndexerFlags flags = 0; + protected IndexerFlags GetFlags(XElement item) + { + IndexerFlags flags = 0; - var downloadFactor = TryGetFloatTorznabAttribute(item, "downloadvolumefactor", 1); + var downloadFactor = TryGetFloatTorznabAttribute(item, "downloadvolumefactor", 1); var uploadFactor = TryGetFloatTorznabAttribute(item, "uploadvolumefactor", 1); @@ -191,7 +191,7 @@ protected IndexerFlags GetFlags(XElement item) } return flags; - } + } protected string TryGetTorznabAttribute(XElement item, string key, string defaultValue = "") { @@ -205,7 +205,7 @@ protected string TryGetTorznabAttribute(XElement item, string key, string defaul return defaultValue; } - protected float TryGetFloatTorznabAttribute(XElement item, string key, float defaultValue = 0) + protected float TryGetFloatTorznabAttribute(XElement item, string key, float defaultValue = 0) { var attr = TryGetTorznabAttribute(item, key, defaultValue.ToString()); diff --git a/src/NzbDrone.Core/MediaFiles/Commands/RenameMovieFolderCommand.cs b/src/NzbDrone.Core/MediaFiles/Commands/RenameMovieFolderCommand.cs index 69f95a911..897a5d568 100644 --- a/src/NzbDrone.Core/MediaFiles/Commands/RenameMovieFolderCommand.cs +++ b/src/NzbDrone.Core/MediaFiles/Commands/RenameMovieFolderCommand.cs @@ -14,7 +14,7 @@ public class RenameMovieFolderCommand : Command public RenameMovieFolderCommand(List ids) { - MovieIds = ids; + MovieIds = ids; } } } diff --git a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs index f1d6ac2e5..b1228d957 100644 --- a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs +++ b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs @@ -41,7 +41,7 @@ public class DiskScanService : private readonly IRootFolderService _rootFolderService; private readonly IEventAggregator _eventAggregator; private readonly IMediaFileService _movieFileRepository; - private readonly IRenameMovieFileService _renameMovieFiles; + private readonly IRenameMovieFileService _renameMovieFiles; private readonly Logger _logger; public DiskScanService(IDiskProvider diskProvider, @@ -53,7 +53,7 @@ public DiskScanService(IDiskProvider diskProvider, IRootFolderService rootFolderService, IEventAggregator eventAggregator, IMediaFileService movieFileRepository, - IRenameMovieFileService renameMovieFiles, + IRenameMovieFileService renameMovieFiles, Logger logger) { _diskProvider = diskProvider; @@ -65,7 +65,7 @@ public DiskScanService(IDiskProvider diskProvider, _rootFolderService = rootFolderService; _eventAggregator = eventAggregator; _movieFileRepository = movieFileRepository; - _renameMovieFiles = renameMovieFiles; + _renameMovieFiles = renameMovieFiles; _logger = logger; } diff --git a/src/NzbDrone.Core/MediaFiles/MovieFileMovingService.cs b/src/NzbDrone.Core/MediaFiles/MovieFileMovingService.cs index 38f44d5e3..fd7fe66f4 100644 --- a/src/NzbDrone.Core/MediaFiles/MovieFileMovingService.cs +++ b/src/NzbDrone.Core/MediaFiles/MovieFileMovingService.cs @@ -183,7 +183,7 @@ private void EnsureMovieFolder(MovieFile movieFile, LocalMovie localMovie, strin private void EnsureMovieFolder(MovieFile movieFile, Movie movie, string filePath) { var movieFolder = Path.GetDirectoryName(filePath); - //movie.Path = movieFolder; + //movie.Path = movieFolder; var rootFolder = new OsPath(movieFolder).Directory.FullPath; var fileName = Path.GetFileName(filePath); diff --git a/src/NzbDrone.Core/MediaFiles/RenameMovieFileService.cs b/src/NzbDrone.Core/MediaFiles/RenameMovieFileService.cs index c45408b29..dcb1edc66 100644 --- a/src/NzbDrone.Core/MediaFiles/RenameMovieFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/RenameMovieFileService.cs @@ -21,13 +21,13 @@ namespace NzbDrone.Core.MediaFiles public interface IRenameMovieFileService { List GetRenamePreviews(int movieId); - void RenameMoviePath(Movie movie, bool shouldRenameFiles); + void RenameMoviePath(Movie movie, bool shouldRenameFiles); } public class RenameMovieFileService : IRenameMovieFileService, IExecute, IExecute, - IExecute + IExecute { private readonly IMovieService _movieService; private readonly IMediaFileService _mediaFileService; @@ -138,33 +138,33 @@ private void RenameFiles(List movieFiles, Movie movie, string oldMovi } } - public void RenameMoviePath(Movie movie, bool shouldRenameFiles = true) - { - var newFolder = _filenameBuilder.BuildMoviePath(movie); - if (newFolder != movie.Path && movie.PathState == MoviePathState.Dynamic) - { + public void RenameMoviePath(Movie movie, bool shouldRenameFiles = true) + { + var newFolder = _filenameBuilder.BuildMoviePath(movie); + if (newFolder != movie.Path && movie.PathState == MoviePathState.Dynamic) + { - if (!_configService.AutoRenameFolders) - { - _logger.Info("{0}'s movie should be {1} according to your naming config.", movie, newFolder); - return; - } + if (!_configService.AutoRenameFolders) + { + _logger.Info("{0}'s movie should be {1} according to your naming config.", movie, newFolder); + return; + } - _logger.Info("{0}'s movie folder changed to: {1}", movie, newFolder); + _logger.Info("{0}'s movie folder changed to: {1}", movie, newFolder); var oldFolder = movie.Path; movie.Path = newFolder; - _diskProvider.MoveFolder(oldFolder, movie.Path); + _diskProvider.MoveFolder(oldFolder, movie.Path); - // if (false) - // { - // var movieFiles = _mediaFileService.GetFilesByMovie(movie.Id); - // _logger.ProgressInfo("Renaming movie files for {0}", movie.Title); - // RenameFiles(movieFiles, movie, oldFolder); - // _logger.ProgressInfo("All movie files renamed for {0}", movie.Title); - // } + // if (false) + // { + // var movieFiles = _mediaFileService.GetFilesByMovie(movie.Id); + // _logger.ProgressInfo("Renaming movie files for {0}", movie.Title); + // RenameFiles(movieFiles, movie, oldFolder); + // _logger.ProgressInfo("All movie files renamed for {0}", movie.Title); + // } - _movieService.UpdateMovie(movie); + _movieService.UpdateMovie(movie); if (_diskProvider.GetFiles(oldFolder, SearchOption.AllDirectories).Count() == 0) { @@ -172,14 +172,14 @@ public void RenameMoviePath(Movie movie, bool shouldRenameFiles = true) } - } + } if (movie.PathState == MoviePathState.StaticOnce) { movie.PathState = MoviePathState.Dynamic; _movieService.UpdateMovie(movie); } - } + } public void Execute(RenameFilesCommand message) { @@ -206,24 +206,24 @@ public void Execute(RenameMovieCommand message) } - public void Execute(RenameMovieFolderCommand message) - { - try - { - _logger.Debug("Renaming movie folder for selected movie if necessary"); - var moviesToRename = _movieService.GetMovies(message.MovieIds); - foreach(var movie in moviesToRename) - { - var movieFiles = _mediaFileService.GetFilesByMovie(movie.Id); - //_logger.ProgressInfo("Renaming movie folder for {0}", movie.Title); - RenameMoviePath(movie); - } - } - catch (SQLiteException ex) - { + public void Execute(RenameMovieFolderCommand message) + { + try + { + _logger.Debug("Renaming movie folder for selected movie if necessary"); + var moviesToRename = _movieService.GetMovies(message.MovieIds); + foreach(var movie in moviesToRename) + { + var movieFiles = _mediaFileService.GetFilesByMovie(movie.Id); + //_logger.ProgressInfo("Renaming movie folder for {0}", movie.Title); + RenameMoviePath(movie); + } + } + catch (SQLiteException ex) + { _logger.Warn(ex, "wtf: {0}, {1}", ex.ResultCode, ex.Data); - } + } - } + } } } diff --git a/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs b/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs index 2bcf394b1..b33761f55 100644 --- a/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs @@ -16,7 +16,7 @@ public class UpgradeMediaFileService : IUpgradeMediaFiles private readonly IRecycleBinProvider _recycleBinProvider; private readonly IMediaFileService _mediaFileService; private readonly IMoveMovieFiles _movieFileMover; - private readonly IRenameMovieFileService _movieFileRenamer; + private readonly IRenameMovieFileService _movieFileRenamer; private readonly IDiskProvider _diskProvider; private readonly Logger _logger; @@ -24,14 +24,14 @@ public UpgradeMediaFileService(IRecycleBinProvider recycleBinProvider, IMediaFileService mediaFileService, IMoveMovieFiles movieFileMover, IDiskProvider diskProvider, - IRenameMovieFileService movieFileRenamer, + IRenameMovieFileService movieFileRenamer, Logger logger) { _recycleBinProvider = recycleBinProvider; _mediaFileService = mediaFileService; _movieFileMover = movieFileMover; _diskProvider = diskProvider; - _movieFileRenamer = movieFileRenamer; + _movieFileRenamer = movieFileRenamer; _logger = logger; } @@ -56,9 +56,9 @@ public MovieFileMoveResult UpgradeMovieFile(MovieFile movieFile, LocalMovie loca _mediaFileService.Delete(existingFile, DeleteMediaFileReason.Upgrade); } - //Temporary for correctly getting path - localMovie.Movie.MovieFileId = 1; - localMovie.Movie.MovieFile = movieFile; + //Temporary for correctly getting path + localMovie.Movie.MovieFileId = 1; + localMovie.Movie.MovieFile = movieFile; if (copyOnly) { @@ -72,7 +72,7 @@ public MovieFileMoveResult UpgradeMovieFile(MovieFile movieFile, LocalMovie loca localMovie.Movie.MovieFileId = existingFile?.Id ?? 0; localMovie.Movie.MovieFile = existingFile; - //_movieFileRenamer.RenameMoviePath(localMovie.Movie, false); + //_movieFileRenamer.RenameMoviePath(localMovie.Movie, false); return moveFileResult; } diff --git a/src/NzbDrone.Core/MetadataSource/PreDB/PreDBService.cs b/src/NzbDrone.Core/MetadataSource/PreDB/PreDBService.cs index 1ba3fe5b7..1ca9a1610 100644 --- a/src/NzbDrone.Core/MetadataSource/PreDB/PreDBService.cs +++ b/src/NzbDrone.Core/MetadataSource/PreDB/PreDBService.cs @@ -81,36 +81,36 @@ private List GetResults(string category = "", string search = "") var response = _httpClient.Get(request); - if (response.StatusCode != System.Net.HttpStatusCode.OK) - { - _logger.Warn("Non 200 StatusCode {0} encountered while searching PreDB.", response.StatusCode); - return new List(); - } + if (response.StatusCode != System.Net.HttpStatusCode.OK) + { + _logger.Warn("Non 200 StatusCode {0} encountered while searching PreDB.", response.StatusCode); + return new List(); + } - try - { - var reader = XmlReader.Create(new StringReader(response.Content)); + try + { + var reader = XmlReader.Create(new StringReader(response.Content)); - var items = SyndicationFeed.Load(reader); + var items = SyndicationFeed.Load(reader); - var results = new List(); + var results = new List(); - foreach (SyndicationItem item in items.Items) - { - var result = new PreDBResult(); - result.Title = item.Title.Text; - result.Link = item.Links[0].Uri.ToString(); - results.Add(result); - } + foreach (SyndicationItem item in items.Items) + { + var result = new PreDBResult(); + result.Title = item.Title.Text; + result.Link = item.Links[0].Uri.ToString(); + results.Add(result); + } - return results; - } - catch (Exception ex) - { - _logger.Error(ex, "Error while searching PreDB."); - } + return results; + } + catch (Exception ex) + { + _logger.Error(ex, "Error while searching PreDB."); + } - return new List(); */ + return new List(); */ } private List FindMatchesToResults(List results) @@ -157,7 +157,7 @@ public void Execute(PreDBSyncCommand message) { if (!movie.HasPreDBEntry) { - movie.HasPreDBEntry = true; + movie.HasPreDBEntry = true; _movieService.UpdateMovie(movie); } @@ -172,32 +172,32 @@ public void Execute(PreDBSyncCommand message) public bool HasReleases(Movie movie) { - try - { - var results = GetResults("movies", movie.Title); + try + { + var results = GetResults("movies", movie.Title); - foreach (PreDBResult result in results) - { - var parsed = Parser.Parser.ParseMovieTitle(result.Title, true); - if (parsed == null) - { - parsed = new Parser.Model.ParsedMovieInfo { MovieTitle = result.Title, Year = 0 }; - } - var match = _parsingService.Map(parsed, "", new MovieSearchCriteria { Movie = movie }); + foreach (PreDBResult result in results) + { + var parsed = Parser.Parser.ParseMovieTitle(result.Title, true); + if (parsed == null) + { + parsed = new Parser.Model.ParsedMovieInfo { MovieTitle = result.Title, Year = 0 }; + } + var match = _parsingService.Map(parsed, "", new MovieSearchCriteria { Movie = movie }); - if (match != null && match.RemoteMovie.Movie != null && match.RemoteMovie.Movie.Id == movie.Id) - { - return true; - } - } + if (match != null && match.RemoteMovie.Movie != null && match.RemoteMovie.Movie.Id == movie.Id) + { + return true; + } + } - return false; - } - catch (Exception ex) - { - _logger.Warn(ex, "Error while looking on predb.me."); - return false; - } + return false; + } + catch (Exception ex) + { + _logger.Warn(ex, "Error while looking on predb.me."); + return false; + } } } diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index 5dfe12f52..7e970e2e3 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -128,17 +128,17 @@ public Movie GetMovieInfo(int TmdbId, Profile profile = null, bool hasPreDBEntry return null; } - var movie = new Movie(); + var movie = new Movie(); var altTitles = new List(); - if (langCode != "en") - { - var iso = IsoLanguages.Find(resource.original_language); - if (iso != null) - { - altTitles.Add(new AlternativeTitle(resource.original_title, SourceType.TMDB, TmdbId, iso.Language)); - } - } + if (langCode != "en") + { + var iso = IsoLanguages.Find(resource.original_language); + if (iso != null) + { + altTitles.Add(new AlternativeTitle(resource.original_title, SourceType.TMDB, TmdbId, iso.Language)); + } + } foreach (var alternativeTitle in resource.alternative_titles.titles) { @@ -244,7 +244,7 @@ public Movie GetMovieInfo(int TmdbId, Profile profile = null, bool hasPreDBEntry //otherwise the title has only been announced else { - movie.Status = MovieStatusType.Announced; + movie.Status = MovieStatusType.Announced; } //since TMDB lacks alot of information lets assume that stuff is released if its been in cinemas for longer than 3 months. @@ -253,17 +253,17 @@ public Movie GetMovieInfo(int TmdbId, Profile profile = null, bool hasPreDBEntry movie.Status = MovieStatusType.Released; } - if (!hasPreDBEntry) - { - if (_predbService.HasReleases(movie)) - { - movie.HasPreDBEntry = true; - } - else - { - movie.HasPreDBEntry = false; - } - } + if (!hasPreDBEntry) + { + if (_predbService.HasReleases(movie)) + { + movie.HasPreDBEntry = true; + } + else + { + movie.HasPreDBEntry = false; + } + } if (resource.videos != null) { @@ -533,37 +533,37 @@ public Movie MapMovie(MovieResult result) var now = DateTime.Now; - //handle the case when we have both theatrical and physical release dates - if (imdbMovie.InCinemas.HasValue && imdbMovie.PhysicalRelease.HasValue) - { - if (now < imdbMovie.InCinemas) - imdbMovie.Status = MovieStatusType.Announced; - else if (now >= imdbMovie.InCinemas) - imdbMovie.Status = MovieStatusType.InCinemas; - if (now >= imdbMovie.PhysicalRelease) - imdbMovie.Status = MovieStatusType.Released; - } - //handle the case when we have theatrical release dates but we dont know the physical release date - else if (imdbMovie.InCinemas.HasValue && (now >= imdbMovie.InCinemas)) - { - imdbMovie.Status = MovieStatusType.InCinemas; - } - //handle the case where we only have a physical release date - else if (imdbMovie.PhysicalRelease.HasValue && (now >= imdbMovie.PhysicalRelease)) - { - imdbMovie.Status = MovieStatusType.Released; - } - //otherwise the title has only been announced - else - { - imdbMovie.Status = MovieStatusType.Announced; - } + //handle the case when we have both theatrical and physical release dates + if (imdbMovie.InCinemas.HasValue && imdbMovie.PhysicalRelease.HasValue) + { + if (now < imdbMovie.InCinemas) + imdbMovie.Status = MovieStatusType.Announced; + else if (now >= imdbMovie.InCinemas) + imdbMovie.Status = MovieStatusType.InCinemas; + if (now >= imdbMovie.PhysicalRelease) + imdbMovie.Status = MovieStatusType.Released; + } + //handle the case when we have theatrical release dates but we dont know the physical release date + else if (imdbMovie.InCinemas.HasValue && (now >= imdbMovie.InCinemas)) + { + imdbMovie.Status = MovieStatusType.InCinemas; + } + //handle the case where we only have a physical release date + else if (imdbMovie.PhysicalRelease.HasValue && (now >= imdbMovie.PhysicalRelease)) + { + imdbMovie.Status = MovieStatusType.Released; + } + //otherwise the title has only been announced + else + { + imdbMovie.Status = MovieStatusType.Announced; + } - //since TMDB lacks alot of information lets assume that stuff is released if its been in cinemas for longer than 3 months. - if (!imdbMovie.PhysicalRelease.HasValue && (imdbMovie.Status == MovieStatusType.InCinemas) && (((DateTime.Now).Subtract(imdbMovie.InCinemas.Value)).TotalSeconds > 60 * 60 * 24 * 30 * 3)) - { - imdbMovie.Status = MovieStatusType.Released; - } + //since TMDB lacks alot of information lets assume that stuff is released if its been in cinemas for longer than 3 months. + if (!imdbMovie.PhysicalRelease.HasValue && (imdbMovie.Status == MovieStatusType.InCinemas) && (((DateTime.Now).Subtract(imdbMovie.InCinemas.Value)).TotalSeconds > 60 * 60 * 24 * 30 * 3)) + { + imdbMovie.Status = MovieStatusType.Released; + } imdbMovie.TitleSlug += "-" + imdbMovie.TmdbId; @@ -659,48 +659,48 @@ private static MediaCoverTypes MapCoverType(string coverType) public Movie MapMovieToTmdbMovie(Movie movie) { - try - { - Movie newMovie = movie; - if (movie.TmdbId > 0) - { - newMovie = GetMovieInfo(movie.TmdbId); - } - else if (movie.ImdbId.IsNotNullOrWhiteSpace()) - { - newMovie = GetMovieInfo(movie.ImdbId); - } - else - { - var yearStr = ""; - if (movie.Year > 1900) - { - yearStr = $" {movie.Year}"; - } - newMovie = SearchForNewMovie(movie.Title + yearStr).FirstOrDefault(); - } + try + { + Movie newMovie = movie; + if (movie.TmdbId > 0) + { + newMovie = GetMovieInfo(movie.TmdbId); + } + else if (movie.ImdbId.IsNotNullOrWhiteSpace()) + { + newMovie = GetMovieInfo(movie.ImdbId); + } + else + { + var yearStr = ""; + if (movie.Year > 1900) + { + yearStr = $" {movie.Year}"; + } + newMovie = SearchForNewMovie(movie.Title + yearStr).FirstOrDefault(); + } - if (newMovie == null) - { - _logger.Warn("Couldn't map movie {0} to a movie on The Movie DB. It will not be added :(", movie.Title); - return null; - } + if (newMovie == null) + { + _logger.Warn("Couldn't map movie {0} to a movie on The Movie DB. It will not be added :(", movie.Title); + return null; + } - newMovie.Path = movie.Path; - newMovie.RootFolderPath = movie.RootFolderPath; - newMovie.ProfileId = movie.ProfileId; - newMovie.Monitored = movie.Monitored; - newMovie.MovieFile = movie.MovieFile; - newMovie.MinimumAvailability = movie.MinimumAvailability; - newMovie.Tags = movie.Tags; + newMovie.Path = movie.Path; + newMovie.RootFolderPath = movie.RootFolderPath; + newMovie.ProfileId = movie.ProfileId; + newMovie.Monitored = movie.Monitored; + newMovie.MovieFile = movie.MovieFile; + newMovie.MinimumAvailability = movie.MinimumAvailability; + newMovie.Tags = movie.Tags; - return newMovie; - } - catch (Exception ex) - { - _logger.Warn(ex, "Couldn't map movie {0} to a movie on The Movie DB. It will not be added :(", movie.Title); - return null; - } + return newMovie; + } + catch (Exception ex) + { + _logger.Warn(ex, "Couldn't map movie {0} to a movie on The Movie DB. It will not be added :(", movie.Title); + return null; + } } } } diff --git a/src/NzbDrone.Core/Movies/AlternativeTitles/AlternativeTitleRepository.cs b/src/NzbDrone.Core/Movies/AlternativeTitles/AlternativeTitleRepository.cs index f40eb4776..7f8607760 100644 --- a/src/NzbDrone.Core/Movies/AlternativeTitles/AlternativeTitleRepository.cs +++ b/src/NzbDrone.Core/Movies/AlternativeTitles/AlternativeTitleRepository.cs @@ -17,12 +17,12 @@ public interface IAlternativeTitleRepository : IBasicRepository, IAlternativeTitleRepository { - protected IMainDatabase _database; + protected IMainDatabase _database; public AlternativeTitleRepository(IMainDatabase database, IEventAggregator eventAggregator) : base(database, eventAggregator) { - _database = database; + _database = database; } public AlternativeTitle FindBySourceId(int sourceId) diff --git a/src/NzbDrone.Core/Movies/Movie.cs b/src/NzbDrone.Core/Movies/Movie.cs index 311127b1b..ef3470ed6 100644 --- a/src/NzbDrone.Core/Movies/Movie.cs +++ b/src/NzbDrone.Core/Movies/Movie.cs @@ -29,7 +29,7 @@ public Movie() public MovieStatusType Status { get; set; } public string Overview { get; set; } public bool Monitored { get; set; } - public MovieStatusType MinimumAvailability { get; set; } + public MovieStatusType MinimumAvailability { get; set; } public int ProfileId { get; set; } public DateTime? LastInfoSync { get; set; } public int Runtime { get; set; } @@ -52,7 +52,7 @@ public Movie() public HashSet Tags { get; set; } public AddMovieOptions AddOptions { get; set; } public MovieFile MovieFile { get; set; } - public bool HasPreDBEntry { get; set; } + public bool HasPreDBEntry { get; set; } public int MovieFileId { get; set; } //Get Loaded via a Join Query public List AlternativeTitles { get; set; } @@ -83,11 +83,11 @@ public bool IsRecentMovie public string FolderName() { - if (Path.IsNullOrWhiteSpace()) - { - return ""; - } - //Well what about Path = Null? + if (Path.IsNullOrWhiteSpace()) + { + return ""; + } + //Well what about Path = Null? //return new DirectoryInfo(Path).Name; return Path; } @@ -119,10 +119,10 @@ public bool IsAvailable(int delay = 0) break; } - if (HasPreDBEntry && MinimumAvailability == MovieStatusType.PreDB) - { - return true; - } + if (HasPreDBEntry && MinimumAvailability == MovieStatusType.PreDB) + { + return true; + } if (MinimumAvailabilityDate == DateTime.MinValue || MinimumAvailabilityDate == DateTime.MaxValue) { diff --git a/src/NzbDrone.Core/Movies/MovieRepository.cs b/src/NzbDrone.Core/Movies/MovieRepository.cs index e661aefe0..51e39c6a2 100644 --- a/src/NzbDrone.Core/Movies/MovieRepository.cs +++ b/src/NzbDrone.Core/Movies/MovieRepository.cs @@ -32,12 +32,12 @@ public interface IMovieRepository : IBasicRepository public class MovieRepository : BasicRepository, IMovieRepository { - protected IMainDatabase _database; + protected IMainDatabase _database; public MovieRepository(IMainDatabase database, IEventAggregator eventAggregator) : base(database, eventAggregator) { - _database = database; + _database = database; } public bool MoviePathExists(string path) @@ -122,7 +122,7 @@ public PagingSpec MoviesWhereCutoffUnmet(PagingSpec pagingSpec, Li } private SortBuilder MoviesWhereCutoffUnmetQuery(PagingSpec pagingSpec, List qualitiesBelowCutoff) - { + { return Query .Join(JoinType.Left, e => e.MovieFile, (e, s) => e.MovieFileId == s.Id) .Where(pagingSpec.FilterExpressions.FirstOrDefault()) @@ -148,20 +148,20 @@ private string BuildQualityCutoffWhereClause(List qualitie return string.Format("({0})", string.Join(" OR ", clauses)); } - private string BuildQualityCutoffWhereClauseSpecial(List qualitiesBelowCutoff) - { - var clauses = new List(); + private string BuildQualityCutoffWhereClauseSpecial(List qualitiesBelowCutoff) + { + var clauses = new List(); - foreach (var profile in qualitiesBelowCutoff) - { - foreach (var belowCutoff in profile.QualityIds) - { - clauses.Add(string.Format("(Movies.ProfileId = {0} AND MovieFiles.Quality LIKE '%_quality_: {1},%')", profile.ProfileId, belowCutoff)); - } - } + foreach (var profile in qualitiesBelowCutoff) + { + foreach (var belowCutoff in profile.QualityIds) + { + clauses.Add(string.Format("(Movies.ProfileId = {0} AND MovieFiles.Quality LIKE '%_quality_: {1},%')", profile.ProfileId, belowCutoff)); + } + } - return string.Format("({0})", string.Join(" OR ", clauses)); - } + return string.Format("({0})", string.Join(" OR ", clauses)); + } private Movie FindByTitle(string cleanTitle, int? year) { diff --git a/src/NzbDrone.Core/Movies/MovieService.cs b/src/NzbDrone.Core/Movies/MovieService.cs index 0ff2e1b24..16b17bdb0 100644 --- a/src/NzbDrone.Core/Movies/MovieService.cs +++ b/src/NzbDrone.Core/Movies/MovieService.cs @@ -21,7 +21,7 @@ public interface IMovieService { Movie GetMovie(int movieId); List GetMovies(IEnumerable movieIds); - PagingSpec Paged(PagingSpec pagingSpec); + PagingSpec Paged(PagingSpec pagingSpec); Movie AddMovie(Movie newMovie); List AddMovies(List newMovies); Movie FindByImdbId(string imdbid); @@ -35,7 +35,7 @@ public interface IMovieService Movie GetMovieByFileId(int fileId); List GetMoviesBetweenDates(DateTime start, DateTime end, bool includeUnmonitored); PagingSpec MoviesWithoutFiles(PagingSpec pagingSpec); - void SetFileId(Movie movie, MovieFile movieFile); + void SetFileId(Movie movie, MovieFile movieFile); void DeleteMovie(int movieId, bool deleteFiles, bool addExclusion = false); List GetAllMovies(); List AllForTag(int tagId); @@ -141,10 +141,10 @@ public List GetMovies(IEnumerable movieIds) return _movieRepository.Get(movieIds).ToList(); } - public PagingSpec Paged(PagingSpec pagingSpec) - { - return _movieRepository.GetPaged(pagingSpec); - } + public PagingSpec Paged(PagingSpec pagingSpec) + { + return _movieRepository.GetPaged(pagingSpec); + } public Movie AddMovie(Movie newMovie) { @@ -185,10 +185,10 @@ public List AddMovies(List newMovies) newMovies.ForEach(m => { MoviePathState defaultState = MoviePathState.Static; - if (!_configService.PathsDefaultStatic) - { - defaultState = MoviePathState.Dynamic; - } + if (!_configService.PathsDefaultStatic) + { + defaultState = MoviePathState.Dynamic; + } if (string.IsNullOrWhiteSpace(m.Path)) { var folderName = _fileNameBuilder.GetMovieFolder(m); @@ -371,11 +371,11 @@ public void Handle(MovieFileAddedEvent message) _logger.Info("Linking [{0}] > [{1}]", message.MovieFile.RelativePath, message.MovieFile.Movie.Value); } - public void SetFileId(Movie movie, MovieFile movieFile) - { - _movieRepository.SetFileId(movieFile.Id, movie.Id); - _logger.Info("Linking [{0}] > [{1}]", movieFile.RelativePath, movie); - } + public void SetFileId(Movie movie, MovieFile movieFile) + { + _movieRepository.SetFileId(movieFile.Id, movie.Id); + _logger.Info("Linking [{0}] > [{1}]", movieFile.RelativePath, movie); + } public void Handle(MovieFileDeletedEvent message) { diff --git a/src/NzbDrone.Core/NetImport/HttpNetImportBase.cs b/src/NzbDrone.Core/NetImport/HttpNetImportBase.cs index 15f40c46e..1447c55e1 100644 --- a/src/NzbDrone.Core/NetImport/HttpNetImportBase.cs +++ b/src/NzbDrone.Core/NetImport/HttpNetImportBase.cs @@ -117,7 +117,7 @@ protected virtual IList FetchPage(NetImportRequest request, IParseNetImpo m.RootFolderPath = ((NetImportDefinition) Definition).RootFolderPath; m.ProfileId = ((NetImportDefinition) Definition).ProfileId; m.Monitored = ((NetImportDefinition) Definition).ShouldMonitor; - m.MinimumAvailability = ((NetImportDefinition) Definition).MinimumAvailability; + m.MinimumAvailability = ((NetImportDefinition) Definition).MinimumAvailability; m.Tags = ((NetImportDefinition) Definition).Tags; return m; }).ToList(); diff --git a/src/NzbDrone.Core/NetImport/ImportExclusions/ImportExclusionsRepository.cs b/src/NzbDrone.Core/NetImport/ImportExclusions/ImportExclusionsRepository.cs index 1af12f95e..0da16b38f 100644 --- a/src/NzbDrone.Core/NetImport/ImportExclusions/ImportExclusionsRepository.cs +++ b/src/NzbDrone.Core/NetImport/ImportExclusions/ImportExclusionsRepository.cs @@ -20,12 +20,12 @@ public interface IImportExclusionsRepository : IBasicRepository public class ImportExclusionsRepository : BasicRepository, IImportExclusionsRepository { - protected IMainDatabase _database; + protected IMainDatabase _database; public ImportExclusionsRepository(IMainDatabase database, IEventAggregator eventAggregator) : base(database, eventAggregator) { - _database = database; + _database = database; } public bool IsMovieExcluded(int tmdbid) diff --git a/src/NzbDrone.Core/NetImport/NetImportSearchService.cs b/src/NzbDrone.Core/NetImport/NetImportSearchService.cs index b01dc8d6e..6dc42f8d5 100644 --- a/src/NzbDrone.Core/NetImport/NetImportSearchService.cs +++ b/src/NzbDrone.Core/NetImport/NetImportSearchService.cs @@ -113,7 +113,7 @@ public void Execute(NetImportSyncCommand message) //if there are no lists that are enabled for automatic import then dont do anything if((_netImportFactory.GetAvailableProviders()).Where(a => ((NetImportDefinition)a.Definition).EnableAuto).Empty()) { - _logger.Info("No lists are enabled for auto-import."); + _logger.Info("No lists are enabled for auto-import."); return; } diff --git a/src/NzbDrone.Core/NetImport/Trakt/TraktRequestGenerator.cs b/src/NzbDrone.Core/NetImport/Trakt/TraktRequestGenerator.cs index df1015b23..566fb685e 100644 --- a/src/NzbDrone.Core/NetImport/Trakt/TraktRequestGenerator.cs +++ b/src/NzbDrone.Core/NetImport/Trakt/TraktRequestGenerator.cs @@ -11,7 +11,7 @@ namespace NzbDrone.Core.NetImport.Trakt { public class RefreshRequestResponse { - public string access_token { get; set; } + public string access_token { get; set; } public string token_type { get; set; } public int expires_in { get; set; } public string refresh_token { get; set; } @@ -20,7 +20,7 @@ public class RefreshRequestResponse public class TraktRequestGenerator : INetImportRequestGenerator { - public IConfigService _configService; + public IConfigService _configService; public IHttpClient HttpClient { get; set; } public TraktSettings Settings { get; set; } diff --git a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs index 49e972389..e2852c256 100644 --- a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs +++ b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs @@ -34,7 +34,7 @@ public override void OnDownload(DownloadMessage message) public override void OnMovieRename(Movie movie) { } - + public override string Name => "Notify My Android"; public override ValidationResult Test() diff --git a/src/NzbDrone.Core/Notifications/Pushalot/Pushalot.cs b/src/NzbDrone.Core/Notifications/Pushalot/Pushalot.cs index b41f3181c..05e680a3a 100644 --- a/src/NzbDrone.Core/Notifications/Pushalot/Pushalot.cs +++ b/src/NzbDrone.Core/Notifications/Pushalot/Pushalot.cs @@ -33,7 +33,7 @@ public override void OnDownload(DownloadMessage message) public override void OnMovieRename(Movie movie) { } - + public override string Name => "Pushalot"; public override ValidationResult Test() diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index dad809703..4fd93e6ee 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -18,7 +18,7 @@ public interface IBuildFileNames { string BuildFileName(Movie movie, MovieFile movieFile, NamingConfig namingConfig = null); string BuildFilePath(Movie movie, string fileName, string extension); - string BuildMoviePath(Movie movie, NamingConfig namingConfig = null); + string BuildMoviePath(Movie movie, NamingConfig namingConfig = null); BasicNamingConfig GetBasicNamingConfig(NamingConfig nameSpec); string GetMovieFolder(Movie movie, NamingConfig namingConfig = null); } @@ -214,10 +214,10 @@ public static string TitleThe(string title) { string[] prefixes = { "The ", "An ", "A " }; - if (title.Length < 5) - { - return title; - } + if (title.Length < 5) + { + return title; + } foreach (string prefix in prefixes) { diff --git a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs index 6d0d61464..42f61184c 100644 --- a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs @@ -26,7 +26,7 @@ public class ReleaseInfo public string Codec { get; set; } public string Resolution { get; set; } - public IndexerFlags IndexerFlags { get; set; } + public IndexerFlags IndexerFlags { get; set; } public int Age { @@ -94,18 +94,18 @@ public virtual string ToString(string format) } } - [Flags] - public enum IndexerFlags - { - G_Freeleech = 1, //General - G_Halfleech = 2, //General, only 1/2 of download counted - G_DoubleUpload = 4, //General - PTP_Golden = 8, //PTP - PTP_Approved = 16, //PTP + [Flags] + public enum IndexerFlags + { + G_Freeleech = 1, //General + G_Halfleech = 2, //General, only 1/2 of download counted + G_DoubleUpload = 4, //General + PTP_Golden = 8, //PTP + PTP_Approved = 16, //PTP HDB_Internal = 32, //HDBits, internal - AHD_Internal = 64, // AHD, internal - G_Scene = 128, //General, the torrent comes from the "scene" - G_Freeleech75 = 256, //Currently only used for AHD, signifies a torrent counts towards 75 percent of your download quota. - G_Freeleech25 = 512 //Currently only used for AHD, signifies a torrent counts towards 25 percent of your download quota. - } + AHD_Internal = 64, // AHD, internal + G_Scene = 128, //General, the torrent comes from the "scene" + G_Freeleech75 = 256, //Currently only used for AHD, signifies a torrent counts towards 75 percent of your download quota. + G_Freeleech25 = 512 //Currently only used for AHD, signifies a torrent counts towards 25 percent of your download quota. + } } diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 32cc7c54d..1cd1d2ca4 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -40,8 +40,8 @@ public static class Parser //That did not work? Maybe some tool uses [] for years. Who would do that? new Regex(@"^(?(?![(\[]).+?)?(?:(?:[-_\W](?<![)!]))*(?<year>(1(8|9)|20)\d{2}(?!p|i|\d+|\W\d+)))+(\W+|_|$)(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), - //As a last resort for movies that have ( or [ in their title. - new Regex(@"^(?<title>.+?)?(?:(?:[-_\W](?<![)\[!]))*(?<year>(1(8|9)|20)\d{2}(?!p|i|\d+|\]|\W\d+)))+(\W+|_|$)(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), + //As a last resort for movies that have ( or [ in their title. + new Regex(@"^(?<title>.+?)?(?:(?:[-_\W](?<![)\[!]))*(?<year>(1(8|9)|20)\d{2}(?!p|i|\d+|\]|\W\d+)))+(\W+|_|$)(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), }; @@ -467,40 +467,40 @@ private static ParsedMovieInfo ParseMovieMatchCollection(MatchCollection matchCo var movieName = matchCollection[0].Groups["title"].Value./*Replace('.', ' ').*/Replace('_', ' '); movieName = RequestInfoRegex.Replace(movieName, "").Trim(' '); - var parts = movieName.Split('.'); - movieName = ""; - int n = 0; - bool previousAcronym = false; - string nextPart = ""; - foreach (var part in parts) - { - if (parts.Length >= n+2) - { - nextPart = parts[n+1]; - } - if (part.Length == 1 && part.ToLower() != "a" && !int.TryParse(part, out n)) - { - movieName += part + "."; - previousAcronym = true; - } - else if (part.ToLower() == "a" && (previousAcronym == true || nextPart.Length == 1)) - { - movieName += part + "."; - previousAcronym = true; - } - else - { - if (previousAcronym) - { - movieName += " "; - previousAcronym = false; - } - movieName += part + " "; - } - n++; - } + var parts = movieName.Split('.'); + movieName = ""; + int n = 0; + bool previousAcronym = false; + string nextPart = ""; + foreach (var part in parts) + { + if (parts.Length >= n+2) + { + nextPart = parts[n+1]; + } + if (part.Length == 1 && part.ToLower() != "a" && !int.TryParse(part, out n)) + { + movieName += part + "."; + previousAcronym = true; + } + else if (part.ToLower() == "a" && (previousAcronym == true || nextPart.Length == 1)) + { + movieName += part + "."; + previousAcronym = true; + } + else + { + if (previousAcronym) + { + movieName += " "; + previousAcronym = false; + } + movieName += part + " "; + } + n++; + } - movieName = movieName.Trim(' '); + movieName = movieName.Trim(' '); int airYear; int.TryParse(matchCollection[0].Groups["year"].Value, out airYear); diff --git a/src/NzbDrone.Core/RootFolders/RootFolderService.cs b/src/NzbDrone.Core/RootFolders/RootFolderService.cs index b82b24dea..6621ba41c 100644 --- a/src/NzbDrone.Core/RootFolders/RootFolderService.cs +++ b/src/NzbDrone.Core/RootFolders/RootFolderService.cs @@ -149,7 +149,7 @@ private List<UnmappedFolder> GetUnmappedFolders(string path) foreach (string unmappedFolder in unmappedFolders) { var di = new DirectoryInfo(unmappedFolder.Normalize()); - if ((!di.Attributes.HasFlag(FileAttributes.System) && !di.Attributes.HasFlag(FileAttributes.Hidden)) || di.Attributes.ToString() == "-1") + if ((!di.Attributes.HasFlag(FileAttributes.System) && !di.Attributes.HasFlag(FileAttributes.Hidden)) || di.Attributes.ToString() == "-1") { results.Add(new UnmappedFolder { Name = di.Name, Path = di.FullName }); } diff --git a/src/NzbDrone.Host.Test/ContainerFixture.cs b/src/NzbDrone.Host.Test/ContainerFixture.cs index 08bc392b1..1f1307ef6 100644 --- a/src/NzbDrone.Host.Test/ContainerFixture.cs +++ b/src/NzbDrone.Host.Test/ContainerFixture.cs @@ -71,7 +71,7 @@ public void should_resolve_command_executor_by_name() } [Test] - [Ignore("Shit appveyor")] + [Ignore("Shit appveyor")] public void should_return_same_instance_of_singletons() { var first = _container.ResolveAll<IHandle<ApplicationShutdownRequested>>().OfType<Scheduler>().Single(); diff --git a/src/NzbDrone.Host/CancelHandler.cs b/src/NzbDrone.Host/CancelHandler.cs index 870edbb22..18e1fa992 100644 --- a/src/NzbDrone.Host/CancelHandler.cs +++ b/src/NzbDrone.Host/CancelHandler.cs @@ -30,7 +30,7 @@ private void HandlerCancelKeyPress(object sender, ConsoleCancelEventArgs e) { // Tell system to ignore the Ctrl+C and not terminate. We'll do that. e.Cancel = true; - + var shouldTerminate = false; lock (_syncRoot) { @@ -46,7 +46,7 @@ private void HandlerCancelKeyPress(object sender, ConsoleCancelEventArgs e) else { GracefulShutdown(); - } + } } private void GracefulShutdown() diff --git a/src/Radarr.Api.V3/Config/IndexerConfigResource.cs b/src/Radarr.Api.V3/Config/IndexerConfigResource.cs index a20b2ede5..7092c2971 100644 --- a/src/Radarr.Api.V3/Config/IndexerConfigResource.cs +++ b/src/Radarr.Api.V3/Config/IndexerConfigResource.cs @@ -11,9 +11,9 @@ public class IndexerConfigResource : RestResource public int Retention { get; set; } public int RssSyncInterval { get; set; } public bool PreferIndexerFlags { get; set; } - public int AvailabilityDelay { get; set; } - public bool AllowHardcodedSubs { get; set; } - public string WhitelistedHardcodedSubs { get; set; } + public int AvailabilityDelay { get; set; } + public bool AllowHardcodedSubs { get; set; } + public string WhitelistedHardcodedSubs { get; set; } public ParsingLeniencyType ParsingLeniency { get; set; } } @@ -28,9 +28,9 @@ public static IndexerConfigResource ToResource(IConfigService model) Retention = model.Retention, RssSyncInterval = model.RssSyncInterval, PreferIndexerFlags = model.PreferIndexerFlags, - AvailabilityDelay = model.AvailabilityDelay, - AllowHardcodedSubs = model.AllowHardcodedSubs, - WhitelistedHardcodedSubs = model.WhitelistedHardcodedSubs, + AvailabilityDelay = model.AvailabilityDelay, + AllowHardcodedSubs = model.AllowHardcodedSubs, + WhitelistedHardcodedSubs = model.WhitelistedHardcodedSubs, ParsingLeniency = model.ParsingLeniency, }; } diff --git a/src/Radarr.Api.V3/Config/NetImportConfigResource.cs b/src/Radarr.Api.V3/Config/NetImportConfigResource.cs index 43e6b29e4..ad3b7cab7 100644 --- a/src/Radarr.Api.V3/Config/NetImportConfigResource.cs +++ b/src/Radarr.Api.V3/Config/NetImportConfigResource.cs @@ -6,8 +6,8 @@ namespace Radarr.Api.V3.Config public class NetImportConfigResource : RestResource { public int NetImportSyncInterval { get; set; } - public string ListSyncLevel { get; set; } - public string ImportExclusions { get; set; } + public string ListSyncLevel { get; set; } + public string ImportExclusions { get; set; } } public static class NetImportConfigResourceMapper @@ -17,8 +17,8 @@ public static NetImportConfigResource ToResource(IConfigService model) return new NetImportConfigResource { NetImportSyncInterval = model.NetImportSyncInterval, - ListSyncLevel = model.ListSyncLevel, - ImportExclusions = model.ImportExclusions + ListSyncLevel = model.ListSyncLevel, + ImportExclusions = model.ImportExclusions }; } } diff --git a/src/Radarr.Api.V3/Movies/MovieResource.cs b/src/Radarr.Api.V3/Movies/MovieResource.cs index 7212d42f0..21c7ac2a1 100644 --- a/src/Radarr.Api.V3/Movies/MovieResource.cs +++ b/src/Radarr.Api.V3/Movies/MovieResource.cs @@ -47,7 +47,7 @@ public MovieResource() //Editing Only public bool Monitored { get; set; } - public MovieStatusType MinimumAvailability { get; set; } + public MovieStatusType MinimumAvailability { get; set; } public bool IsAvailable { get; set; } public string FolderName { get; set; } @@ -105,7 +105,7 @@ public static MovieResource ToResource(this Movie model) Monitored = model.Monitored, MinimumAvailability = model.MinimumAvailability, - + IsAvailable = model.IsAvailable(), FolderName = model.FolderName(), @@ -158,7 +158,7 @@ public static Movie ToModel(this MovieResource resource) Monitored = resource.Monitored, MinimumAvailability = resource.MinimumAvailability, - + Runtime = resource.Runtime, LastInfoSync = resource.LastInfoSync, CleanTitle = resource.CleanTitle,