2016-07-05 02:01:31 -04:00
|
|
|
|
using System;
|
|
|
|
|
|
using MediaBrowser.Controller.Providers;
|
2014-02-06 22:10:13 -05:00
|
|
|
|
using MediaBrowser.Model.Configuration;
|
2014-02-23 00:52:30 -05:00
|
|
|
|
using System.Linq;
|
2016-10-25 15:02:04 -04:00
|
|
|
|
using MediaBrowser.Model.Serialization;
|
2015-02-06 00:39:07 -05:00
|
|
|
|
using MediaBrowser.Model.Entities;
|
2013-12-05 22:39:44 -05:00
|
|
|
|
|
2013-08-30 19:54:49 -04:00
|
|
|
|
namespace MediaBrowser.Controller.Entities
|
|
|
|
|
|
{
|
2016-06-02 13:43:29 -04:00
|
|
|
|
public class Book : BaseItem, IHasLookupInfo<BookInfo>, IHasSeries
|
2013-08-30 19:54:49 -04:00
|
|
|
|
{
|
2016-03-18 02:36:58 -04:00
|
|
|
|
[IgnoreDataMember]
|
2013-08-30 19:54:49 -04:00
|
|
|
|
public override string MediaType
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return Model.Entities.MediaType.Book;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2013-12-26 19:23:58 -05:00
|
|
|
|
|
2016-12-06 03:24:29 -05:00
|
|
|
|
[IgnoreDataMember]
|
|
|
|
|
|
public string SeriesPresentationUniqueKey { get; set; }
|
2016-07-04 16:11:30 -04:00
|
|
|
|
[IgnoreDataMember]
|
2013-08-30 19:54:49 -04:00
|
|
|
|
public string SeriesName { get; set; }
|
2016-07-07 23:22:02 -04:00
|
|
|
|
[IgnoreDataMember]
|
2016-07-05 02:01:31 -04:00
|
|
|
|
public Guid? SeriesId { get; set; }
|
2013-08-30 19:54:49 -04:00
|
|
|
|
|
2016-07-10 11:44:53 -04:00
|
|
|
|
public string FindSeriesSortName()
|
|
|
|
|
|
{
|
2017-05-05 13:55:38 -04:00
|
|
|
|
return SeriesName;
|
2016-07-10 11:44:53 -04:00
|
|
|
|
}
|
2016-07-04 16:11:30 -04:00
|
|
|
|
public string FindSeriesName()
|
|
|
|
|
|
{
|
|
|
|
|
|
return SeriesName;
|
|
|
|
|
|
}
|
2016-12-06 03:24:29 -05:00
|
|
|
|
public string FindSeriesPresentationUniqueKey()
|
|
|
|
|
|
{
|
|
|
|
|
|
return SeriesPresentationUniqueKey;
|
|
|
|
|
|
}
|
2016-07-04 16:11:30 -04:00
|
|
|
|
|
2016-07-24 12:46:17 -04:00
|
|
|
|
[IgnoreDataMember]
|
2016-08-13 01:49:00 -04:00
|
|
|
|
public override bool EnableRefreshOnDateModifiedChange
|
2016-07-24 12:46:17 -04:00
|
|
|
|
{
|
|
|
|
|
|
get { return true; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-07-05 02:01:31 -04:00
|
|
|
|
public Guid? FindSeriesId()
|
|
|
|
|
|
{
|
|
|
|
|
|
return SeriesId;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-02-06 00:39:07 -05:00
|
|
|
|
public override bool CanDownload()
|
|
|
|
|
|
{
|
|
|
|
|
|
var locationType = LocationType;
|
|
|
|
|
|
return locationType != LocationType.Remote &&
|
|
|
|
|
|
locationType != LocationType.Virtual;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-11-06 10:02:22 -05:00
|
|
|
|
public override UnratedItem GetBlockUnratedType()
|
2013-12-26 11:53:23 -05:00
|
|
|
|
{
|
2015-11-06 10:02:22 -05:00
|
|
|
|
return UnratedItem.Book;
|
2013-12-26 11:53:23 -05:00
|
|
|
|
}
|
2014-02-06 22:10:13 -05:00
|
|
|
|
|
|
|
|
|
|
public BookInfo GetLookupInfo()
|
|
|
|
|
|
{
|
2014-02-08 23:52:52 -05:00
|
|
|
|
var info = GetItemLookupInfo<BookInfo>();
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(SeriesName))
|
|
|
|
|
|
{
|
2015-11-11 09:56:31 -05:00
|
|
|
|
info.SeriesName = GetParents().Select(i => i.Name).FirstOrDefault();
|
2014-02-08 23:52:52 -05:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
info.SeriesName = SeriesName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return info;
|
2014-02-06 22:10:13 -05:00
|
|
|
|
}
|
2013-08-30 19:54:49 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|