move book support into the core

This commit is contained in:
Luke Pulverenti
2016-12-12 00:49:19 -05:00
parent a8d9a3440d
commit 1aff48b93b
25 changed files with 582 additions and 232 deletions

View File

@@ -1,6 +1,16 @@
namespace MediaBrowser.Controller.Entities.Audio
using MediaBrowser.Model.Serialization;
namespace MediaBrowser.Controller.Entities.Audio
{
public class AudioPodcast : Audio
{
[IgnoreDataMember]
public override bool SupportsPositionTicksResume
{
get
{
return true;
}
}
}
}

View File

@@ -0,0 +1,64 @@
using System;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.Entities
{
public class AudioBook : Audio.Audio, IHasSeries
{
[IgnoreDataMember]
public override bool SupportsPositionTicksResume
{
get
{
return true;
}
}
[IgnoreDataMember]
public string SeriesPresentationUniqueKey { get; set; }
[IgnoreDataMember]
public string SeriesName { get; set; }
[IgnoreDataMember]
public Guid? SeriesId { get; set; }
[IgnoreDataMember]
public string SeriesSortName { get; set; }
public string FindSeriesSortName()
{
return SeriesSortName;
}
public string FindSeriesName()
{
return SeriesName;
}
public string FindSeriesPresentationUniqueKey()
{
return SeriesPresentationUniqueKey;
}
[IgnoreDataMember]
public override bool EnableRefreshOnDateModifiedChange
{
get { return true; }
}
public Guid? FindSeriesId()
{
return SeriesId;
}
public override bool CanDownload()
{
var locationType = LocationType;
return locationType != LocationType.Remote &&
locationType != LocationType.Virtual;
}
public override UnratedItem GetBlockUnratedType()
{
return UnratedItem.Book;
}
}
}

View File

@@ -142,6 +142,15 @@ namespace MediaBrowser.Controller.Entities
}
}
[IgnoreDataMember]
public virtual bool SupportsPositionTicksResume
{
get
{
return false;
}
}
public bool DetectIsInMixedFolder()
{
if (SupportsIsInMixedFolderDetection)

View File

@@ -264,6 +264,7 @@ namespace MediaBrowser.Controller.Entities
/// Our children are actually just references to the ones in the physical root...
/// </summary>
/// <value>The linked children.</value>
[IgnoreDataMember]
public override List<LinkedChild> LinkedChildren
{
get { return GetLinkedChildrenInternal(); }

View File

@@ -193,9 +193,10 @@ namespace MediaBrowser.Controller.Entities.TV
{
return "Season " + ParentIndexNumber.Value.ToString(CultureInfo.InvariantCulture);
}
return "Season Unknown";
}
return season == null ? SeasonName : season.Name;
return season.Name;
}
public string FindSeriesName()

View File

@@ -44,6 +44,15 @@ namespace MediaBrowser.Controller.Entities
}
}
[IgnoreDataMember]
public override bool SupportsPositionTicksResume
{
get
{
return true;
}
}
[IgnoreDataMember]
protected override bool SupportsIsInMixedFolderDetection
{

View File

@@ -46,6 +46,15 @@ namespace MediaBrowser.Controller.LiveTv
set { }
}
[IgnoreDataMember]
public override bool SupportsPositionTicksResume
{
get
{
return true;
}
}
/// <summary>
/// Gets a value indicating whether this instance is owned item.
/// </summary>

View File

@@ -38,6 +38,15 @@ namespace MediaBrowser.Controller.LiveTv
}
}
[IgnoreDataMember]
public override bool SupportsPositionTicksResume
{
get
{
return false;
}
}
[IgnoreDataMember]
public override SourceType SourceType
{

View File

@@ -96,6 +96,7 @@
<Compile Include="Drawing\ImageStream.cs" />
<Compile Include="Dto\DtoOptions.cs" />
<Compile Include="Dto\IDtoService.cs" />
<Compile Include="Entities\AudioBook.cs" />
<Compile Include="Entities\Audio\AudioPodcast.cs" />
<Compile Include="Entities\Audio\IHasAlbumArtist.cs" />
<Compile Include="Entities\Audio\IHasMusicGenres.cs" />