convert episode providers to new system

This commit is contained in:
Luke Pulverenti
2014-02-04 15:19:29 -05:00
parent 351cfef7a7
commit 04d62d3420
50 changed files with 1862 additions and 1113 deletions

View File

@@ -1,8 +1,8 @@
using System;
using MediaBrowser.Model.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Controller.Entities.TV
{
@@ -57,6 +57,12 @@ namespace MediaBrowser.Controller.Entities.TV
/// </summary>
/// <value>The absolute episode number.</value>
public int? AbsoluteEpisodeNumber { get; set; }
/// <summary>
/// This is the ending episode number for double episodes.
/// </summary>
/// <value>The index number.</value>
public int? IndexNumberEnd { get; set; }
/// <summary>
/// We want to group into series not show individually in an index
@@ -89,7 +95,7 @@ namespace MediaBrowser.Controller.Entities.TV
return value;
}
var season = Parent as Season;
var season = Season;
return season != null ? season.IndexNumber : null;
}
@@ -140,10 +146,6 @@ namespace MediaBrowser.Controller.Entities.TV
get { return Series != null ? Series.CustomRatingForComparison : base.CustomRatingForComparison; }
}
/// <summary>
/// The _series
/// </summary>
private Series _series;
/// <summary>
/// This Episode's Series Instance
/// </summary>
@@ -151,14 +153,14 @@ namespace MediaBrowser.Controller.Entities.TV
[IgnoreDataMember]
public Series Series
{
get { return _series ?? (_series = FindParent<Series>()); }
get { return FindParent<Series>(); }
}
/// <summary>
/// This is the ending episode number for double episodes.
/// </summary>
/// <value>The index number.</value>
public int? IndexNumberEnd { get; set; }
[IgnoreDataMember]
public Season Season
{
get { return FindParent<Season>(); }
}
/// <summary>
/// Creates the name of the sort.
@@ -217,7 +219,7 @@ namespace MediaBrowser.Controller.Entities.TV
get
{
// First see if the parent is a Season
var season = Parent as Season;
var season = Season;
if (season != null)
{
@@ -229,7 +231,7 @@ namespace MediaBrowser.Controller.Entities.TV
// Parent is a Series
if (seasonNumber.HasValue)
{
var series = Parent as Series;
var series = Series;
if (series != null)
{

View File

@@ -144,7 +144,6 @@
<Compile Include="Persistence\IFileOrganizationRepository.cs" />
<Compile Include="Persistence\MediaStreamQuery.cs" />
<Compile Include="Providers\ICustomMetadataProvider.cs" />
<Compile Include="Providers\IDynamicInfoProvider.cs" />
<Compile Include="Providers\IHasChangeMonitor.cs" />
<Compile Include="Providers\IHasMetadata.cs" />
<Compile Include="Providers\IImageProvider.cs" />

View File

@@ -1,7 +1,8 @@
using System;
using MediaBrowser.Model.Entities;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.MediaInfo
{
@@ -35,6 +36,18 @@ namespace MediaBrowser.Controller.MediaInfo
/// <returns>Task.</returns>
Task ExtractImage(string[] inputFiles, InputType type, bool isAudio, Video3DFormat? threedFormat, TimeSpan? offset, string outputPath, CancellationToken cancellationToken);
/// <summary>
/// Extracts the image.
/// </summary>
/// <param name="inputFiles">The input files.</param>
/// <param name="type">The type.</param>
/// <param name="isAudio">if set to <c>true</c> [is audio].</param>
/// <param name="threedFormat">The threed format.</param>
/// <param name="offset">The offset.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
Task<Stream> ExtractImage(string[] inputFiles, InputType type, bool isAudio, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken);
/// <summary>
/// Extracts the text subtitle.
/// </summary>

View File

@@ -1,4 +1,5 @@
using System.Threading;
using MediaBrowser.Controller.Library;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Providers
@@ -10,6 +11,6 @@ namespace MediaBrowser.Controller.Providers
public interface ICustomMetadataProvider<TItemType> : IMetadataProvider<TItemType>, ICustomMetadataProvider
where TItemType : IHasMetadata
{
Task FetchAsync(TItemType item, CancellationToken cancellationToken);
Task<ItemUpdateType> FetchAsync(TItemType item, CancellationToken cancellationToken);
}
}

View File

@@ -1,10 +0,0 @@

namespace MediaBrowser.Controller.Providers
{
/// <summary>
/// Marker interface for a provider that always runs
/// </summary>
public interface IDynamicInfoProvider
{
}
}

View File

@@ -16,6 +16,12 @@ namespace MediaBrowser.Controller.Providers
/// <returns>System.String.</returns>
string GetPreferredMetadataCountryCode();
/// <summary>
/// Gets the date modified.
/// </summary>
/// <value>The date modified.</value>
DateTime DateModified { get; }
/// <summary>
/// Gets the locked fields.
/// </summary>

View File

@@ -26,7 +26,7 @@ namespace MediaBrowser.Controller.Providers
public ImageType Type { get; set; }
}
public interface IDynamicImageProvider : ILocalImageProvider
public interface IDynamicImageProvider : IImageProvider
{
/// <summary>
/// Gets the supported images.

View File

@@ -31,6 +31,8 @@ namespace MediaBrowser.Controller.Providers
/// </summary>
/// <value>The year.</value>
public int? Year { get; set; }
public int? IndexNumber { get; set; }
public int? ParentIndexNumber { get; set; }
public ItemId()
{
@@ -45,11 +47,17 @@ namespace MediaBrowser.Controller.Providers
/// </summary>
/// <value>The album artist.</value>
public string AlbumArtist { get; set; }
/// <summary>
/// Gets or sets the artist music brainz identifier.
/// Gets or sets the artist provider ids.
/// </summary>
/// <value>The artist music brainz identifier.</value>
public string ArtistMusicBrainzId { get; set; }
/// <value>The artist provider ids.</value>
public Dictionary<string, string> ArtistProviderIds { get; set; }
public AlbumId()
{
ArtistProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
}
public class GameId : ItemId
@@ -69,4 +77,16 @@ namespace MediaBrowser.Controller.Providers
/// <value>The path.</value>
public string Path { get; set; }
}
public class EpisodeId : ItemId
{
public Dictionary<string, string> SeriesProviderIds { get; set; }
public int? IndexNumberEnd { get; set; }
public EpisodeId()
{
SeriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
}
}