jellyfin/Jellyfin.Data/Entities/Series.cs

166 lines
5.5 KiB
C#
Raw Normal View History

#pragma warning disable CS1591
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
namespace Jellyfin.Data.Entities
{
2020-05-02 17:56:05 -04:00
public partial class Series : LibraryItem
{
partial void Init();
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
2020-05-10 10:54:41 -04:00
protected Series()
2020-05-02 17:56:05 -04:00
{
SeriesMetadata = new HashSet<SeriesMetadata>();
Seasons = new HashSet<Season>();
Init();
}
/// <summary>
/// Public constructor with required data.
2020-05-02 17:56:05 -04:00
/// </summary>
/// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
/// <param name="dateadded">The date the object was added.</param>
2020-05-02 17:56:05 -04:00
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>
/// <param name="dateadded">The date the object was added.</param>
2020-05-02 17:56:05 -04:00
public static Series Create(Guid urlid, DateTime dateadded)
{
return new Series(urlid, dateadded);
}
/*************************************************************************
* Properties
*************************************************************************/
/// <summary>
/// Backing field for AirsDayOfWeek.
2020-05-02 17:56:05 -04:00
/// </summary>
2020-05-21 00:22:43 -04:00
protected DayOfWeek? _AirsDayOfWeek;
2020-05-02 17:56:05 -04:00
/// <summary>
/// When provided in a partial class, allows value of AirsDayOfWeek to be changed before setting.
/// </summary>
2020-05-21 00:22:43 -04:00
partial void SetAirsDayOfWeek(DayOfWeek? oldValue, ref DayOfWeek? newValue);
2020-05-02 17:56:05 -04:00
/// <summary>
/// When provided in a partial class, allows value of AirsDayOfWeek to be changed before returning.
/// </summary>
2020-05-21 00:22:43 -04:00
partial void GetAirsDayOfWeek(ref DayOfWeek? result);
2020-05-02 17:56:05 -04:00
2020-05-21 00:22:43 -04:00
public DayOfWeek? AirsDayOfWeek
2020-05-02 17:56:05 -04:00
{
get
{
2020-05-21 00:22:43 -04:00
DayOfWeek? value = _AirsDayOfWeek;
2020-05-02 17:56:05 -04:00
GetAirsDayOfWeek(ref value);
2020-06-19 05:57:37 -04:00
return _AirsDayOfWeek = value;
}
2020-06-15 17:43:52 -04:00
2020-05-02 17:56:05 -04:00
set
{
2020-05-21 00:22:43 -04:00
DayOfWeek? oldValue = _AirsDayOfWeek;
2020-05-02 17:56:05 -04:00
SetAirsDayOfWeek(oldValue, ref value);
if (oldValue != value)
{
_AirsDayOfWeek = value;
}
}
2020-05-02 17:56:05 -04:00
}
/// <summary>
/// Backing field for AirsTime.
2020-05-02 17:56:05 -04:00
/// </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.
2020-05-02 17:56:05 -04:00
/// </summary>
public DateTimeOffset? AirsTime
{
get
{
2020-05-02 17:56:05 -04:00
DateTimeOffset? value = _AirsTime;
GetAirsTime(ref value);
2020-06-19 05:57:37 -04:00
return _AirsTime = value;
}
2020-06-15 17:43:52 -04:00
2020-05-02 17:56:05 -04:00
set
{
DateTimeOffset? oldValue = _AirsTime;
SetAirsTime(oldValue, ref value);
if (oldValue != value)
{
_AirsTime = value;
}
}
}
/// <summary>
/// Backing field for FirstAired.
2020-05-02 17:56:05 -04:00
/// </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);
2020-06-19 05:57:37 -04:00
return _FirstAired = value;
2020-05-02 17:56:05 -04:00
}
2020-06-15 17:43:52 -04:00
2020-05-02 17:56:05 -04:00
set
{
DateTimeOffset? oldValue = _FirstAired;
SetFirstAired(oldValue, ref value);
if (oldValue != value)
{
_FirstAired = value;
}
}
}
2020-05-02 17:56:05 -04:00
/*************************************************************************
* Navigation properties
*************************************************************************/
[ForeignKey("SeriesMetadata_SeriesMetadata_Id")]
public virtual ICollection<SeriesMetadata> SeriesMetadata { get; protected set; }
2020-05-02 17:56:05 -04:00
[ForeignKey("Season_Seasons_Id")]
public virtual ICollection<Season> Seasons { get; protected set; }
}
}