added more image providers

This commit is contained in:
Luke Pulverenti
2014-02-08 15:02:35 -05:00
parent 12757d094b
commit d0f1a83621
96 changed files with 630 additions and 526 deletions

View File

@@ -10,7 +10,7 @@ namespace MediaBrowser.Controller.Entities.Audio
/// <summary>
/// Class Audio
/// </summary>
public class Audio : BaseItem, IHasMediaStreams, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<SongInfo>
public class Audio : BaseItem, IHasMediaStreams, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasLookupInfo<SongInfo>, IHasSeries
{
public Audio()
{
@@ -51,6 +51,15 @@ namespace MediaBrowser.Controller.Entities.Audio
}
}
[IgnoreDataMember]
public string SeriesName
{
get
{
return Album;
}
}
/// <summary>
/// Gets or sets the artist.
/// </summary>

View File

@@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.Entities.Audio
/// <summary>
/// Class MusicAlbum
/// </summary>
public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasTags, IHasLookupInfo<AlbumInfo>
public class MusicAlbum : Folder, IHasAlbumArtist, IHasArtist, IHasMusicGenres, IHasTags, IHasLookupInfo<AlbumInfo>, IHasSeries
{
public List<Guid> SoundtrackIds { get; set; }
@@ -50,6 +50,15 @@ namespace MediaBrowser.Controller.Entities.Audio
}
}
[IgnoreDataMember]
public string SeriesName
{
get
{
return AlbumArtist;
}
}
/// <summary>
/// Override this to true if class should be grouped under a container in indicies
/// The container class should be defined via IndexContainer

View File

@@ -256,7 +256,7 @@ namespace MediaBrowser.Controller.Entities
private string _sortName;
/// <summary>
/// Gets or sets the name of the sort.
/// Gets the name of the sort.
/// </summary>
/// <value>The name of the sort.</value>
[IgnoreDataMember]

View File

@@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace MediaBrowser.Controller.Entities
{
public class Book : BaseItem, IHasTags, IHasPreferredMetadataLanguage, IHasLookupInfo<BookInfo>
public class Book : BaseItem, IHasTags, IHasPreferredMetadataLanguage, IHasLookupInfo<BookInfo>, IHasSeries
{
public override string MediaType
{

View File

@@ -518,7 +518,7 @@ namespace MediaBrowser.Controller.Entities
foreach (var child in children)
{
if (tasks.Count > 3)
if (tasks.Count > 5)
{
await Task.WhenAll(tasks).ConfigureAwait(false);
tasks.Clear();
@@ -549,7 +549,7 @@ namespace MediaBrowser.Controller.Entities
}
else
{
tasks.Add(RefreshChildMetadata(child, refreshOptions, recursive, innerProgress, cancellationToken));
tasks.Add(RefreshChildMetadata(child, refreshOptions, false, innerProgress, cancellationToken));
}
}

View File

@@ -129,6 +129,12 @@ namespace MediaBrowser.Controller.Entities
/// <param name="images">The images.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
bool AddImages(ImageType imageType, IEnumerable<FileInfo> images);
/// <summary>
/// Determines whether [is save local metadata enabled].
/// </summary>
/// <returns><c>true</c> if [is save local metadata enabled]; otherwise, <c>false</c>.</returns>
bool IsSaveLocalMetadataEnabled();
}
public static class HasImagesExtensions

View File

@@ -1,5 +1,8 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.Entities
@@ -33,16 +36,18 @@ namespace MediaBrowser.Controller.Entities
/// <value>The date last saved.</value>
DateTime DateLastSaved { get; set; }
/// <summary>
/// Determines whether [is save local metadata enabled].
/// </summary>
/// <returns><c>true</c> if [is save local metadata enabled]; otherwise, <c>false</c>.</returns>
bool IsSaveLocalMetadataEnabled();
/// <summary>
/// Gets a value indicating whether this instance is in mixed folder.
/// </summary>
/// <value><c>true</c> if this instance is in mixed folder; otherwise, <c>false</c>.</value>
bool IsInMixedFolder { get; }
/// <summary>
/// Updates to repository.
/// </summary>
/// <param name="updateReason">The update reason.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task UpdateToRepository(ItemUpdateType updateReason, CancellationToken cancellationToken);
}
}

View File

@@ -0,0 +1,12 @@

namespace MediaBrowser.Controller.Entities
{
public interface IHasSeries
{
/// <summary>
/// Gets the name of the series.
/// </summary>
/// <value>The name of the series.</value>
string SeriesName { get; }
}
}

