removed dead code

pull/702/head
Luke Pulverenti 9 years ago
parent e0a213601b
commit 4e624c2cef

@ -290,8 +290,6 @@
<Compile Include="Providers\IImageFileSaver.cs" /> <Compile Include="Providers\IImageFileSaver.cs" />
<Compile Include="Providers\IImageProvider.cs" /> <Compile Include="Providers\IImageProvider.cs" />
<Compile Include="Providers\IImageSaver.cs" /> <Compile Include="Providers\IImageSaver.cs" />
<Compile Include="Providers\IItemIdentityConverter.cs" />
<Compile Include="Providers\IItemIdentityProvider.cs" />
<Compile Include="Providers\ILocalImageFileProvider.cs" /> <Compile Include="Providers\ILocalImageFileProvider.cs" />
<Compile Include="Providers\ILocalMetadataProvider.cs" /> <Compile Include="Providers\ILocalMetadataProvider.cs" />
<Compile Include="Providers\ImageRefreshMode.cs" /> <Compile Include="Providers\ImageRefreshMode.cs" />
@ -329,8 +327,6 @@
<Compile Include="Sorting\SortHelper.cs" /> <Compile Include="Sorting\SortHelper.cs" />
<Compile Include="Subtitles\ISubtitleManager.cs" /> <Compile Include="Subtitles\ISubtitleManager.cs" />
<Compile Include="Subtitles\ISubtitleProvider.cs" /> <Compile Include="Subtitles\ISubtitleProvider.cs" />
<Compile Include="Providers\ItemIdentifier.cs" />
<Compile Include="Providers\ItemIdentities.cs" />
<Compile Include="Providers\ItemLookupInfo.cs" /> <Compile Include="Providers\ItemLookupInfo.cs" />
<Compile Include="Providers\MetadataRefreshOptions.cs" /> <Compile Include="Providers\MetadataRefreshOptions.cs" />
<Compile Include="Providers\ISeriesOrderManager.cs" /> <Compile Include="Providers\ISeriesOrderManager.cs" />

@ -1,4 +0,0 @@
namespace MediaBrowser.Controller.Providers
{
public interface IItemIdentityConverter { }
}

@ -1,4 +0,0 @@
namespace MediaBrowser.Controller.Providers
{
public interface IItemIdentityProvider { }
}

@ -97,13 +97,11 @@ namespace MediaBrowser.Controller.Providers
/// </summary> /// </summary>
/// <param name="imageProviders">The image providers.</param> /// <param name="imageProviders">The image providers.</param>
/// <param name="metadataServices">The metadata services.</param> /// <param name="metadataServices">The metadata services.</param>
/// <param name="identityProviders">The identity providers.</param>
/// <param name="identityConverters">The identity converters.</param>
/// <param name="metadataProviders">The metadata providers.</param> /// <param name="metadataProviders">The metadata providers.</param>
/// <param name="savers">The savers.</param> /// <param name="savers">The savers.</param>
/// <param name="imageSavers">The image savers.</param> /// <param name="imageSavers">The image savers.</param>
/// <param name="externalIds">The external ids.</param> /// <param name="externalIds">The external ids.</param>
void AddParts(IEnumerable<IImageProvider> imageProviders, IEnumerable<IMetadataService> metadataServices, IEnumerable<IItemIdentityProvider> identityProviders, IEnumerable<IItemIdentityConverter> identityConverters, IEnumerable<IMetadataProvider> metadataProviders, void AddParts(IEnumerable<IImageProvider> imageProviders, IEnumerable<IMetadataService> metadataServices, IEnumerable<IMetadataProvider> metadataProviders,
IEnumerable<IMetadataSaver> savers, IEnumerable<IMetadataSaver> savers,
IEnumerable<IImageSaver> imageSavers, IEnumerable<IImageSaver> imageSavers,
IEnumerable<IExternalId> externalIds); IEnumerable<IExternalId> externalIds);
@ -190,21 +188,5 @@ namespace MediaBrowser.Controller.Providers
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{HttpResponseInfo}.</returns> /// <returns>Task{HttpResponseInfo}.</returns>
Task<HttpResponseInfo> GetSearchImage(string providerName, string url, CancellationToken cancellationToken); Task<HttpResponseInfo> GetSearchImage(string providerName, string url, CancellationToken cancellationToken);
/// <summary>
/// Gets the item identity providers.
/// </summary>
/// <typeparam name="TLookupInfo">The type of the t lookup information.</typeparam>
/// <returns>IEnumerable&lt;IItemIdentityProvider&lt;TLookupInfo, TIdentity&gt;&gt;.</returns>
IEnumerable<IItemIdentityProvider<TLookupInfo>> GetItemIdentityProviders<TLookupInfo>()
where TLookupInfo : ItemLookupInfo;
/// <summary>
/// Gets the item identity converters.
/// </summary>
/// <typeparam name="TLookupInfo">The type of the t lookup information.</typeparam>
/// <returns>IEnumerable&lt;IItemIdentityConverter&lt;TIdentity&gt;&gt;.</returns>
IEnumerable<IItemIdentityConverter<TLookupInfo>> GetItemIdentityConverters<TLookupInfo>()
where TLookupInfo : ItemLookupInfo;
} }
} }

