1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 01:38:24 +00:00

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 @@ public void Start(ProgressNotification notification, int targetId, int secondary
{
try
{
var oldFile = new EpisodeFile(episodeFile);
var newFile = _diskScanProvider.MoveEpisodeFile(episodeFile);
if (newFile != null)
{
newEpisodeFiles.Add(newFile);
oldEpisodeFiles.Add(episodeFile);
oldEpisodeFiles.Add(oldFile);
}
}

View file

@ -66,12 +66,13 @@ public void Start(ProgressNotification notification, int targetId, int secondary
{
try
{
var oldFile = new EpisodeFile(episodeFile);
var newFile = _diskScanProvider.MoveEpisodeFile(episodeFile);
if (newFile != null)
{
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 Xbmc(ConfigProvider configProvider, DiskProvider diskProvider, BannerProvider bannerProvider, EpisodeProvider episodeProvider)
public Xbmc(ConfigProvider configProvider, DiskProvider diskProvider,
BannerProvider bannerProvider, EpisodeProvider episodeProvider)
: base(configProvider, diskProvider, bannerProvider, episodeProvider)
{
}

View file

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

View file

@ -9,6 +9,22 @@ namespace NzbDrone.Core.Repository
[PrimaryKey("EpisodeFileId", autoIncrement = true)]
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 SeriesId { get; set; }