aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Entities/ApiBaseItem.cs
blob: e6bd7165473799d143af98d1d5f2ac8d10bf5859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using System;
using System.Collections.Generic;
using MediaBrowser.Model.Users;

namespace MediaBrowser.Model.Entities
{
    /// <summary>
    /// This is a concrete class that the UI can use to deserialize
    /// It is flat in the sense that it will be used regardless of the type of BaseItem involved
    /// </summary>
    public class ApiBaseItem : BaseItem
    {
        // TV Series
        public string TvdbId { get; set; }
        public string Status { get; set; }
        public IEnumerable<DayOfWeek> AirDays { get; set; }
        public string AirTime { get; set; }

        // Movie
        public string TmdbId { get; set; }
        public string ImdbId { get; set; }
    }

    /// <summary>
    /// This is the full return object when requesting an Item
    /// </summary>
    public class ApiBaseItemWrapper<T>
        where T : BaseItem
    {
        public T Item { get; set; }

        public UserItemData UserItemData { get; set; }

        public IEnumerable<ApiBaseItemWrapper<T>> Children { get; set; }

        public bool IsFolder { get; set; }

        public Guid? ParentId { get; set; }

        public string Type { get; set; }

        public bool IsType(Type type)
        {
            return IsType(type.Name);
        }

        public bool IsType(string type)
        {
            return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
        }

        /// <summary>
        /// If the item does not have a logo, this will hold the Id of the Parent that has one.
        /// </summary>
        public Guid? ParentLogoItemId { get; set; }

        public Guid? ParentBackdropItemId { get; set; }

        public int? ParentBackdropCount { get; set; }
    }
}