mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-03-03 15:12:13 +02:00
Fixes after rebase
This commit is contained in:
parent
409e1cca94
commit
e9db0fc14a
@ -50,7 +50,6 @@ namespace NzbDrone.Api.Test.MappingTests
|
|||||||
MappingValidation.ValidateMapping(modelType, resourceType);
|
MappingValidation.ValidateMapping(modelType, resourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_map_lay_loaded_values_should_not_be_inject_if_not_loaded()
|
public void should_map_lay_loaded_values_should_not_be_inject_if_not_loaded()
|
||||||
{
|
{
|
||||||
|
@ -59,5 +59,7 @@ namespace NzbDrone.Api.Series
|
|||||||
public String ImdbId { get; set; }
|
public String ImdbId { get; set; }
|
||||||
public String TitleSlug { get; set; }
|
public String TitleSlug { get; set; }
|
||||||
public String RootFolderPath { get; set; }
|
public String RootFolderPath { get; set; }
|
||||||
|
public String Certification { get; set; }
|
||||||
|
public List<String> Genres { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ using NzbDrone.Test.Common;
|
|||||||
|
|
||||||
namespace NzbDrone.Common.Test.DiskProviderTests
|
namespace NzbDrone.Common.Test.DiskProviderTests
|
||||||
{
|
{
|
||||||
public class IsParentFixtureBase<TSubject> : TestBase<TSubject> where TSubject : class, IDiskProvider
|
|
||||||
public class IsParentFixture : TestBase
|
public class IsParentFixture : TestBase
|
||||||
{
|
{
|
||||||
private string _parent = @"C:\Test".AsOsAgnostic();
|
private string _parent = @"C:\Test".AsOsAgnostic();
|
||||||
@ -15,7 +14,7 @@ namespace NzbDrone.Common.Test.DiskProviderTests
|
|||||||
{
|
{
|
||||||
var path = @"C:\Another Folder".AsOsAgnostic();
|
var path = @"C:\Another Folder".AsOsAgnostic();
|
||||||
|
|
||||||
DiskProvider.IsParent(_parent, path).Should().BeFalse();
|
DiskProviderBase.IsParent(_parent, path).Should().BeFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -23,7 +22,7 @@ namespace NzbDrone.Common.Test.DiskProviderTests
|
|||||||
{
|
{
|
||||||
var path = @"C:\Test\TV".AsOsAgnostic();
|
var path = @"C:\Test\TV".AsOsAgnostic();
|
||||||
|
|
||||||
DiskProvider.IsParent(_parent, path).Should().BeTrue();
|
DiskProviderBase.IsParent(_parent, path).Should().BeTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -31,7 +30,7 @@ namespace NzbDrone.Common.Test.DiskProviderTests
|
|||||||
{
|
{
|
||||||
var path = @"C:\Test\30.Rock.S01E01.Pilot.avi".AsOsAgnostic();
|
var path = @"C:\Test\30.Rock.S01E01.Pilot.avi".AsOsAgnostic();
|
||||||
|
|
||||||
DiskProvider.IsParent(_parent, path).Should().BeTrue();
|
DiskProviderBase.IsParent(_parent, path).Should().BeTrue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ namespace NzbDrone.Common.Disk
|
|||||||
{
|
{
|
||||||
public abstract class DiskProviderBase : IDiskProvider
|
public abstract class DiskProviderBase : IDiskProvider
|
||||||
{
|
{
|
||||||
void CopyFile(string source, string destination, bool overwrite = false);
|
|
||||||
enum TransferAction
|
enum TransferAction
|
||||||
{
|
{
|
||||||
Copy,
|
Copy,
|
||||||
@ -26,7 +25,6 @@ namespace NzbDrone.Common.Disk
|
|||||||
public abstract void SetPermissions(string path, string mask, string user, string group);
|
public abstract void SetPermissions(string path, string mask, string user, string group);
|
||||||
public abstract long? GetTotalSize(string path);
|
public abstract long? GetTotalSize(string path);
|
||||||
|
|
||||||
//TODO: this needs tests
|
|
||||||
public static string GetRelativePath(string parentPath, string childPath)
|
public static string GetRelativePath(string parentPath, string childPath)
|
||||||
{
|
{
|
||||||
if (!IsParent(parentPath, childPath))
|
if (!IsParent(parentPath, childPath))
|
||||||
@ -272,11 +270,6 @@ namespace NzbDrone.Common.Disk
|
|||||||
File.Move(source, destination);
|
File.Move(source, destination);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CopyFile(string source, string destination, bool overwrite = false)
|
|
||||||
{
|
|
||||||
File.Copy(source, destination, overwrite);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeleteFolder(string path, bool recursive)
|
public void DeleteFolder(string path, bool recursive)
|
||||||
{
|
{
|
||||||
Ensure.That(path, () => path).IsValidPath();
|
Ensure.That(path, () => path).IsValidPath();
|
||||||
|
@ -37,7 +37,6 @@ namespace NzbDrone.Common.Disk
|
|||||||
string GetPathRoot(string path);
|
string GetPathRoot(string path);
|
||||||
string GetParentFolder(string path);
|
string GetParentFolder(string path);
|
||||||
void SetPermissions(string filename, WellKnownSidType accountSid, FileSystemRights rights, AccessControlType controlType);
|
void SetPermissions(string filename, WellKnownSidType accountSid, FileSystemRights rights, AccessControlType controlType);
|
||||||
bool IsParent(string parentPath, string childPath);
|
|
||||||
void SetFolderWriteTime(string path, DateTime time);
|
void SetFolderWriteTime(string path, DateTime time);
|
||||||
FileAttributes GetFileAttributes(string path);
|
FileAttributes GetFileAttributes(string path);
|
||||||
void EmptyFolder(string path);
|
void EmptyFolder(string path);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System.Linq;
|
using FizzWare.NBuilder;
|
||||||
using FizzWare.NBuilder;
|
|
||||||
using FluentAssertions;
|
using FluentAssertions;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using NzbDrone.Core.Housekeeping.Housekeepers;
|
using NzbDrone.Core.Housekeeping.Housekeepers;
|
||||||
|
@ -122,15 +122,6 @@ namespace NzbDrone.Core.Test.MediaFiles
|
|||||||
Times.Never());
|
Times.Never());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void should_not_trigger_EpisodeImportedEvent_for_existing_files()
|
|
||||||
{
|
|
||||||
Subject.Import(new List<ImportDecision> { _approvedDecisions.First() });
|
|
||||||
|
|
||||||
Mocker.GetMock<IEventAggregator>()
|
|
||||||
.Verify(v => v.PublishEvent(It.IsAny<EpisodeImportedEvent>()), Times.Never());
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_import_larger_files_first()
|
public void should_import_larger_files_first()
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@ namespace NzbDrone.Core.MediaFiles
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DiskProvider.IsParent(series.Path, episodeFile.Path))
|
if (!DiskProviderBase.IsParent(series.Path, episodeFile.Path))
|
||||||
{
|
{
|
||||||
_logger.Trace("File [{0}] does not belong to this series, removing from db", episodeFile.Path);
|
_logger.Trace("File [{0}] does not belong to this series, removing from db", episodeFile.Path);
|
||||||
_mediaFileService.Delete(episodeFile);
|
_mediaFileService.Delete(episodeFile);
|
||||||
|
@ -7,6 +7,7 @@ using System.Xml;
|
|||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common;
|
using NzbDrone.Common;
|
||||||
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
using NzbDrone.Core.Metadata.Files;
|
using NzbDrone.Core.Metadata.Files;
|
||||||
using NzbDrone.Core.Tv;
|
using NzbDrone.Core.Tv;
|
||||||
|
@ -8,6 +8,7 @@ using System.Xml;
|
|||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common;
|
using NzbDrone.Common;
|
||||||
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Core.MediaCover;
|
using NzbDrone.Core.MediaCover;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
@ -91,7 +92,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
|
|||||||
{
|
{
|
||||||
var metadataFiles = episodeFilesMetadata.Where(m => m.EpisodeFileId == episodeFile.Id).ToList();
|
var metadataFiles = episodeFilesMetadata.Where(m => m.EpisodeFileId == episodeFile.Id).ToList();
|
||||||
var episodeFilenameWithoutExtension =
|
var episodeFilenameWithoutExtension =
|
||||||
Path.GetFileNameWithoutExtension(DiskProvider.GetRelativePath(series.Path, episodeFile.Path));
|
Path.GetFileNameWithoutExtension(DiskProviderBase.GetRelativePath(series.Path, episodeFile.Path));
|
||||||
|
|
||||||
foreach (var metadataFile in metadataFiles)
|
foreach (var metadataFile in metadataFiles)
|
||||||
{
|
{
|
||||||
@ -122,7 +123,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
|
|||||||
{
|
{
|
||||||
SeriesId = series.Id,
|
SeriesId = series.Id,
|
||||||
Consumer = GetType().Name,
|
Consumer = GetType().Name,
|
||||||
RelativePath = DiskProvider.GetRelativePath(series.Path, path)
|
RelativePath = DiskProviderBase.GetRelativePath(series.Path, path)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (SeriesImagesRegex.IsMatch(filename))
|
if (SeriesImagesRegex.IsMatch(filename))
|
||||||
@ -235,7 +236,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
|
|||||||
SeriesId = series.Id,
|
SeriesId = series.Id,
|
||||||
Consumer = GetType().Name,
|
Consumer = GetType().Name,
|
||||||
Type = MetadataType.SeriesMetadata,
|
Type = MetadataType.SeriesMetadata,
|
||||||
RelativePath = DiskProvider.GetRelativePath(series.Path, path)
|
RelativePath = DiskProviderBase.GetRelativePath(series.Path, path)
|
||||||
};
|
};
|
||||||
|
|
||||||
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
|
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
|
||||||
@ -264,7 +265,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
|
|||||||
SeriesId = series.Id,
|
SeriesId = series.Id,
|
||||||
Consumer = GetType().Name,
|
Consumer = GetType().Name,
|
||||||
Type = MetadataType.SeriesImage,
|
Type = MetadataType.SeriesImage,
|
||||||
RelativePath = DiskProvider.GetRelativePath(series.Path, destination)
|
RelativePath = DiskProviderBase.GetRelativePath(series.Path, destination)
|
||||||
};
|
};
|
||||||
|
|
||||||
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
|
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
|
||||||
@ -296,7 +297,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
|
|||||||
SeasonNumber = season.SeasonNumber,
|
SeasonNumber = season.SeasonNumber,
|
||||||
Consumer = GetType().Name,
|
Consumer = GetType().Name,
|
||||||
Type = MetadataType.SeriesMetadata,
|
Type = MetadataType.SeriesMetadata,
|
||||||
RelativePath = DiskProvider.GetRelativePath(series.Path, path)
|
RelativePath = DiskProviderBase.GetRelativePath(series.Path, path)
|
||||||
};
|
};
|
||||||
|
|
||||||
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
|
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
|
||||||
@ -355,7 +356,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
|
|||||||
EpisodeFileId = episodeFile.Id,
|
EpisodeFileId = episodeFile.Id,
|
||||||
Consumer = GetType().Name,
|
Consumer = GetType().Name,
|
||||||
Type = MetadataType.SeasonImage,
|
Type = MetadataType.SeasonImage,
|
||||||
RelativePath = DiskProvider.GetRelativePath(series.Path, filename)
|
RelativePath = DiskProviderBase.GetRelativePath(series.Path, filename)
|
||||||
};
|
};
|
||||||
|
|
||||||
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
|
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
|
||||||
@ -375,7 +376,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
|
|||||||
EpisodeFileId = episodeFile.Id,
|
EpisodeFileId = episodeFile.Id,
|
||||||
Consumer = GetType().Name,
|
Consumer = GetType().Name,
|
||||||
Type = MetadataType.SeasonImage,
|
Type = MetadataType.SeasonImage,
|
||||||
RelativePath = DiskProvider.GetRelativePath(series.Path, filename)
|
RelativePath = DiskProviderBase.GetRelativePath(series.Path, filename)
|
||||||
};
|
};
|
||||||
|
|
||||||
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
|
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
|
||||||
|
@ -3,6 +3,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common;
|
using NzbDrone.Common;
|
||||||
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
using NzbDrone.Core.Metadata.Files;
|
using NzbDrone.Core.Metadata.Files;
|
||||||
|
@ -4,6 +4,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common;
|
using NzbDrone.Common;
|
||||||
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Core.MediaFiles.Events;
|
using NzbDrone.Core.MediaFiles.Events;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
using NzbDrone.Core.Tv;
|
using NzbDrone.Core.Tv;
|
||||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common;
|
using NzbDrone.Common;
|
||||||
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
using NzbDrone.Core.Metadata.Files;
|
using NzbDrone.Core.Metadata.Files;
|
||||||
using NzbDrone.Core.ThingiProvider;
|
using NzbDrone.Core.ThingiProvider;
|
||||||
|
@ -64,7 +64,7 @@ namespace NzbDrone.Core.Parser
|
|||||||
Episodes = episodes,
|
Episodes = episodes,
|
||||||
Path = filename,
|
Path = filename,
|
||||||
ParsedEpisodeInfo = parsedEpisodeInfo,
|
ParsedEpisodeInfo = parsedEpisodeInfo,
|
||||||
ExistingFile = DiskProvider.IsParent(series.Path, filename)
|
ExistingFile = DiskProviderBase.IsParent(series.Path, filename)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
using NUnit.Framework;
|
|
||||||
using NzbDrone.Common.Test.DiskProviderTests;
|
|
||||||
|
|
||||||
namespace NzbDrone.Mono.Test.DiskProviderTests
|
|
||||||
{
|
|
||||||
[TestFixture]
|
|
||||||
public class IsParentFixtureFixture : IsParentFixtureBase<DiskProvider>
|
|
||||||
{
|
|
||||||
public IsParentFixtureFixture()
|
|
||||||
{
|
|
||||||
LinuxOnly();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -68,7 +68,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="DiskProviderTests\DiskProviderFixture.cs" />
|
<Compile Include="DiskProviderTests\DiskProviderFixture.cs" />
|
||||||
<Compile Include="DiskProviderTests\FreeSpaceFixture.cs" />
|
<Compile Include="DiskProviderTests\FreeSpaceFixture.cs" />
|
||||||
<Compile Include="DiskProviderTests\IsParentFixture.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="ServiceFactoryFixture.cs" />
|
<Compile Include="ServiceFactoryFixture.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
using NUnit.Framework;
|
|
||||||
using NzbDrone.Common.Test.DiskProviderTests;
|
|
||||||
|
|
||||||
namespace NzbDrone.Windows.Test.DiskProviderTests
|
|
||||||
{
|
|
||||||
[TestFixture]
|
|
||||||
public class IsParentFixtureFixture : IsParentFixtureBase<DiskProvider>
|
|
||||||
{
|
|
||||||
public IsParentFixtureFixture()
|
|
||||||
{
|
|
||||||
WindowsOnly();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -67,7 +67,6 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="DiskProviderTests\IsParentFixture.cs" />
|
|
||||||
<Compile Include="DiskProviderTests\DiskProviderFixture.cs" />
|
<Compile Include="DiskProviderTests\DiskProviderFixture.cs" />
|
||||||
<Compile Include="DiskProviderTests\FreeSpaceFixture.cs" />
|
<Compile Include="DiskProviderTests\FreeSpaceFixture.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user