aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Data/Entities/Series.cs
blob: bede14acfb723105845e6167343bbcfa2f7fb9fc (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace Jellyfin.Data.Entities
{
    public partial class Series : LibraryItem
    {
        partial void Init();

        /// <summary>
        /// Default constructor. Protected due to required properties, but present because EF needs it.
        /// </summary>
        protected Series()
        {
            SeriesMetadata = new HashSet<SeriesMetadata>();
            Seasons = new HashSet<Season>();

            Init();
        }

        /// <summary>
        /// Public constructor with required data.
        /// </summary>
        /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
        public Series(Guid urlid, DateTime dateadded)
        {
            this.UrlId = urlid;

            this.SeriesMetadata = new HashSet<SeriesMetadata>();
            this.Seasons = new HashSet<Season>();

            Init();
        }

        /// <summary>
        /// Static create function (for use in LINQ queries, etc.)
        /// </summary>
        /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
        public static Series Create(Guid urlid, DateTime dateadded)
        {
            return new Series(urlid, dateadded);
        }

        /*************************************************************************
         * Properties
         *************************************************************************/

        /// <summary>
        /// Backing field for AirsDayOfWeek.
        /// </summary>
        protected DayOfWeek? _AirsDayOfWeek;
        /// <summary>
        /// When provided in a partial class, allows value of AirsDayOfWeek to be changed before setting.
        /// </summary>
        partial void SetAirsDayOfWeek(DayOfWeek? oldValue, ref DayOfWeek? newValue);
        /// <summary>
        /// When provided in a partial class, allows value of AirsDayOfWeek to be changed before returning.
        /// </summary>
        partial void GetAirsDayOfWeek(ref DayOfWeek? result);

        public DayOfWeek? AirsDayOfWeek
        {
            get
            {
                DayOfWeek? value = _AirsDayOfWeek;
                GetAirsDayOfWeek(ref value);
                return _AirsDayOfWeek = value;
            }

            set
            {
                DayOfWeek? oldValue = _AirsDayOfWeek;
                SetAirsDayOfWeek(oldValue, ref value);
                if (oldValue != value)
                {
                    _AirsDayOfWeek = value;
                }
            }
        }

        /// <summary>
        /// Backing field for AirsTime.
        /// </summary>
        protected DateTimeOffset? _AirsTime;
        /// <summary>
        /// When provided in a partial class, allows value of AirsTime to be changed before setting.
        /// </summary>
        partial void SetAirsTime(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
        /// <summary>
        /// When provided in a partial class, allows value of AirsTime to be changed before returning.
        /// </summary>
        partial void GetAirsTime(ref DateTimeOffset? result);

        /// <summary>
        /// The time the show airs, ignore the date portion.
        /// </summary>
        public DateTimeOffset? AirsTime
        {
            get
            {
                DateTimeOffset? value = _AirsTime;
                GetAirsTime(ref value);
                return _AirsTime = value;
            }

            set
            {
                DateTimeOffset? oldValue = _AirsTime;
                SetAirsTime(oldValue, ref value);
                if (oldValue != value)
                {
                    _AirsTime = value;
                }
            }
        }

        /// <summary>
        /// Backing field for FirstAired.
        /// </summary>
        protected DateTimeOffset? _FirstAired;
        /// <summary>
        /// When provided in a partial class, allows value of FirstAired to be changed before setting.
        /// </summary>
        partial void SetFirstAired(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
        /// <summary>
        /// When provided in a partial class, allows value of FirstAired to be changed before returning.
        /// </summary>
        partial void GetFirstAired(ref DateTimeOffset? result);

        public DateTimeOffset? FirstAired
        {
            get
            {
                DateTimeOffset? value = _FirstAired;
                GetFirstAired(ref value);
                return _FirstAired = value;
            }

            set
            {
                DateTimeOffset? oldValue = _FirstAired;
                SetFirstAired(oldValue, ref value);
                if (oldValue != value)
                {
                    _FirstAired = value;
                }
            }
        }

        /*************************************************************************
         * Navigation properties
         *************************************************************************/
        [ForeignKey("SeriesMetadata_SeriesMetadata_Id")]
        public virtual ICollection<SeriesMetadata> SeriesMetadata { get; protected set; }

        [ForeignKey("Season_Seasons_Id")]
        public virtual ICollection<Season> Seasons { get; protected set; }
    }
}