jellyfin/MediaBrowser.Controller/Entities/Book.cs

51 lines
1.3 KiB
C#
Raw Normal View History

2014-02-23 05:52:30 +00:00
using MediaBrowser.Controller.Providers;
2014-02-07 03:10:13 +00:00
using MediaBrowser.Model.Configuration;
2013-12-26 16:53:23 +00:00
using System.Collections.Generic;
2014-02-23 05:52:30 +00:00
using System.Linq;
2015-02-06 05:39:07 +00:00
using MediaBrowser.Model.Entities;
2014-12-20 06:06:27 +00:00
using MediaBrowser.Model.Users;
2013-12-06 03:39:44 +00:00
2013-08-30 23:54:49 +00:00
namespace MediaBrowser.Controller.Entities
{
2015-09-29 17:35:23 +00:00
public class Book : BaseItem, IHasTags, IHasLookupInfo<BookInfo>, IHasSeries
2013-08-30 23:54:49 +00:00
{
public override string MediaType
{
get
{
return Model.Entities.MediaType.Book;
}
}
2013-08-30 23:54:49 +00:00
public string SeriesName { get; set; }
2015-02-06 05:39:07 +00:00
public override bool CanDownload()
{
var locationType = LocationType;
return locationType != LocationType.Remote &&
locationType != LocationType.Virtual;
}
2015-11-06 15:02:22 +00:00
public override UnratedItem GetBlockUnratedType()
2013-12-26 16:53:23 +00:00
{
2015-11-06 15:02:22 +00:00
return UnratedItem.Book;
2013-12-26 16:53:23 +00:00
}
2014-02-07 03:10:13 +00:00
public BookInfo GetLookupInfo()
{
2014-02-09 04:52:52 +00:00
var info = GetItemLookupInfo<BookInfo>();
if (string.IsNullOrEmpty(SeriesName))
{
2015-11-11 14:56:31 +00:00
info.SeriesName = GetParents().Select(i => i.Name).FirstOrDefault();
2014-02-09 04:52:52 +00:00
}
else
{
info.SeriesName = SeriesName;
}
return info;
2014-02-07 03:10:13 +00:00
}
2013-08-30 23:54:49 +00:00
}
}