@ -1,36 +0,0 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Providers
{
public static class ItemIdentifier<TLookupInfo>
where TLookupInfo : ItemLookupInfo
{
public static async Task FindIdentities(TLookupInfo item, IProviderManager providerManager, CancellationToken cancellationToken)
{
var providers = providerManager.GetItemIdentityProviders<TLookupInfo>();
var converters = providerManager.GetItemIdentityConverters<TLookupInfo>().ToList();
foreach (var provider in providers)
{
await provider.Identify(item);
}
bool changesMade = true;
while (changesMade)
{
changesMade = false;
foreach (var converter in converters)
{
if (await converter.Convert(item))
{
changesMade = true;
}
}
}
}
}
}

@ -1,16 +0,0 @@
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Providers
{
public interface IItemIdentityProvider<in TLookupInfo> : IItemIdentityProvider
where TLookupInfo : ItemLookupInfo
{
Task Identify(TLookupInfo info);
}
public interface IItemIdentityConverter<in TLookupInfo> : IItemIdentityConverter
where TLookupInfo : ItemLookupInfo
{
Task<bool> Convert(TLookupInfo info);
}
}

@ -179,18 +179,6 @@ namespace MediaBrowser.Providers.Manager
lookupInfo.Year = result.ProductionYear; lookupInfo.Year = result.ProductionYear;
} }
private async Task FindIdentities(TIdType id, CancellationToken cancellationToken)
{
try
{
await ItemIdentifier<TIdType>.FindIdentities(id, ProviderManager, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{
Logger.ErrorException("Error in FindIdentities", ex);
}
}
private DateTime GetLastRefreshDate(IHasMetadata item) private DateTime GetLastRefreshDate(IHasMetadata item)
{ {
return item.DateLastRefreshed; return item.DateLastRefreshed;

@ -55,8 +55,6 @@ namespace MediaBrowser.Providers.Manager
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
private IMetadataService[] _metadataServices = { }; private IMetadataService[] _metadataServices = { };
private IItemIdentityProvider[] _identityProviders = { };
private IItemIdentityConverter[] _identityConverters = { };
private IMetadataProvider[] _metadataProviders = { }; private IMetadataProvider[] _metadataProviders = { };
private IEnumerable<IMetadataSaver> _savers; private IEnumerable<IMetadataSaver> _savers;
private IImageSaver[] _imageSavers; private IImageSaver[] _imageSavers;
@ -92,22 +90,17 @@ namespace MediaBrowser.Providers.Manager
/// </summary> /// </summary>
/// <param name="imageProviders">The image providers.</param> /// <param name="imageProviders">The image providers.</param>
/// <param name="metadataServices">The metadata services.</param> /// <param name="metadataServices">The metadata services.</param>
/// <param name="identityProviders">The identity providers.</param>
/// <param name="identityConverters">The identity converters.</param>
/// <param name="metadataProviders">The metadata providers.</param> /// <param name="metadataProviders">The metadata providers.</param>
/// <param name="metadataSavers">The metadata savers.</param> /// <param name="metadataSavers">The metadata savers.</param>
/// <param name="imageSavers">The image savers.</param> /// <param name="imageSavers">The image savers.</param>
/// <param name="externalIds">The external ids.</param> /// <param name="externalIds">The external ids.</param>
public void AddParts(IEnumerable<IImageProvider> imageProviders, IEnumerable<IMetadataService> metadataServices, public void AddParts(IEnumerable<IImageProvider> imageProviders, IEnumerable<IMetadataService> metadataServices,
IEnumerable<IItemIdentityProvider> identityProviders, IEnumerable<IItemIdentityConverter> identityConverters,
IEnumerable<IMetadataProvider> metadataProviders, IEnumerable<IMetadataSaver> metadataSavers, IEnumerable<IMetadataProvider> metadataProviders, IEnumerable<IMetadataSaver> metadataSavers,
IEnumerable<IImageSaver> imageSavers, IEnumerable<IExternalId> externalIds) IEnumerable<IImageSaver> imageSavers, IEnumerable<IExternalId> externalIds)
{ {
ImageProviders = imageProviders.ToArray(); ImageProviders = imageProviders.ToArray();
_metadataServices = metadataServices.OrderBy(i => i.Order).ToArray(); _metadataServices = metadataServices.OrderBy(i => i.Order).ToArray();
_identityProviders = identityProviders.ToArray();
_identityConverters = identityConverters.ToArray();
_metadataProviders = metadataProviders.ToArray(); _metadataProviders = metadataProviders.ToArray();
_imageSavers = imageSavers.ToArray(); _imageSavers = imageSavers.ToArray();
_externalIds = externalIds.OrderBy(i => i.Name).ToArray(); _externalIds = externalIds.OrderBy(i => i.Name).ToArray();
@ -301,18 +294,6 @@ namespace MediaBrowser.Providers.Manager
.ThenBy(GetDefaultOrder); .ThenBy(GetDefaultOrder);
} }
public IEnumerable<IItemIdentityProvider<TLookupInfo>> GetItemIdentityProviders<TLookupInfo>()
where TLookupInfo : ItemLookupInfo
{
return _identityProviders.OfType<IItemIdentityProvider<TLookupInfo>>();
}
public IEnumerable<IItemIdentityConverter<TLookupInfo>> GetItemIdentityConverters<TLookupInfo>()
where TLookupInfo : ItemLookupInfo
{
return _identityConverters.OfType<IItemIdentityConverter<TLookupInfo>>();
}
private IEnumerable<IRemoteImageProvider> GetRemoteImageProviders(IHasImages item, bool includeDisabled) private IEnumerable<IRemoteImageProvider> GetRemoteImageProviders(IHasImages item, bool includeDisabled)
{ {
var options = GetMetadataOptions(item); var options = GetMetadataOptions(item);

@ -177,7 +177,6 @@
<Compile Include="TV\SeriesMetadataService.cs" /> <Compile Include="TV\SeriesMetadataService.cs" />
<Compile Include="TV\TheTVDB\TvdbEpisodeImageProvider.cs" /> <Compile Include="TV\TheTVDB\TvdbEpisodeImageProvider.cs" />
<Compile Include="People\TvdbPersonImageProvider.cs" /> <Compile Include="People\TvdbPersonImageProvider.cs" />
<Compile Include="TV\TheTVDB\TvdbSeasonIdentityProvider.cs" />
<Compile Include="TV\TheTVDB\TvdbSeasonImageProvider.cs" /> <Compile Include="TV\TheTVDB\TvdbSeasonImageProvider.cs" />
<Compile Include="TV\TheTVDB\TvdbSeriesImageProvider.cs" /> <Compile Include="TV\TheTVDB\TvdbSeriesImageProvider.cs" />
<Compile Include="TV\SeasonMetadataService.cs" /> <Compile Include="TV\SeasonMetadataService.cs" />

@ -24,7 +24,7 @@ namespace MediaBrowser.Providers.TV
/// <summary> /// <summary>
/// Class RemoteEpisodeProvider /// Class RemoteEpisodeProvider
/// </summary> /// </summary>
class TvdbEpisodeProvider : IRemoteMetadataProvider<Episode, EpisodeInfo>, IItemIdentityProvider<EpisodeInfo> class TvdbEpisodeProvider : IRemoteMetadataProvider<Episode, EpisodeInfo>
{ {
private static readonly string FullIdKey = MetadataProviders.Tvdb + "-Full"; private static readonly string FullIdKey = MetadataProviders.Tvdb + "-Full";
@ -871,86 +871,6 @@ namespace MediaBrowser.Providers.TV
}); });
} }
public Task Identify(EpisodeInfo info)
{
if (info.ProviderIds.ContainsKey(FullIdKey))
{
return Task.FromResult<object>(null);
}
string seriesTvdbId;
info.SeriesProviderIds.TryGetValue(MetadataProviders.Tvdb.ToString(), out seriesTvdbId);
if (string.IsNullOrEmpty(seriesTvdbId) || info.IndexNumber == null)
{
return Task.FromResult<object>(null);
}
var id = new Identity(seriesTvdbId, info.ParentIndexNumber, info.IndexNumber.Value, info.IndexNumberEnd);
info.SetProviderId(FullIdKey, id.ToString());
return Task.FromResult(id);
}
public int Order { get { return 0; } } public int Order { get { return 0; } }
public struct Identity
{
public string SeriesId { get; private set; }
public int? SeasonIndex { get; private set; }
public int EpisodeNumber { get; private set; }
public int? EpisodeNumberEnd { get; private set; }
public Identity(string id)
: this()
{
this = ParseIdentity(id).Value;
}
public Identity(string seriesId, int? seasonIndex, int episodeNumber, int? episodeNumberEnd)
: this()
{
SeriesId = seriesId;
SeasonIndex = seasonIndex;
EpisodeNumber = episodeNumber;
EpisodeNumberEnd = episodeNumberEnd;
}
public override string ToString()
{
return string.Format("{0}:{1}:{2}",
SeriesId,
SeasonIndex != null ? SeasonIndex.Value.ToString() : "A",
EpisodeNumber + (EpisodeNumberEnd != null ? "-" + EpisodeNumberEnd.Value.ToString() : ""));
}
public static Identity? ParseIdentity(string id)
{
if (string.IsNullOrEmpty(id))
return null;
try {
var parts = id.Split(':');
var series = parts[0];
var season = parts[1] != "A" ? (int?)int.Parse(parts[1]) : null;
int index;
int? indexEnd;
if (parts[2].Contains("-")) {
var split = parts[2].IndexOf("-", StringComparison.OrdinalIgnoreCase);
index = int.Parse(parts[2].Substring(0, split));
indexEnd = int.Parse(parts[2].Substring(split + 1));
} else {
index = int.Parse(parts[2]);
indexEnd = null;
}
return new Identity(series, season, index, indexEnd);
} catch {
return null;
}
}
}
} }
} }