View File

@@ -13,7 +13,7 @@ namespace MediaBrowser.Controller.Entities.Movies
/// <summary>
/// Class Movie
/// </summary>
public class Movie : Video, IHasCriticRating, IHasSoundtracks, IHasBudget, IHasKeywords, IHasTrailers, IHasThemeMedia, IHasTaglines, IHasTags, IHasPreferredMetadataLanguage, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>
public class Movie : Video, IHasCriticRating, IHasSoundtracks, IHasBudget, IHasKeywords, IHasTrailers, IHasThemeMedia, IHasTaglines, IHasPreferredMetadataLanguage, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>
{
public List<Guid> SpecialFeatureIds { get; set; }
@@ -39,7 +39,6 @@ namespace MediaBrowser.Controller.Entities.Movies
ThemeSongIds = new List<Guid>();
ThemeVideoIds = new List<Guid>();
Taglines = new List<string>();
Tags = new List<string>();
Keywords = new List<string>();
}
@@ -52,12 +51,6 @@ namespace MediaBrowser.Controller.Entities.Movies
public List<MediaUrl> RemoteTrailers { get; set; }
/// <summary>
/// Gets or sets the tags.
/// </summary>
/// <value>The tags.</value>
public List<string> Tags { get; set; }
/// <summary>
/// Gets or sets the taglines.
/// </summary>

View File

@@ -10,7 +10,7 @@ namespace MediaBrowser.Controller.Entities.TV
/// <summary>
/// Class Episode
/// </summary>
public class Episode : Video, IHasLookupInfo<EpisodeInfo>
public class Episode : Video, IHasLookupInfo<EpisodeInfo>, IHasSeries
{
/// <summary>
/// Gets the season in which it aired.
@@ -138,6 +138,16 @@ namespace MediaBrowser.Controller.Entities.TV
get { return FindParent<Season>(); }
}
[IgnoreDataMember]
public string SeriesName
{
get
{
var series = Series;
return series == null ? null : series.Name;
}
}
/// <summary>
/// Creates the name of the sort.
/// </summary>

View File

@@ -1,11 +1,8 @@
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Localization;
using MediaBrowser.Controller.Localization;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
@@ -14,7 +11,7 @@ namespace MediaBrowser.Controller.Entities.TV
/// <summary>
/// Class Season
/// </summary>
public class Season : Folder
public class Season : Folder, IHasSeries
{
/// <summary>
@@ -218,7 +215,7 @@ namespace MediaBrowser.Controller.Entities.TV
{
episodes = episodes.Where(i => !i.IsVirtualUnaired);
}
return LibraryManager
.Sort(episodes, user, new[] { ItemSortBy.SortName }, SortOrder.Ascending)
.Cast<Episode>();
@@ -234,5 +231,15 @@ namespace MediaBrowser.Controller.Entities.TV
// Don't block. Let either the entire series rating or episode rating determine it
return false;
}
[IgnoreDataMember]
public string SeriesName
{
get
{
var series = Series;
return series == null ? null : series.Name;
}
}
}
}

View File

@@ -10,7 +10,7 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Trailer
/// </summary>
public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasBudget, IHasTrailers, IHasKeywords, IHasTaglines, IHasTags, IHasPreferredMetadataLanguage, IHasMetascore, IHasLookupInfo<TrailerInfo>
public class Trailer : Video, IHasCriticRating, IHasSoundtracks, IHasBudget, IHasTrailers, IHasKeywords, IHasTaglines, IHasPreferredMetadataLanguage, IHasMetascore, IHasLookupInfo<TrailerInfo>
{
public List<Guid> SoundtrackIds { get; set; }
@@ -28,7 +28,6 @@ namespace MediaBrowser.Controller.Entities
Taglines = new List<string>();
SoundtrackIds = new List<Guid>();
LocalTrailerIds = new List<Guid>();
Tags = new List<string>();
Keywords = new List<string>();
}
@@ -40,12 +39,6 @@ namespace MediaBrowser.Controller.Entities
public List<string> Keywords { get; set; }
/// <summary>
/// Gets or sets the tags.
/// </summary>
/// <value>The tags.</value>
public List<string> Tags { get; set; }
/// <summary>
/// Gets or sets the taglines.
/// </summary>

View File

