aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Data/Entities/Chapter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Data/Entities/Chapter.cs')
-rw-r--r--Jellyfin.Data/Entities/Chapter.cs52
1 files changed, 32 insertions, 20 deletions
diff --git a/Jellyfin.Data/Entities/Chapter.cs b/Jellyfin.Data/Entities/Chapter.cs
index d48cb9b62..4575cdb4d 100644
--- a/Jellyfin.Data/Entities/Chapter.cs
+++ b/Jellyfin.Data/Entities/Chapter.cs
@@ -25,19 +25,27 @@ namespace Jellyfin.Data.Entities
}
/// <summary>
- /// Public constructor with required data
+ /// Public constructor with required data.
/// </summary>
- /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="language">ISO-639-3 3-character language codes.</param>
/// <param name="timestart"></param>
/// <param name="_release0"></param>
public Chapter(string language, long timestart, Release _release0)
{
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ if (string.IsNullOrEmpty(language))
+ {
+ throw new ArgumentNullException(nameof(language));
+ }
+
this.Language = language;
this.TimeStart = timestart;
- if (_release0 == null) throw new ArgumentNullException(nameof(_release0));
+ if (_release0 == null)
+ {
+ throw new ArgumentNullException(nameof(_release0));
+ }
+
_release0.Chapters.Add(this);
@@ -47,7 +55,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Static create function (for use in LINQ queries, etc.)
/// </summary>
- /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="language">ISO-639-3 3-character language codes.</param>
/// <param name="timestart"></param>
/// <param name="_release0"></param>
public static Chapter Create(string language, long timestart, Release _release0)
@@ -60,7 +68,7 @@ namespace Jellyfin.Data.Entities
*************************************************************************/
/// <summary>
- /// Backing field for Id
+ /// Backing field for Id.
/// </summary>
internal int _Id;
/// <summary>
@@ -73,7 +81,7 @@ namespace Jellyfin.Data.Entities
partial void GetId(ref int result);
/// <summary>
- /// Identity, Indexed, Required
+ /// Identity, Indexed, Required.
/// </summary>
[Key]
[Required]
@@ -84,8 +92,9 @@ namespace Jellyfin.Data.Entities
{
int value = _Id;
GetId(ref value);
- return (_Id = value);
+ return _Id = value;
}
+
protected set
{
int oldValue = _Id;
@@ -98,7 +107,7 @@ namespace Jellyfin.Data.Entities
}
/// <summary>
- /// Backing field for Name
+ /// Backing field for Name.
/// </summary>
protected string _Name;
/// <summary>
@@ -121,8 +130,9 @@ namespace Jellyfin.Data.Entities
{
string value = _Name;
GetName(ref value);
- return (_Name = value);
+ return _Name = value;
}
+
set
{
string oldValue = _Name;
@@ -135,7 +145,7 @@ namespace Jellyfin.Data.Entities
}
/// <summary>
- /// Backing field for Language
+ /// Backing field for Language.
/// </summary>
protected string _Language;
/// <summary>
@@ -149,7 +159,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Required, Min length = 3, Max length = 3
- /// ISO-639-3 3-character language codes
+ /// ISO-639-3 3-character language codes.
/// </summary>
[Required]
[MinLength(3)]
@@ -161,8 +171,9 @@ namespace Jellyfin.Data.Entities
{
string value = _Language;
GetLanguage(ref value);
- return (_Language = value);
+ return _Language = value;
}
+
set
{
string oldValue = _Language;
@@ -175,7 +186,7 @@ namespace Jellyfin.Data.Entities
}
/// <summary>
- /// Backing field for TimeStart
+ /// Backing field for TimeStart.
/// </summary>
protected long _TimeStart;
/// <summary>
@@ -188,7 +199,7 @@ namespace Jellyfin.Data.Entities
partial void GetTimeStart(ref long result);
/// <summary>
- /// Required
+ /// Required.
/// </summary>
[Required]
public long TimeStart
@@ -197,8 +208,9 @@ namespace Jellyfin.Data.Entities
{
long value = _TimeStart;
GetTimeStart(ref value);
- return (_TimeStart = value);
+ return _TimeStart = value;
}
+
set
{
long oldValue = _TimeStart;
@@ -211,7 +223,7 @@ namespace Jellyfin.Data.Entities
}
/// <summary>
- /// Backing field for TimeEnd
+ /// Backing field for TimeEnd.
/// </summary>
protected long? _TimeEnd;
/// <summary>
@@ -229,8 +241,9 @@ namespace Jellyfin.Data.Entities
{
long? value = _TimeEnd;
GetTimeEnd(ref value);
- return (_TimeEnd = value);
+ return _TimeEnd = value;
}
+
set
{
long? oldValue = _TimeEnd;
@@ -243,7 +256,7 @@ namespace Jellyfin.Data.Entities
}
/// <summary>
- /// Required, ConcurrenyToken
+ /// Required, ConcurrenyToken.
/// </summary>
[ConcurrencyCheck]
[Required]
@@ -257,7 +270,6 @@ namespace Jellyfin.Data.Entities
/*************************************************************************
* Navigation properties
*************************************************************************/
-
}
}