@ -1,65 +0,0 @@
using System.Threading.Tasks;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Providers.TV
{
public class TvdbSeasonIdentityProvider : IItemIdentityProvider<SeasonInfo>
{
public static readonly string FullIdKey = MetadataProviders.Tvdb + "-Full";
public Task Identify(SeasonInfo info)
{
string tvdbSeriesId;
if (!info.SeriesProviderIds.TryGetValue(MetadataProviders.Tvdb.ToString(), out tvdbSeriesId) || string.IsNullOrEmpty(tvdbSeriesId) || info.IndexNumber == null)
{
return Task.FromResult<object>(null);
}
if (string.IsNullOrEmpty(info.GetProviderId(FullIdKey)))
{
var id = string.Format("{0}:{1}", tvdbSeriesId, info.IndexNumber.Value);
info.SetProviderId(FullIdKey, id);
}
return Task.FromResult<object>(null);
}
public static TvdbSeasonIdentity? ParseIdentity(string id)
{
if (id == null)
{
return null;
}
try
{
var parts = id.Split(':');
return new TvdbSeasonIdentity(parts[0], int.Parse(parts[1]));
}
catch
{
return null;
}
}
}
public struct TvdbSeasonIdentity
{
public string SeriesId { get; private set; }
public int Index { get; private set; }
public TvdbSeasonIdentity(string id)
: this()
{
this = TvdbSeasonIdentityProvider.ParseIdentity(id).Value;
}
public TvdbSeasonIdentity(string seriesId, int index)
: this()
{
SeriesId = seriesId;
Index = index;
}
}
}