@@ -16,7 +16,7 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Video
/// </summary>
public class Video : BaseItem, IHasMediaStreams, IHasAspectRatio
public class Video : BaseItem, IHasMediaStreams, IHasAspectRatio, IHasTags
{
public bool IsMultiPart { get; set; }
@@ -26,6 +26,7 @@ namespace MediaBrowser.Controller.Entities
{
PlayableStreamFileNames = new List<string>();
AdditionalPartIds = new List<Guid>();
Tags = new List<string>();
}
/// <summary>
@@ -34,6 +35,12 @@ namespace MediaBrowser.Controller.Entities
/// <value><c>true</c> if this instance has subtitles; otherwise, <c>false</c>.</value>
public bool HasSubtitles { get; set; }
/// <summary>
/// Gets or sets the tags.
/// </summary>
/// <value>The tags.</value>
public List<string> Tags { get; set; }
/// <summary>
/// Gets or sets the video bit rate.
/// </summary>

View File

@@ -1,4 +1,5 @@
using MediaBrowser.Common.Configuration;
using System;
using MediaBrowser.Common.Configuration;
namespace MediaBrowser.Controller
{
@@ -101,9 +102,16 @@ namespace MediaBrowser.Controller
string TranscodingTempPath { get; }
/// <summary>
/// Gets the downloaded images data path.
/// Gets the internal metadata path.
/// </summary>
/// <value>The downloaded images data path.</value>
string DownloadedImagesDataPath { get; }
/// <value>The internal metadata path.</value>
string InternalMetadataPath { get; }
/// <summary>
/// Gets the internal metadata path.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>System.String.</returns>
string GetInternalMetadataPath(Guid id);
}
}

View File

@@ -94,6 +94,7 @@
<Compile Include="Entities\IHasPreferredMetadataLanguage.cs" />
<Compile Include="Entities\IHasProductionLocations.cs" />
<Compile Include="Entities\IHasScreenshots.cs" />
<Compile Include="Entities\IHasSeries.cs" />
<Compile Include="Entities\IHasSoundtracks.cs" />
<Compile Include="Entities\IHasTaglines.cs" />
<Compile Include="Entities\IHasTags.cs" />

View File

@@ -247,7 +247,10 @@ namespace MediaBrowser.Controller.Providers
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
item.ForcedSortName = val;
}
break;
}

View File

@@ -40,8 +40,6 @@ namespace MediaBrowser.Controller.Providers
protected static readonly Task<bool> FalseTaskResult = Task.FromResult(false);
protected static readonly SemaphoreSlim XmlParsingResourcePool = new SemaphoreSlim(4, 4);
/// <summary>
/// Supportses the specified item.
/// </summary>

View File

@@ -38,14 +38,14 @@ namespace MediaBrowser.Controller.Providers
/// <summary>
/// The success
/// </summary>
Success,
/// <summary>
/// The failure
/// </summary>
Failure,
Success = 0,
/// <summary>
/// The completed with errors
/// </summary>
CompletedWithErrors
}
CompletedWithErrors = 1,
/// <summary>
/// The failure
/// </summary>
Failure = 2
}
}

View File

@@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.Providers
{
}
public interface IImageFileProvider : ILocalImageProvider
public interface ILocalImageFileProvider : ILocalImageProvider
{
List<LocalImageInfo> GetImages(IHasImages item);
}

View File

@@ -8,22 +8,6 @@ namespace MediaBrowser.Controller.Providers
{
public interface IProviderRepository : IRepository
{
/// <summary>
/// Gets the provider history.
/// </summary>
/// <param name="itemId">The item identifier.</param>
/// <returns>IEnumerable{BaseProviderInfo}.</returns>
IEnumerable<BaseProviderInfo> GetProviderHistory(Guid itemId);
/// <summary>
/// Saves the provider history.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="history">The history.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SaveProviderHistory(Guid id, IEnumerable<BaseProviderInfo> history, CancellationToken cancellationToken);
/// <summary>
/// Gets the metadata status.
/// </summary>

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MediaBrowser.Common.Extensions;
namespace MediaBrowser.Controller.Providers
{
@@ -13,6 +12,18 @@ namespace MediaBrowser.Controller.Providers
/// <value>The item identifier.</value>
public Guid ItemId { get; set; }
/// <summary>
/// Gets or sets the name of the item.
/// </summary>
/// <value>The name of the item.</value>
public string ItemName { get; set; }
/// <summary>
/// Gets or sets the name of the series.
/// </summary>
/// <value>The name of the series.</value>
public string SeriesName { get; set; }
/// <summary>
/// Gets or sets the date last metadata refresh.
/// </summary>