Fixes after rebase

pull/3113/head
Mark McDowall 11 years ago
parent 409e1cca94
commit e9db0fc14a

@ -50,7 +50,6 @@ namespace NzbDrone.Api.Test.MappingTests
MappingValidation.ValidateMapping(modelType, resourceType);
}
[Test]
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 TitleSlug { 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
{
public class IsParentFixtureBase<TSubject> : TestBase<TSubject> where TSubject : class, IDiskProvider
public class IsParentFixture : TestBase
{
private string _parent = @"C:\Test".AsOsAgnostic();
@ -15,7 +14,7 @@ namespace NzbDrone.Common.Test.DiskProviderTests
{
var path = @"C:\Another Folder".AsOsAgnostic();
DiskProvider.IsParent(_parent, path).Should().BeFalse();
DiskProviderBase.IsParent(_parent, path).Should().BeFalse();
}
[Test]
@ -23,7 +22,7 @@ namespace NzbDrone.Common.Test.DiskProviderTests
{
var path = @"C:\Test\TV".AsOsAgnostic();
DiskProvider.IsParent(_parent, path).Should().BeTrue();
DiskProviderBase.IsParent(_parent, path).Should().BeTrue();
}
[Test]
@ -31,7 +30,7 @@ namespace NzbDrone.Common.Test.DiskProviderTests
{
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
{
void CopyFile(string source, string destination, bool overwrite = false);
enum TransferAction
{
Copy,
@ -26,7 +25,6 @@ namespace NzbDrone.Common.Disk
public abstract void SetPermissions(string path, string mask, string user, string group);
public abstract long? GetTotalSize(string path);
//TODO: this needs tests
public static string GetRelativePath(string parentPath, string childPath)
{
if (!IsParent(parentPath, childPath))
@ -272,11 +270,6 @@ namespace NzbDrone.Common.Disk
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)
{
Ensure.That(path, () => path).IsValidPath();

@ -37,7 +37,6 @@ namespace NzbDrone.Common.Disk
string GetPathRoot(string path);
string GetParentFolder(string path);
void SetPermissions(string filename, WellKnownSidType accountSid, FileSystemRights rights, AccessControlType controlType);
bool IsParent(string parentPath, string childPath);
void SetFolderWriteTime(string path, DateTime time);
FileAttributes GetFileAttributes(string path);
void EmptyFolder(string path);

@ -1,5 +1,4 @@
using System.Linq;
using FizzWare.NBuilder;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Housekeeping.Housekeepers;

@ -122,15 +122,6 @@ namespace NzbDrone.Core.Test.MediaFiles
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]
public void should_import_larger_files_first()
{

@ -48,7 +48,7 @@ namespace NzbDrone.Core.MediaFiles
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);
_mediaFileService.Delete(episodeFile);

@ -7,6 +7,7 @@ using System.Xml;
using System.Xml.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Disk;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Metadata.Files;
using NzbDrone.Core.Tv;

@ -8,6 +8,7 @@ using System.Xml;
using System.Xml.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Disk;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MediaFiles;
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 episodeFilenameWithoutExtension =
Path.GetFileNameWithoutExtension(DiskProvider.GetRelativePath(series.Path, episodeFile.Path));
Path.GetFileNameWithoutExtension(DiskProviderBase.GetRelativePath(series.Path, episodeFile.Path));
foreach (var metadataFile in metadataFiles)
{
@ -122,7 +123,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
{
SeriesId = series.Id,
Consumer = GetType().Name,
RelativePath = DiskProvider.GetRelativePath(series.Path, path)
RelativePath = DiskProviderBase.GetRelativePath(series.Path, path)
};
if (SeriesImagesRegex.IsMatch(filename))
@ -235,7 +236,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
SeriesId = series.Id,
Consumer = GetType().Name,
Type = MetadataType.SeriesMetadata,
RelativePath = DiskProvider.GetRelativePath(series.Path, path)
RelativePath = DiskProviderBase.GetRelativePath(series.Path, path)
};
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
@ -264,7 +265,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
SeriesId = series.Id,
Consumer = GetType().Name,
Type = MetadataType.SeriesImage,
RelativePath = DiskProvider.GetRelativePath(series.Path, destination)
RelativePath = DiskProviderBase.GetRelativePath(series.Path, destination)
};
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
@ -296,7 +297,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
SeasonNumber = season.SeasonNumber,
Consumer = GetType().Name,
Type = MetadataType.SeriesMetadata,
RelativePath = DiskProvider.GetRelativePath(series.Path, path)
RelativePath = DiskProviderBase.GetRelativePath(series.Path, path)
};
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
@ -355,7 +356,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
EpisodeFileId = episodeFile.Id,
Consumer = GetType().Name,
Type = MetadataType.SeasonImage,
RelativePath = DiskProvider.GetRelativePath(series.Path, filename)
RelativePath = DiskProviderBase.GetRelativePath(series.Path, filename)
};
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));
@ -375,7 +376,7 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
EpisodeFileId = episodeFile.Id,
Consumer = GetType().Name,
Type = MetadataType.SeasonImage,
RelativePath = DiskProvider.GetRelativePath(series.Path, filename)
RelativePath = DiskProviderBase.GetRelativePath(series.Path, filename)
};
_eventAggregator.PublishEvent(new MetadataFileUpdated(metadata));

@ -3,6 +3,7 @@ using System.IO;
using System.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Disk;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Metadata.Files;

@ -4,6 +4,7 @@ using System.IO;
using System.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Disk;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tv;

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Net;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Disk;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Metadata.Files;
using NzbDrone.Core.ThingiProvider;

@ -64,7 +64,7 @@ namespace NzbDrone.Core.Parser
Episodes = episodes,
Path = filename,
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>
<Compile Include="DiskProviderTests\DiskProviderFixture.cs" />
<Compile Include="DiskProviderTests\FreeSpaceFixture.cs" />
<Compile Include="DiskProviderTests\IsParentFixture.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ServiceFactoryFixture.cs" />
</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" />
</ItemGroup>
<ItemGroup>
<Compile Include="DiskProviderTests\IsParentFixture.cs" />
<Compile Include="DiskProviderTests\DiskProviderFixture.cs" />
<Compile Include="DiskProviderTests\FreeSpaceFixture.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

Loading…
Cancel
Save