@ -70,21 +70,6 @@ namespace MediaBrowser.Providers.TV
var seriesProviderIds = series.ProviderIds; var seriesProviderIds = series.ProviderIds;
var seasonNumber = season.IndexNumber.Value; var seasonNumber = season.IndexNumber.Value;
var identity = TvdbSeasonIdentityProvider.ParseIdentity(season.GetProviderId(TvdbSeasonIdentityProvider.FullIdKey));
if (identity == null)
{
identity = new TvdbSeasonIdentity(series.GetProviderId(MetadataProviders.Tvdb), seasonNumber);
}
if (identity != null)
{
var id = identity.Value;
seasonNumber = AdjustForSeriesOffset(series, id.Index);
seriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
seriesProviderIds[MetadataProviders.Tvdb.ToString()] = id.SeriesId;
}
var seriesDataPath = await TvdbSeriesProvider.Current.EnsureSeriesInfo(seriesProviderIds, series.GetPreferredMetadataLanguage(), cancellationToken).ConfigureAwait(false); var seriesDataPath = await TvdbSeriesProvider.Current.EnsureSeriesInfo(seriesProviderIds, series.GetPreferredMetadataLanguage(), cancellationToken).ConfigureAwait(false);
if (!string.IsNullOrWhiteSpace(seriesDataPath)) if (!string.IsNullOrWhiteSpace(seriesDataPath))

