Metadata issues with renaming resolved

This commit is contained in:
Mark McDowall 2012-07-14 01:17:37 -07:00
parent f296f38742
commit 1d2cd49bde
5 changed files with 27 additions and 9 deletions

View File

@ -69,12 +69,13 @@ namespace NzbDrone.Core.Jobs
{ {
try try
{ {
var oldFile = new EpisodeFile(episodeFile);
var newFile = _diskScanProvider.MoveEpisodeFile(episodeFile); var newFile = _diskScanProvider.MoveEpisodeFile(episodeFile);
if (newFile != null) if (newFile != null)
{ {
newEpisodeFiles.Add(newFile); newEpisodeFiles.Add(newFile);
oldEpisodeFiles.Add(episodeFile); oldEpisodeFiles.Add(oldFile);
} }
} }

View File

@ -66,12 +66,13 @@ namespace NzbDrone.Core.Jobs
{ {
try try
{ {
var oldFile = new EpisodeFile(episodeFile);
var newFile = _diskScanProvider.MoveEpisodeFile(episodeFile); var newFile = _diskScanProvider.MoveEpisodeFile(episodeFile);
if (newFile != null) if (newFile != null)
{ {
newEpisodeFiles.Add(newFile); newEpisodeFiles.Add(newFile);
oldEpisodeFiles.Add(episodeFile); oldEpisodeFiles.Add(oldFile);
} }
} }

View File

@ -16,7 +16,8 @@ namespace NzbDrone.Core.Providers.Metadata
{ {
public class Xbmc : MetadataBase public class Xbmc : MetadataBase
{ {
public Xbmc(ConfigProvider configProvider, DiskProvider diskProvider, BannerProvider bannerProvider, EpisodeProvider episodeProvider) public Xbmc(ConfigProvider configProvider, DiskProvider diskProvider,
BannerProvider bannerProvider, EpisodeProvider episodeProvider)
: base(configProvider, diskProvider, bannerProvider, episodeProvider) : base(configProvider, diskProvider, bannerProvider, episodeProvider)
{ {
} }

View File

@ -21,7 +21,8 @@ namespace NzbDrone.Core.Providers
private readonly TvDbProvider _tvDbProvider; private readonly TvDbProvider _tvDbProvider;
[Inject] [Inject]
public MetadataProvider(IDatabase database, IEnumerable<MetadataBase> metadataProviders, TvDbProvider tvDbProvider) public MetadataProvider(IDatabase database, IEnumerable<MetadataBase> metadataProviders,
TvDbProvider tvDbProvider)
{ {
_database = database; _database = database;
_metadataProviders = metadataProviders; _metadataProviders = metadataProviders;
@ -121,6 +122,9 @@ namespace NzbDrone.Core.Providers
public virtual void CreateForEpisodeFiles(List<EpisodeFile> episodeFiles) public virtual void CreateForEpisodeFiles(List<EpisodeFile> episodeFiles)
{ {
if (episodeFiles == null || !episodeFiles.Any())
return;
var tvDbSeries = _tvDbProvider.GetSeries(episodeFiles.First().SeriesId, true, true); var tvDbSeries = _tvDbProvider.GetSeries(episodeFiles.First().SeriesId, true, true);
foreach(var episodeFile in episodeFiles) foreach(var episodeFile in episodeFiles)
@ -158,10 +162,5 @@ namespace NzbDrone.Core.Providers
} }
} }
} }
public virtual void RenameForEpisodeFile(EpisodeFile episodeFile)
{
}
} }
} }

View File

@ -9,6 +9,22 @@ namespace NzbDrone.Core.Repository
[PrimaryKey("EpisodeFileId", autoIncrement = true)] [PrimaryKey("EpisodeFileId", autoIncrement = true)]
public class EpisodeFile public class EpisodeFile
{ {
public EpisodeFile()
{
}
public EpisodeFile(EpisodeFile source)
{
EpisodeFileId = source.EpisodeFileId;
SeriesId = source.SeriesId;
SeasonNumber = source.SeasonNumber;
Path = source.Path;
Quality = source.Quality;
Proper = source.Proper;
Size = source.Size;
}
public int EpisodeFileId { get; set; } public int EpisodeFileId { get; set; }
public int SeriesId { get; set; } public int SeriesId { get; set; }