jellyfin/MediaBrowser.Controller/Entities/Book.cs

62 lines
1.6 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;
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
{
2014-02-08 20:02:35 +00:00
public class Book : BaseItem, IHasTags, IHasPreferredMetadataLanguage, IHasLookupInfo<BookInfo>, IHasSeries
2013-08-30 23:54:49 +00:00
{
public override string MediaType
{
get
{
return Model.Entities.MediaType.Book;
}
}
2013-12-06 03:39:44 +00:00
/// <summary>
/// Gets or sets the tags.
/// </summary>
/// <value>The tags.</value>
public List<string> Tags { get; set; }
2013-08-30 23:54:49 +00:00
public string SeriesName { get; set; }
public string PreferredMetadataLanguage { get; set; }
2013-12-28 16:58:13 +00:00
/// <summary>
/// Gets or sets the preferred metadata country code.
/// </summary>
/// <value>The preferred metadata country code.</value>
public string PreferredMetadataCountryCode { get; set; }
2013-12-06 03:39:44 +00:00
public Book()
{
Tags = new List<string>();
}
2013-12-26 16:53:23 +00:00
2014-12-20 06:06:27 +00:00
protected override bool GetBlockUnratedValue(UserPolicy config)
2013-12-26 16:53:23 +00:00
{
return config.BlockUnratedItems.Contains(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))
{
info.SeriesName = Parents.Select(i => i.Name).FirstOrDefault();
}
else
{
info.SeriesName = SeriesName;
}
return info;
2014-02-07 03:10:13 +00:00
}
2013-08-30 23:54:49 +00:00
}
}