Fixed: Cleanup duplicate Series Metadata files in database on startup

This commit is contained in:
Mark McDowall
2014-03-27 16:47:04 -07:00
parent 4de036af55
commit da5713688d
9 changed files with 109 additions and 89 deletions
@@ -1,39 +0,0 @@
using System;
using System.Collections.Generic;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Disk;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Metadata.Files;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Metadata.Consumers.Fake
{
public class FakeMetadata : MetadataBase<FakeMetadataSettings>
{
public FakeMetadata(IDiskProvider diskProvider, IHttpProvider httpProvider, Logger logger)
: base(diskProvider, httpProvider, logger)
{
}
public override void OnSeriesUpdated(Series series, List<MetadataFile> existingMetadataFiles, List<EpisodeFile> episodeFiles)
{
throw new NotImplementedException();
}
public override void OnEpisodeImport(Series series, EpisodeFile episodeFile, bool newDownload)
{
throw new NotImplementedException();
}
public override void AfterRename(Series series, List<MetadataFile> existingMetadataFiles, List<EpisodeFile> episodeFiles)
{
throw new NotImplementedException();
}
public override MetadataFile FindMetadataFile(Series series, string path)
{
return null;
}
}
}
@@ -1,41 +0,0 @@
using System;
using FluentValidation;
using FluentValidation.Results;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
namespace NzbDrone.Core.Metadata.Consumers.Fake
{
public class FakeMetadataSettingsValidator : AbstractValidator<FakeMetadataSettings>
{
public FakeMetadataSettingsValidator()
{
}
}
public class FakeMetadataSettings : IProviderConfig
{
private static readonly FakeMetadataSettingsValidator Validator = new FakeMetadataSettingsValidator();
public FakeMetadataSettings()
{
FakeSetting = true;
}
[FieldDefinition(0, Label = "Fake Setting", Type = FieldType.Checkbox)]
public Boolean FakeSetting { get; set; }
public bool IsValid
{
get
{
return true;
}
}
public ValidationResult Validate()
{
return Validator.Validate(this);
}
}
}
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
@@ -10,7 +9,6 @@ using System.Xml.Linq;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Disk;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Messaging.Events;
@@ -4,7 +4,6 @@ using System.Linq;
using NLog;
using NzbDrone.Common.Composition;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Metadata.Consumers.Fake;
using NzbDrone.Core.ThingiProvider;
namespace NzbDrone.Core.Metadata
@@ -30,8 +29,6 @@ namespace NzbDrone.Core.Metadata
foreach (var provider in _providers)
{
if (provider.GetType() == typeof(FakeMetadata)) continue;;
definitions.Add(new MetadataDefinition
{
Enable = false,