@ -25,7 +25,7 @@ using CommonIO;
namespace MediaBrowser.Providers.TV namespace MediaBrowser.Providers.TV
{ {
public class TvdbSeriesProvider : IRemoteMetadataProvider<Series, SeriesInfo>, IItemIdentityProvider<SeriesInfo>, IHasOrder public class TvdbSeriesProvider : IRemoteMetadataProvider<Series, SeriesInfo>, IHasOrder
{ {
private const string TvdbSeriesOffset = "TvdbSeriesOffset"; private const string TvdbSeriesOffset = "TvdbSeriesOffset";
private const string TvdbSeriesOffsetFormat = "{0}-{1}"; private const string TvdbSeriesOffsetFormat = "{0}-{1}";

@ -929,10 +929,10 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
recordPath = recorder.GetOutputPath(mediaStreamInfo, recordPath); recordPath = recorder.GetOutputPath(mediaStreamInfo, recordPath);
recordPath = EnsureFileUnique(recordPath, timer.Id); recordPath = EnsureFileUnique(recordPath, timer.Id);
_fileSystem.CreateDirectory(Path.GetDirectoryName(recordPath));
activeRecordingInfo.Path = recordPath;
_libraryMonitor.ReportFileSystemChangeBeginning(recordPath); _libraryMonitor.ReportFileSystemChangeBeginning(recordPath);
_fileSystem.CreateDirectory(Path.GetDirectoryName(recordPath));
activeRecordingInfo.Path = recordPath;
var duration = recordingEndDate - DateTime.UtcNow; var duration = recordingEndDate - DateTime.UtcNow;

@ -804,8 +804,6 @@ namespace MediaBrowser.Server.Startup.Common
ProviderManager.AddParts(GetExports<IImageProvider>(), ProviderManager.AddParts(GetExports<IImageProvider>(),
GetExports<IMetadataService>(), GetExports<IMetadataService>(),
GetExports<IItemIdentityProvider>(),
GetExports<IItemIdentityConverter>(),
GetExports<IMetadataProvider>(), GetExports<IMetadataProvider>(),
GetExports<IMetadataSaver>(), GetExports<IMetadataSaver>(),
GetExports<IImageSaver>(), GetExports<IImageSaver>(),

Loading…
Cancel
Save