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:
parent
f296f38742
commit
1d2cd49bde
5 changed files with 27 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue