diff --git a/src/NzbDrone.Core.Test/DiskSpace/DiskSpaceServiceFixture.cs b/src/NzbDrone.Core.Test/DiskSpace/DiskSpaceServiceFixture.cs index 53d38eaed..b79de2f3c 100644 --- a/src/NzbDrone.Core.Test/DiskSpace/DiskSpaceServiceFixture.cs +++ b/src/NzbDrone.Core.Test/DiskSpace/DiskSpaceServiceFixture.cs @@ -9,7 +9,7 @@ using NzbDrone.Common.Disk; using NzbDrone.Core.Configuration; using NzbDrone.Core.DiskSpace; using NzbDrone.Core.Test.Framework; -using NzbDrone.Core.Tv; +using NzbDrone.Core.Music; using NzbDrone.Test.Common; namespace NzbDrone.Core.Test.DiskSpace @@ -17,16 +17,14 @@ namespace NzbDrone.Core.Test.DiskSpace [TestFixture] public class DiskSpaceServiceFixture : CoreTest { - private string _seriesFolder; - private string _seriesFolder2; - private string _droneFactoryFolder; + private string _artistFolder; + private string _artostFolder2; [SetUp] public void SetUp() { - _seriesFolder = @"G:\fasdlfsdf\series".AsOsAgnostic(); - _seriesFolder2 = @"G:\fasdlfsdf\series2".AsOsAgnostic(); - _droneFactoryFolder = @"G:\dronefactory".AsOsAgnostic(); + _artistFolder = @"G:\fasdlfsdf\artist".AsOsAgnostic(); + _artostFolder2 = @"G:\fasdlfsdf\artist2".AsOsAgnostic(); Mocker.GetMock() .Setup(v => v.GetMounts()) @@ -44,14 +42,14 @@ namespace NzbDrone.Core.Test.DiskSpace .Setup(v => v.GetTotalSize(It.IsAny())) .Returns(0); - GivenSeries(); + GivenArtist(); } - private void GivenSeries(params Series[] series) + private void GivenArtist(params Artist[] artist) { - Mocker.GetMock() - .Setup(v => v.GetAllSeries()) - .Returns(series.ToList()); + Mocker.GetMock() + .Setup(v => v.GetAllArtists()) + .Returns(artist.ToList()); } private void GivenExistingFolder(string folder) @@ -62,11 +60,11 @@ namespace NzbDrone.Core.Test.DiskSpace } [Test] - public void should_check_diskspace_for_series_folders() + public void should_check_diskspace_for_artist_folders() { - GivenSeries(new Series { Path = _seriesFolder }); + GivenArtist(new Artist { Path = _artistFolder }); - GivenExistingFolder(_seriesFolder); + GivenExistingFolder(_artistFolder); var freeSpace = Subject.GetFreeSpace(); @@ -76,10 +74,10 @@ namespace NzbDrone.Core.Test.DiskSpace [Test] public void should_check_diskspace_for_same_root_folder_only_once() { - GivenSeries(new Series { Path = _seriesFolder }, new Series { Path = _seriesFolder2 }); + GivenArtist(new Artist { Path = _artistFolder }, new Artist { Path = _artostFolder2 }); - GivenExistingFolder(_seriesFolder); - GivenExistingFolder(_seriesFolder2); + GivenExistingFolder(_artistFolder); + GivenExistingFolder(_artostFolder2); var freeSpace = Subject.GetFreeSpace(); @@ -90,9 +88,9 @@ namespace NzbDrone.Core.Test.DiskSpace } [Test] - public void should_not_check_diskspace_for_missing_series_folders() + public void should_not_check_diskspace_for_missing_artist_folders() { - GivenSeries(new Series { Path = _seriesFolder }); + GivenArtist(new Artist { Path = _artistFolder }); var freeSpace = Subject.GetFreeSpace(); diff --git a/src/NzbDrone.Core.Test/Download/FailedDownloadServiceFixture.cs b/src/NzbDrone.Core.Test/Download/FailedDownloadServiceFixture.cs index 42b589e6b..420647de4 100644 --- a/src/NzbDrone.Core.Test/Download/FailedDownloadServiceFixture.cs +++ b/src/NzbDrone.Core.Test/Download/FailedDownloadServiceFixture.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using FizzWare.NBuilder; using FluentAssertions; using Moq; @@ -10,7 +10,7 @@ using NzbDrone.Core.History; using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Test.Framework; -using NzbDrone.Core.Tv; +using NzbDrone.Core.Music; using NzbDrone.Test.Common; namespace NzbDrone.Core.Test.Download @@ -27,21 +27,21 @@ namespace NzbDrone.Core.Test.Download var completed = Builder.CreateNew() .With(h => h.Status = DownloadItemStatus.Completed) .With(h => h.OutputPath = new OsPath(@"C:\DropFolder\MyDownload".AsOsAgnostic())) - .With(h => h.Title = "Drone.S01E01.HDTV") + .With(h => h.Title = "Drone.DroneTheAlbum.FLAC") .Build(); _grabHistory = Builder.CreateListOfSize(2).BuildList(); - var remoteEpisode = new RemoteEpisode + var remoteAlbum = new RemoteAlbum { - Series = new Series(), - Episodes = new List { new Episode { Id = 1 } } + Artist = new Artist(), + Albums = new List { new Album { Id = 1 } } }; _trackedDownload = Builder.CreateNew() .With(c => c.State = TrackedDownloadStage.Downloading) .With(c => c.DownloadItem = completed) - .With(c => c.RemoteEpisode = remoteEpisode) + .With(c => c.RemoteAlbum = remoteAlbum) .Build(); diff --git a/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs b/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs index 5e2352a07..74e9b0945 100644 --- a/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs +++ b/src/NzbDrone.Core/DiskSpace/DiskSpaceService.cs @@ -1,11 +1,11 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; using NLog; using NzbDrone.Common.Disk; -using NzbDrone.Core.Tv; +using NzbDrone.Core.Music; namespace NzbDrone.Core.DiskSpace { @@ -16,22 +16,22 @@ namespace NzbDrone.Core.DiskSpace public class DiskSpaceService : IDiskSpaceService { - private readonly ISeriesService _seriesService; + private readonly IArtistService _artistService; private readonly IDiskProvider _diskProvider; private readonly Logger _logger; private static readonly Regex _regexSpecialDrive = new Regex("^/var/lib/(docker|rancher|kubelet)(/|$)|^/boot(/|$)|/docker(/var)?/aufs(/|$)", RegexOptions.Compiled); - public DiskSpaceService(ISeriesService seriesService, IDiskProvider diskProvider, Logger logger) + public DiskSpaceService(IArtistService artistService, IDiskProvider diskProvider, Logger logger) { - _seriesService = seriesService; + _artistService = artistService; _diskProvider = diskProvider; _logger = logger; } public List GetFreeSpace() { - var importantRootFolders = GetSeriesRootPaths().Distinct().ToList(); + var importantRootFolders = GetArtistRootPaths().Distinct().ToList(); var optionalRootFolders = GetFixedDisksRootPaths().Except(importantRootFolders).Distinct().ToList(); @@ -40,9 +40,9 @@ namespace NzbDrone.Core.DiskSpace return diskSpace; } - private IEnumerable GetSeriesRootPaths() + private IEnumerable GetArtistRootPaths() { - return _seriesService.GetAllSeries() + return _artistService.GetAllArtists() .Where(s => _diskProvider.FolderExists(s.Path)) .Select(s => _diskProvider.GetPathRoot(s.Path)) .Distinct(); diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index e1bed98db..dd1c4f8e6 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -37,15 +37,9 @@ namespace NzbDrone.Core.Organizer private static readonly Regex TitleRegex = new Regex(@"\{(?[- ._\[(]*)(?(?:[a-z0-9]+)(?:(?[- ._]+)(?:[a-z0-9]+))?)(?::(?[a-z0-9]+))?(?[- ._)\]]*)\}", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex EpisodeRegex = new Regex(@"(?\{episode(?:\:0+)?})", - RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex TrackRegex = new Regex(@"(?\{track(?:\:0+)?})", RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex SeasonRegex = new Regex(@"(?\{season(?:\:0+)?})", - RegexOptions.Compiled | RegexOptions.IgnoreCase); - private static readonly Regex AbsoluteEpisodeRegex = new Regex(@"(?\{absolute(?:\:0+)?})", RegexOptions.Compiled | RegexOptions.IgnoreCase); @@ -300,18 +294,6 @@ namespace NzbDrone.Core.Organizer tokenHandlers["{Release Group}"] = m => trackFile.ReleaseGroup ?? m.DefaultValue("Lidarr"); } - private void AddQualityTokens(Dictionary> tokenHandlers, Series series, EpisodeFile episodeFile) - { - var qualityTitle = _qualityDefinitionService.Get(episodeFile.Quality.Quality).Title; - var qualityProper = GetQualityProper(series, episodeFile.Quality); - var qualityReal = GetQualityReal(series, episodeFile.Quality); - - tokenHandlers["{Quality Full}"] = m => String.Format("{0} {1} {2}", qualityTitle, qualityProper, qualityReal); - tokenHandlers["{Quality Title}"] = m => qualityTitle; - tokenHandlers["{Quality Proper}"] = m => qualityProper; - tokenHandlers["{Quality Real}"] = m => qualityReal; - } - private void AddQualityTokens(Dictionary> tokenHandlers, Artist artist, TrackFile trackFile) { var qualityTitle = _qualityDefinitionService.Get(trackFile.Quality.Quality).Title; @@ -515,40 +497,31 @@ namespace NzbDrone.Core.Organizer return MultiPartCleanupRegex.Replace(title, string.Empty).Trim(); } - private string GetQualityProper(Series series, QualityModel quality) - { - if (quality.Revision.Version > 1) - { - if (series.SeriesType == SeriesTypes.Anime) - { - return "v" + quality.Revision.Version; - } - - return "Proper"; - } - - return String.Empty; - } + // TODO: DO WE NEED FOR MUSIC? + //private string GetQualityProper(Series series, QualityModel quality) + //{ + // if (quality.Revision.Version > 1) + // { + // if (series.SeriesType == SeriesTypes.Anime) + // { + // return "v" + quality.Revision.Version; + // } - private string GetQualityReal(Series series, QualityModel quality) - { - if (quality.Revision.Real > 0) - { - return "REAL"; - } + // return "Proper"; + // } - return string.Empty; - } + // return String.Empty; + //} - private string GetOriginalTitle(EpisodeFile episodeFile) - { - if (episodeFile.SceneName.IsNullOrWhiteSpace()) - { - return GetOriginalFileName(episodeFile); - } + //private string GetQualityReal(Series series, QualityModel quality) + //{ + // if (quality.Revision.Real > 0) + // { + // return "REAL"; + // } - return episodeFile.SceneName; - } + // return string.Empty; + //} private string GetOriginalTitle(TrackFile trackFile) { @@ -560,16 +533,6 @@ namespace NzbDrone.Core.Organizer return trackFile.SceneName; } - private string GetOriginalFileName(EpisodeFile episodeFile) - { - if (episodeFile.RelativePath.IsNullOrWhiteSpace()) - { - return Path.GetFileNameWithoutExtension(episodeFile.Path); - } - - return Path.GetFileNameWithoutExtension(episodeFile.RelativePath); - } - private string GetOriginalFileName(TrackFile trackFile) { if (trackFile.RelativePath.IsNullOrWhiteSpace()) diff --git a/src/NzbDrone.Core/Organizer/SampleResult.cs b/src/NzbDrone.Core/Organizer/SampleResult.cs index 3075032ce..e118f1037 100644 --- a/src/NzbDrone.Core/Organizer/SampleResult.cs +++ b/src/NzbDrone.Core/Organizer/SampleResult.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.Tv; using NzbDrone.Core.Music; @@ -8,7 +8,6 @@ namespace NzbDrone.Core.Organizer public class SampleResult { public string FileName { get; set; } - public Series Series { get; set; } public Artist Artist { get; set; } public Album Album { get; set; } public List Episodes { get; set; } diff --git a/src/NzbDrone.SignalR/SonarrPerformanceCounterManager.cs b/src/NzbDrone.SignalR/LidarrPerformanceCounterManager.cs similarity index 100% rename from src/NzbDrone.SignalR/SonarrPerformanceCounterManager.cs rename to src/NzbDrone.SignalR/LidarrPerformanceCounterManager.cs diff --git a/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj b/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj index 1eb74d8dc..bb075487f 100644 --- a/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj +++ b/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj @@ -86,7 +86,7 @@ - +