Updating project to correct the following errors:

1. Using directive should appear within a namespace declaration
2. Use trailing comma in multi-line initializers
This commit is contained in:
2026-02-19 11:06:43 -05:00
parent 1c6730e2ad
commit 036953f3ff
423 changed files with 9369 additions and 3643 deletions
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.DbConfiguration;
using System.Collections.Generic;
/// <summary>
/// The custom value option for custom database providers.
/// </summary>
@@ -2,11 +2,11 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.DbConfiguration;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace Jellyfin.Database.Implementations.DbConfiguration;
/// <summary>
/// Defines the options for a custom database connector.
/// </summary>
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.DbConfiguration;
using System.Collections.Generic;
/// <summary>
/// Options to configure jellyfins managed database.
/// </summary>
@@ -22,5 +22,5 @@ public enum DatabaseLockingBehaviorTypes
/// <summary>
/// Defines that all writes should be attempted and when fail should be retried.
/// </summary>
Optimistic = 2
Optimistic = 2,
}
@@ -2,65 +2,65 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Xml.Serialization;
using Jellyfin.Database.Implementations.Enums;
namespace Jellyfin.Database.Implementations.Entities
// <summary>
// An entity representing a user's access schedule.
// </summary>
public class AccessSchedule
{
/// <summary>
/// An entity representing a user's access schedule.
/// Initializes a new instance of the <see cref="AccessSchedule"/> class.
/// </summary>
public class AccessSchedule
/// <param name="dayOfWeek">The day of the week.</param>
/// <param name="startHour">The start hour.</param>
/// <param name="endHour">The end hour.</param>
/// <param name="userId">The associated user's id.</param>
public AccessSchedule(DynamicDayOfWeek dayOfWeek, double startHour, double endHour, Guid userId)
{
/// <summary>
/// Initializes a new instance of the <see cref="AccessSchedule"/> class.
/// </summary>
/// <param name="dayOfWeek">The day of the week.</param>
/// <param name="startHour">The start hour.</param>
/// <param name="endHour">The end hour.</param>
/// <param name="userId">The associated user's id.</param>
public AccessSchedule(DynamicDayOfWeek dayOfWeek, double startHour, double endHour, Guid userId)
{
UserId = userId;
DayOfWeek = dayOfWeek;
StartHour = startHour;
EndHour = endHour;
}
/// <summary>
/// Gets the id of this instance.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[XmlIgnore]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id of the associated user.
/// </summary>
[XmlIgnore]
public Guid UserId { get; private set; }
/// <summary>
/// Gets or sets the day of week.
/// </summary>
/// <value>The day of week.</value>
public DynamicDayOfWeek DayOfWeek { get; set; }
/// <summary>
/// Gets or sets the start hour.
/// </summary>
/// <value>The start hour.</value>
public double StartHour { get; set; }
/// <summary>
/// Gets or sets the end hour.
/// </summary>
/// <value>The end hour.</value>
public double EndHour { get; set; }
UserId = userId;
DayOfWeek = dayOfWeek;
StartHour = startHour;
EndHour = endHour;
}
/// <summary>
/// Gets the id of this instance.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[XmlIgnore]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id of the associated user.
/// </summary>
[XmlIgnore]
public Guid UserId { get; private set; }
/// <summary>
/// Gets or sets the day of week.
/// </summary>
/// <value>The day of week.</value>
public DynamicDayOfWeek DayOfWeek { get; set; }
/// <summary>
/// Gets or sets the start hour.
/// </summary>
/// <value>The start hour.</value>
public double StartHour { get; set; }
/// <summary>
/// Gets or sets the end hour.
/// </summary>
/// <value>The end hour.</value>
public double EndHour { get; set; }
}
@@ -2,126 +2,125 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
using Microsoft.Extensions.Logging;
namespace Jellyfin.Database.Implementations.Entities
{
/// <summary>
/// An entity referencing an activity log entry.
/// </summary>
public class ActivityLog : IHasConcurrencyToken
public class ActivityLog : IHasConcurrencyToken
{
/// <summary>
/// Initializes a new instance of the <see cref="ActivityLog"/> class.
/// Public constructor with required data.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="type">The type.</param>
/// <param name="userId">The user id.</param>
public ActivityLog(string name, string type, Guid userId)
{
/// <summary>
/// Initializes a new instance of the <see cref="ActivityLog"/> class.
/// Public constructor with required data.
/// </summary>
/// <param name="name">The name.</param>
/// <param name="type">The type.</param>
/// <param name="userId">The user id.</param>
public ActivityLog(string name, string type, Guid userId)
{
ArgumentException.ThrowIfNullOrEmpty(name);
ArgumentException.ThrowIfNullOrEmpty(type);
ArgumentException.ThrowIfNullOrEmpty(name);
ArgumentException.ThrowIfNullOrEmpty(type);
Name = name;
Type = type;
UserId = userId;
DateCreated = DateTime.UtcNow;
LogSeverity = LogLevel.Information;
}
Name = name;
Type = type;
UserId = userId;
DateCreated = DateTime.UtcNow;
LogSeverity = LogLevel.Information;
}
/// <summary>
/// Gets the identity of this instance.
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the identity of this instance.
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Required, Max length = 512.
/// </remarks>
[MaxLength(512)]
[StringLength(512)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Required, Max length = 512.
/// </remarks>
[MaxLength(512)]
[StringLength(512)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the overview.
/// </summary>
/// <remarks>
/// Max length = 512.
/// </remarks>
[MaxLength(512)]
[StringLength(512)]
public string? Overview { get; set; }
/// <summary>
/// Gets or sets the overview.
/// </summary>
/// <remarks>
/// Max length = 512.
/// </remarks>
[MaxLength(512)]
[StringLength(512)]
public string? Overview { get; set; }
/// <summary>
/// Gets or sets the short overview.
/// </summary>
/// <remarks>
/// Max length = 512.
/// </remarks>
[MaxLength(512)]
[StringLength(512)]
public string? ShortOverview { get; set; }
/// <summary>
/// Gets or sets the short overview.
/// </summary>
/// <remarks>
/// Max length = 512.
/// </remarks>
[MaxLength(512)]
[StringLength(512)]
public string? ShortOverview { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <remarks>
/// Required, Max length = 256.
/// </remarks>
[MaxLength(256)]
[StringLength(256)]
public string Type { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <remarks>
/// Required, Max length = 256.
/// </remarks>
[MaxLength(256)]
[StringLength(256)]
public string Type { get; set; }
/// <summary>
/// Gets or sets the user id.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the user id.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the item id.
/// </summary>
/// <remarks>
/// Max length = 256.
/// </remarks>
[MaxLength(256)]
[StringLength(256)]
public string? ItemId { get; set; }
/// <summary>
/// Gets or sets the item id.
/// </summary>
/// <remarks>
/// Max length = 256.
/// </remarks>
[MaxLength(256)]
[StringLength(256)]
public string? ItemId { get; set; }
/// <summary>
/// Gets or sets the date created. This should be in UTC.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the date created. This should be in UTC.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the log severity. Default is <see cref="LogLevel.Trace"/>.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public LogLevel LogSeverity { get; set; }
/// <summary>
/// Gets or sets the log severity. Default is <see cref="LogLevel.Trace"/>.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public LogLevel LogSeverity { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Jellyfin.Database.Implementations.Entities;
using System;
/// <summary>
/// Represents the relational information for an <see cref="BaseItemEntity"/>.
/// </summary>
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Jellyfin.Database.Implementations.Entities;
using System;
/// <summary>
/// Provides information about an Attachment to an <see cref="BaseItemEntity"/>.
/// </summary>
@@ -2,14 +2,14 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#pragma warning disable CA2227 // Collection properties should be read only
using System;
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.Entities;
public class BaseItemEntity
{
public required Guid Id { get; set; }
@@ -2,9 +2,9 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
#pragma warning disable CS1591
namespace Jellyfin.Database.Implementations.Entities;
#pragma warning disable CS1591
public enum BaseItemExtraType
{
Unknown = 0,
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities;
#pragma warning disable CA2227
using System;
namespace Jellyfin.Database.Implementations.Entities;
/// <summary>
/// Enum TrailerTypes.
/// </summary>
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Jellyfin.Database.Implementations.Entities;
using System;
/// <summary>
/// Enum MetadataFields.
/// </summary>
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Jellyfin.Database.Implementations.Entities;
using System;
/// <summary>
/// Represents a Key-Value relation of an BaseItem's provider.
/// </summary>
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Jellyfin.Database.Implementations.Entities;
using System;
/// <summary>
/// Enum TrailerTypes.
/// </summary>
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Jellyfin.Database.Implementations.Entities;
using System;
/// <summary>
/// The Chapter entity.
/// </summary>
@@ -2,83 +2,82 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Jellyfin.Database.Implementations.Entities
/// <summary>
/// An entity that represents a user's custom display preferences for a specific item.
/// </summary>
public class CustomItemDisplayPreferences
{
/// <summary>
/// An entity that represents a user's custom display preferences for a specific item.
/// Initializes a new instance of the <see cref="CustomItemDisplayPreferences"/> class.
/// </summary>
public class CustomItemDisplayPreferences
/// <param name="userId">The user id.</param>
/// <param name="itemId">The item id.</param>
/// <param name="client">The client.</param>
/// <param name="key">The preference key.</param>
/// <param name="value">The preference value.</param>
public CustomItemDisplayPreferences(Guid userId, Guid itemId, string client, string key, string? value)
{
/// <summary>
/// Initializes a new instance of the <see cref="CustomItemDisplayPreferences"/> class.
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="itemId">The item id.</param>
/// <param name="client">The client.</param>
/// <param name="key">The preference key.</param>
/// <param name="value">The preference value.</param>
public CustomItemDisplayPreferences(Guid userId, Guid itemId, string client, string key, string? value)
{
UserId = userId;
ItemId = itemId;
Client = client;
Key = key;
Value = value;
}
/// <summary>
/// Gets the Id.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the user Id.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the id of the associated item.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public Guid ItemId { get; set; }
/// <summary>
/// Gets or sets the client string.
/// </summary>
/// <remarks>
/// Required. Max Length = 32.
/// </remarks>
[MaxLength(32)]
[StringLength(32)]
public string Client { get; set; }
/// <summary>
/// Gets or sets the preference key.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public string Key { get; set; }
/// <summary>
/// Gets or sets the preference value.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public string? Value { get; set; }
UserId = userId;
ItemId = itemId;
Client = client;
Key = key;
Value = value;
}
/// <summary>
/// Gets the Id.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the user Id.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the id of the associated item.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public Guid ItemId { get; set; }
/// <summary>
/// Gets or sets the client string.
/// </summary>
/// <remarks>
/// Required. Max Length = 32.
/// </remarks>
[MaxLength(32)]
[StringLength(32)]
public string Client { get; set; }
/// <summary>
/// Gets or sets the preference key.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public string Key { get; set; }
/// <summary>
/// Gets or sets the preference value.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public string? Value { get; set; }
}
@@ -2,153 +2,154 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Enums;
namespace Jellyfin.Database.Implementations.Entities
/// <summary>
/// An entity representing a user's display preferences.
/// </summary>
public class DisplayPreferences
{
/// <summary>
/// An entity representing a user's display preferences.
/// Initializes a new instance of the <see cref="DisplayPreferences"/> class.
/// </summary>
public class DisplayPreferences
/// <param name="userId">The user's id.</param>
/// <param name="itemId">The item id.</param>
/// <param name="client">The client string.</param>
public DisplayPreferences(Guid userId, Guid itemId, string client)
{
/// <summary>
/// Initializes a new instance of the <see cref="DisplayPreferences"/> class.
/// </summary>
/// <param name="userId">The user's id.</param>
/// <param name="itemId">The item id.</param>
/// <param name="client">The client string.</param>
public DisplayPreferences(Guid userId, Guid itemId, string client)
{
UserId = userId;
ItemId = itemId;
Client = client;
ShowSidebar = false;
ShowBackdrop = true;
SkipForwardLength = 30000;
SkipBackwardLength = 10000;
ScrollDirection = ScrollDirection.Horizontal;
ChromecastVersion = ChromecastVersion.Stable;
UserId = userId;
ItemId = itemId;
Client = client;
ShowSidebar = false;
ShowBackdrop = true;
SkipForwardLength = 30000;
SkipBackwardLength = 10000;
ScrollDirection = ScrollDirection.Horizontal;
ChromecastVersion = ChromecastVersion.Stable;
HomeSections = new HashSet<HomeSection>();
}
/// <summary>
/// Gets the Id.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the user Id.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the id of the associated item.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public Guid ItemId { get; set; }
/// <summary>
/// Gets or sets the client string.
/// </summary>
/// <remarks>
/// Required. Max Length = 32.
/// </remarks>
[MaxLength(32)]
[StringLength(32)]
public string Client { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to show the sidebar.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool ShowSidebar { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to show the backdrop.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool ShowBackdrop { get; set; }
/// <summary>
/// Gets or sets the scroll direction.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public ScrollDirection ScrollDirection { get; set; }
/// <summary>
/// Gets or sets what the view should be indexed by.
/// </summary>
public IndexingKind? IndexBy { get; set; }
/// <summary>
/// Gets or sets the length of time to skip forwards, in milliseconds.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int SkipForwardLength { get; set; }
/// <summary>
/// Gets or sets the length of time to skip backwards, in milliseconds.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int SkipBackwardLength { get; set; }
/// <summary>
/// Gets or sets the Chromecast Version.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public ChromecastVersion ChromecastVersion { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the next video info overlay should be shown.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool EnableNextVideoInfoOverlay { get; set; }
/// <summary>
/// Gets or sets the dashboard theme.
/// </summary>
[MaxLength(32)]
[StringLength(32)]
public string? DashboardTheme { get; set; }
/// <summary>
/// Gets or sets the tv home screen.
/// </summary>
[MaxLength(32)]
[StringLength(32)]
public string? TvHome { get; set; }
/// <summary>
/// Gets the home sections.
/// </summary>
public virtual ICollection<HomeSection> HomeSections { get; private set; }
HomeSections = new HashSet<HomeSection>();
}
/// <summary>
/// Gets the Id.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the user Id.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public Guid UserId { get; set; }
/// <summary>
/// Gets or sets the id of the associated item.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public Guid ItemId { get; set; }
/// <summary>
/// Gets or sets the client string.
/// </summary>
/// <remarks>
/// Required. Max Length = 32.
/// </remarks>
[MaxLength(32)]
[StringLength(32)]
public string Client { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to show the sidebar.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool ShowSidebar { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to show the backdrop.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool ShowBackdrop { get; set; }
/// <summary>
/// Gets or sets the scroll direction.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public ScrollDirection ScrollDirection { get; set; }
/// <summary>
/// Gets or sets what the view should be indexed by.
/// </summary>
public IndexingKind? IndexBy { get; set; }
/// <summary>
/// Gets or sets the length of time to skip forwards, in milliseconds.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int SkipForwardLength { get; set; }
/// <summary>
/// Gets or sets the length of time to skip backwards, in milliseconds.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int SkipBackwardLength { get; set; }
/// <summary>
/// Gets or sets the Chromecast Version.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public ChromecastVersion ChromecastVersion { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the next video info overlay should be shown.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool EnableNextVideoInfoOverlay { get; set; }
/// <summary>
/// Gets or sets the dashboard theme.
/// </summary>
[MaxLength(32)]
[StringLength(32)]
public string? DashboardTheme { get; set; }
/// <summary>
/// Gets or sets the tv home screen.
/// </summary>
[MaxLength(32)]
[StringLength(32)]
public string? TvHome { get; set; }
/// <summary>
/// Gets the home sections.
/// </summary>
public virtual ICollection<HomeSection> HomeSections { get; private set; }
}
@@ -2,69 +2,69 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities
/// <summary>
/// An entity representing a group.
/// </summary>
public class Group : IHasPermissions, IHasConcurrencyToken
{
/// <summary>
/// An entity representing a group.
/// Initializes a new instance of the <see cref="Group"/> class.
/// </summary>
public class Group : IHasPermissions, IHasConcurrencyToken
/// <param name="name">The name of the group.</param>
public Group(string name)
{
/// <summary>
/// Initializes a new instance of the <see cref="Group"/> class.
/// </summary>
/// <param name="name">The name of the group.</param>
public Group(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name);
ArgumentException.ThrowIfNullOrEmpty(name);
Name = name;
Id = Guid.NewGuid();
Name = name;
Id = Guid.NewGuid();
Permissions = new HashSet<Permission>();
Preferences = new HashSet<Preference>();
}
Permissions = new HashSet<Permission>();
Preferences = new HashSet<Preference>();
}
/// <summary>
/// Gets the id of this group.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
public Guid Id { get; private set; }
/// <summary>
/// Gets the id of this group.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
public Guid Id { get; private set; }
/// <summary>
/// Gets or sets the group's name.
/// </summary>
/// <remarks>
/// Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the group's name.
/// </summary>
/// <remarks>
/// Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string Name { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets a collection containing the group's permissions.
/// </summary>
public virtual ICollection<Permission> Permissions { get; private set; }
/// <summary>
/// Gets a collection containing the group's permissions.
/// </summary>
public virtual ICollection<Permission> Permissions { get; private set; }
/// <summary>
/// Gets a collection containing the group's preferences.
/// </summary>
public virtual ICollection<Preference> Preferences { get; private set; }
/// <summary>
/// Gets a collection containing the group's preferences.
/// </summary>
public virtual ICollection<Preference> Preferences { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,47 +2,47 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Enums;
namespace Jellyfin.Database.Implementations.Entities
/// <summary>
/// An entity representing a section on the user's home page.
/// </summary>
public class HomeSection
{
/// <summary>
/// An entity representing a section on the user's home page.
/// Gets the id.
/// </summary>
public class HomeSection
{
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity. Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <remarks>
/// Identity. Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the Id of the associated display preferences.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int DisplayPreferencesId { get; set; }
/// <summary>
/// Gets or sets the Id of the associated display preferences.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int DisplayPreferencesId { get; set; }
/// <summary>
/// Gets or sets the order.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int Order { get; set; }
/// <summary>
/// Gets or sets the order.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int Order { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public HomeSectionType Type { get; set; }
}
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public HomeSectionType Type { get; set; }
}
@@ -2,57 +2,56 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Jellyfin.Database.Implementations.Entities
/// <summary>
/// An entity representing an image.
/// </summary>
public class ImageInfo
{
/// <summary>
/// An entity representing an image.
/// Initializes a new instance of the <see cref="ImageInfo"/> class.
/// </summary>
public class ImageInfo
/// <param name="path">The path.</param>
public ImageInfo(string path)
{
/// <summary>
/// Initializes a new instance of the <see cref="ImageInfo"/> class.
/// </summary>
/// <param name="path">The path.</param>
public ImageInfo(string path)
{
Path = path;
LastModified = DateTime.UtcNow;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the user id.
/// </summary>
public Guid? UserId { get; private set; }
/// <summary>
/// Gets or sets the path of the image.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
[MaxLength(512)]
[StringLength(512)]
public string Path { get; set; }
/// <summary>
/// Gets or sets the date last modified.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime LastModified { get; set; }
Path = path;
LastModified = DateTime.UtcNow;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the user id.
/// </summary>
public Guid? UserId { get; private set; }
/// <summary>
/// Gets or sets the path of the image.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
[MaxLength(512)]
[StringLength(512)]
public string Path { get; set; }
/// <summary>
/// Gets or sets the date last modified.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime LastModified { get; set; }
}
@@ -2,12 +2,13 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Enums;
namespace Jellyfin.Database.Implementations.Entities
{
/// <summary>
/// An entity that represents a user's display preferences for a specific item.
@@ -2,11 +2,11 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities;
using System;
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.Entities;
/// <summary>
/// Represents an ItemValue for a BaseItem.
/// </summary>
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Jellyfin.Database.Implementations.Entities;
using System;
/// <summary>
/// Mapping table for the ItemValue BaseItem relation.
/// </summary>
@@ -1,10 +1,9 @@
// <copyright file="ItemValueType.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
#pragma warning disable CA1027 // Mark enums with FlagsAttribute
namespace Jellyfin.Database.Implementations.Entities;
#pragma warning disable CA1027 // Mark enums with FlagsAttribute
/// <summary>
/// Provides the Value types for an <see cref="ItemValue"/>.
/// </summary>
@@ -2,13 +2,13 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities;
#pragma warning disable CA2227 // Collection properties should be read only
using System;
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.Entities;
/// <summary>
/// Keyframe information for a specific file.
/// </summary>
@@ -2,67 +2,68 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Enums;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing artwork.
/// </summary>
public class Artwork : IHasConcurrencyToken
{
/// <summary>
/// An entity representing artwork.
/// Initializes a new instance of the <see cref="Artwork"/> class.
/// </summary>
public class Artwork : IHasConcurrencyToken
/// <param name="path">The path.</param>
/// <param name="kind">The kind of art.</param>
public Artwork(string path, ArtKind kind)
{
/// <summary>
/// Initializes a new instance of the <see cref="Artwork"/> class.
/// </summary>
/// <param name="path">The path.</param>
/// <param name="kind">The kind of art.</param>
public Artwork(string path, ArtKind kind)
{
ArgumentException.ThrowIfNullOrEmpty(path);
ArgumentException.ThrowIfNullOrEmpty(path);
Path = path;
Kind = kind;
}
Path = path;
Kind = kind;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the path.
/// </summary>
/// <remarks>
/// Required, Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string Path { get; set; }
/// <summary>
/// Gets or sets the path.
/// </summary>
/// <remarks>
/// Required, Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string Path { get; set; }
/// <summary>
/// Gets or sets the kind of artwork.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public ArtKind Kind { get; set; }
/// <summary>
/// Gets or sets the kind of artwork.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public ArtKind Kind { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,32 +2,31 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a book.
/// </summary>
public class Book : LibraryItem, IHasReleases
{
/// <summary>
/// An entity representing a book.
/// Initializes a new instance of the <see cref="Book"/> class.
/// </summary>
public class Book : LibraryItem, IHasReleases
/// <param name="library">The library.</param>
public Book(Library library) : base(library)
{
/// <summary>
/// Initializes a new instance of the <see cref="Book"/> class.
/// </summary>
/// <param name="library">The library.</param>
public Book(Library library) : base(library)
{
BookMetadata = new HashSet<BookMetadata>();
Releases = new HashSet<Release>();
}
/// <summary>
/// Gets a collection containing the metadata for this book.
/// </summary>
public virtual ICollection<BookMetadata> BookMetadata { get; private set; }
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
BookMetadata = new HashSet<BookMetadata>();
Releases = new HashSet<Release>();
}
/// <summary>
/// Gets a collection containing the metadata for this book.
/// </summary>
public virtual ICollection<BookMetadata> BookMetadata { get; private set; }
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
}
@@ -2,37 +2,36 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity containing metadata for a book.
/// </summary>
public class BookMetadata : ItemMetadata, IHasCompanies
{
/// <summary>
/// An entity containing metadata for a book.
/// Initializes a new instance of the <see cref="BookMetadata"/> class.
/// </summary>
public class BookMetadata : ItemMetadata, IHasCompanies
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public BookMetadata(string title, string language) : base(title, language)
{
/// <summary>
/// Initializes a new instance of the <see cref="BookMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public BookMetadata(string title, string language) : base(title, language)
{
Publishers = new HashSet<Company>();
}
/// <summary>
/// Gets or sets the ISBN.
/// </summary>
public long? Isbn { get; set; }
/// <summary>
/// Gets a collection of the publishers for this book.
/// </summary>
public virtual ICollection<Company> Publishers { get; private set; }
/// <inheritdoc />
public ICollection<Company> Companies => Publishers;
Publishers = new HashSet<Company>();
}
/// <summary>
/// Gets or sets the ISBN.
/// </summary>
public long? Isbn { get; set; }
/// <summary>
/// Gets a collection of the publishers for this book.
/// </summary>
public virtual ICollection<Company> Publishers { get; private set; }
/// <inheritdoc />
public ICollection<Company> Companies => Publishers;
}
@@ -2,83 +2,82 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a chapter.
/// </summary>
public class Chapter : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a chapter.
/// Initializes a new instance of the <see cref="Chapter"/> class.
/// </summary>
public class Chapter : IHasConcurrencyToken
/// <param name="language">ISO-639-3 3-character language codes.</param>
/// <param name="startTime">The start time for this chapter.</param>
public Chapter(string language, long startTime)
{
/// <summary>
/// Initializes a new instance of the <see cref="Chapter"/> class.
/// </summary>
/// <param name="language">ISO-639-3 3-character language codes.</param>
/// <param name="startTime">The start time for this chapter.</param>
public Chapter(string language, long startTime)
{
ArgumentException.ThrowIfNullOrEmpty(language);
ArgumentException.ThrowIfNullOrEmpty(language);
Language = language;
StartTime = startTime;
}
Language = language;
StartTime = startTime;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Name { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Name { get; set; }
/// <summary>
/// Gets or sets the language.
/// </summary>
/// <remarks>
/// Required, Min length = 3, Max length = 3
/// ISO-639-3 3-character language codes.
/// </remarks>
[MinLength(3)]
[MaxLength(3)]
[StringLength(3)]
public string Language { get; set; }
/// <summary>
/// Gets or sets the language.
/// </summary>
/// <remarks>
/// Required, Min length = 3, Max length = 3
/// ISO-639-3 3-character language codes.
/// </remarks>
[MinLength(3)]
[MaxLength(3)]
[StringLength(3)]
public string Language { get; set; }
/// <summary>
/// Gets or sets the start time.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public long StartTime { get; set; }
/// <summary>
/// Gets or sets the start time.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public long StartTime { get; set; }
/// <summary>
/// Gets or sets the end time.
/// </summary>
public long? EndTime { get; set; }
/// <summary>
/// Gets or sets the end time.
/// </summary>
public long? EndTime { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -4,58 +4,57 @@
#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a collection.
/// </summary>
public class Collection : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a collection.
/// Initializes a new instance of the <see cref="Collection"/> class.
/// </summary>
public class Collection : IHasConcurrencyToken
public Collection()
{
/// <summary>
/// Initializes a new instance of the <see cref="Collection"/> class.
/// </summary>
public Collection()
{
Items = new HashSet<CollectionItem>();
}
Items = new HashSet<CollectionItem>();
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Name { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Name { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets a collection containing this collection's items.
/// </summary>
public virtual ICollection<CollectionItem> Items { get; private set; }
/// <summary>
/// Gets a collection containing this collection's items.
/// </summary>
public virtual ICollection<CollectionItem> Items { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,67 +2,66 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a collection item.
/// </summary>
public class CollectionItem : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a collection item.
/// Initializes a new instance of the <see cref="CollectionItem"/> class.
/// </summary>
public class CollectionItem : IHasConcurrencyToken
/// <param name="libraryItem">The library item.</param>
public CollectionItem(LibraryItem libraryItem)
{
/// <summary>
/// Initializes a new instance of the <see cref="CollectionItem"/> class.
/// </summary>
/// <param name="libraryItem">The library item.</param>
public CollectionItem(LibraryItem libraryItem)
{
LibraryItem = libraryItem;
}
LibraryItem = libraryItem;
}
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
/// <summary>
/// Gets or sets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets or sets the library item.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public virtual LibraryItem LibraryItem { get; set; }
/// <summary>
/// Gets or sets the library item.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public virtual LibraryItem LibraryItem { get; set; }
/// <summary>
/// Gets or sets the next item in the collection.
/// </summary>
/// <remarks>
/// TODO check if this properly updated Dependent and has the proper principal relationship.
/// </remarks>
public virtual CollectionItem? Next { get; set; }
/// <summary>
/// Gets or sets the next item in the collection.
/// </summary>
/// <remarks>
/// TODO check if this properly updated Dependent and has the proper principal relationship.
/// </remarks>
public virtual CollectionItem? Next { get; set; }
/// <summary>
/// Gets or sets the previous item in the collection.
/// </summary>
/// <remarks>
/// TODO check if this properly updated Dependent and has the proper principal relationship.
/// </remarks>
public virtual CollectionItem? Previous { get; set; }
/// <summary>
/// Gets or sets the previous item in the collection.
/// </summary>
/// <remarks>
/// TODO check if this properly updated Dependent and has the proper principal relationship.
/// </remarks>
public virtual CollectionItem? Previous { get; set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,57 +2,56 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a company.
/// </summary>
public class Company : IHasCompanies, IHasConcurrencyToken
{
/// <summary>
/// An entity representing a company.
/// Initializes a new instance of the <see cref="Company"/> class.
/// </summary>
public class Company : IHasCompanies, IHasConcurrencyToken
public Company()
{
/// <summary>
/// Initializes a new instance of the <see cref="Company"/> class.
/// </summary>
public Company()
{
CompanyMetadata = new HashSet<CompanyMetadata>();
ChildCompanies = new HashSet<Company>();
}
CompanyMetadata = new HashSet<CompanyMetadata>();
ChildCompanies = new HashSet<Company>();
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets a collection containing the metadata.
/// </summary>
public virtual ICollection<CompanyMetadata> CompanyMetadata { get; private set; }
/// <summary>
/// Gets a collection containing the metadata.
/// </summary>
public virtual ICollection<CompanyMetadata> CompanyMetadata { get; private set; }
/// <summary>
/// Gets a collection containing this company's child companies.
/// </summary>
public virtual ICollection<Company> ChildCompanies { get; private set; }
/// <summary>
/// Gets a collection containing this company's child companies.
/// </summary>
public virtual ICollection<Company> ChildCompanies { get; private set; }
/// <inheritdoc />
public ICollection<Company> Companies => ChildCompanies;
/// <inheritdoc />
public ICollection<Company> Companies => ChildCompanies;
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,62 +2,61 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.ComponentModel.DataAnnotations;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity holding metadata for a <see cref="Company"/>.
/// </summary>
public class CompanyMetadata : ItemMetadata
{
/// <summary>
/// An entity holding metadata for a <see cref="Company"/>.
/// Initializes a new instance of the <see cref="CompanyMetadata"/> class.
/// </summary>
public class CompanyMetadata : ItemMetadata
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public CompanyMetadata(string title, string language) : base(title, language)
{
/// <summary>
/// Initializes a new instance of the <see cref="CompanyMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public CompanyMetadata(string title, string language) : base(title, language)
{
}
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <remarks>
/// Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string? Description { get; set; }
/// <summary>
/// Gets or sets the headquarters.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string? Headquarters { get; set; }
/// <summary>
/// Gets or sets the country code.
/// </summary>
/// <remarks>
/// Max length = 2.
/// </remarks>
[MaxLength(2)]
[StringLength(2)]
public string? Country { get; set; }
/// <summary>
/// Gets or sets the homepage.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Homepage { get; set; }
}
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <remarks>
/// Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string? Description { get; set; }
/// <summary>
/// Gets or sets the headquarters.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string? Headquarters { get; set; }
/// <summary>
/// Gets or sets the country code.
/// </summary>
/// <remarks>
/// Max length = 2.
/// </remarks>
[MaxLength(2)]
[StringLength(2)]
public string? Country { get; set; }
/// <summary>
/// Gets or sets the homepage.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Homepage { get; set; }
}
@@ -2,32 +2,31 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a custom item.
/// </summary>
public class CustomItem : LibraryItem, IHasReleases
{
/// <summary>
/// An entity representing a custom item.
/// Initializes a new instance of the <see cref="CustomItem"/> class.
/// </summary>
public class CustomItem : LibraryItem, IHasReleases
/// <param name="library">The library.</param>
public CustomItem(Library library) : base(library)
{
/// <summary>
/// Initializes a new instance of the <see cref="CustomItem"/> class.
/// </summary>
/// <param name="library">The library.</param>
public CustomItem(Library library) : base(library)
{
CustomItemMetadata = new HashSet<CustomItemMetadata>();
Releases = new HashSet<Release>();
}
/// <summary>
/// Gets a collection containing the metadata for this item.
/// </summary>
public virtual ICollection<CustomItemMetadata> CustomItemMetadata { get; private set; }
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
CustomItemMetadata = new HashSet<CustomItemMetadata>();
Releases = new HashSet<Release>();
}
/// <summary>
/// Gets a collection containing the metadata for this item.
/// </summary>
public virtual ICollection<CustomItemMetadata> CustomItemMetadata { get; private set; }
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
}
@@ -3,19 +3,18 @@
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity containing metadata for a custom item.
/// </summary>
public class CustomItemMetadata : ItemMetadata
{
/// <summary>
/// An entity containing metadata for a custom item.
/// Initializes a new instance of the <see cref="CustomItemMetadata"/> class.
/// </summary>
public class CustomItemMetadata : ItemMetadata
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public CustomItemMetadata(string title, string language) : base(title, language)
{
/// <summary>
/// Initializes a new instance of the <see cref="CustomItemMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public CustomItemMetadata(string title, string language) : base(title, language)
{
}
}
}
@@ -2,37 +2,36 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing an episode.
/// </summary>
public class Episode : LibraryItem, IHasReleases
{
/// <summary>
/// An entity representing an episode.
/// Initializes a new instance of the <see cref="Episode"/> class.
/// </summary>
public class Episode : LibraryItem, IHasReleases
/// <param name="library">The library.</param>
public Episode(Library library) : base(library)
{
/// <summary>
/// Initializes a new instance of the <see cref="Episode"/> class.
/// </summary>
/// <param name="library">The library.</param>
public Episode(Library library) : base(library)
{
Releases = new HashSet<Release>();
EpisodeMetadata = new HashSet<EpisodeMetadata>();
}
/// <summary>
/// Gets or sets the episode number.
/// </summary>
public int? EpisodeNumber { get; set; }
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
/// <summary>
/// Gets a collection containing the metadata for this episode.
/// </summary>
public virtual ICollection<EpisodeMetadata> EpisodeMetadata { get; private set; }
Releases = new HashSet<Release>();
EpisodeMetadata = new HashSet<EpisodeMetadata>();
}
/// <summary>
/// Gets or sets the episode number.
/// </summary>
public int? EpisodeNumber { get; set; }
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
/// <summary>
/// Gets a collection containing the metadata for this episode.
/// </summary>
public virtual ICollection<EpisodeMetadata> EpisodeMetadata { get; private set; }
}
@@ -2,52 +2,51 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.ComponentModel.DataAnnotations;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity containing metadata for an <see cref="Episode"/>.
/// </summary>
public class EpisodeMetadata : ItemMetadata
{
/// <summary>
/// An entity containing metadata for an <see cref="Episode"/>.
/// Initializes a new instance of the <see cref="EpisodeMetadata"/> class.
/// </summary>
public class EpisodeMetadata : ItemMetadata
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public EpisodeMetadata(string title, string language) : base(title, language)
{
/// <summary>
/// Initializes a new instance of the <see cref="EpisodeMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public EpisodeMetadata(string title, string language) : base(title, language)
{
}
/// <summary>
/// Gets or sets the outline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Outline { get; set; }
/// <summary>
/// Gets or sets the plot.
/// </summary>
/// <remarks>
/// Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string? Plot { get; set; }
/// <summary>
/// Gets or sets the tagline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Tagline { get; set; }
}
/// <summary>
/// Gets or sets the outline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Outline { get; set; }
/// <summary>
/// Gets or sets the plot.
/// </summary>
/// <remarks>
/// Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string? Plot { get; set; }
/// <summary>
/// Gets or sets the tagline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Tagline { get; set; }
}
@@ -2,53 +2,52 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a genre.
/// </summary>
public class Genre : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a genre.
/// Initializes a new instance of the <see cref="Genre"/> class.
/// </summary>
public class Genre : IHasConcurrencyToken
/// <param name="name">The name.</param>
public Genre(string name)
{
/// <summary>
/// Initializes a new instance of the <see cref="Genre"/> class.
/// </summary>
/// <param name="name">The name.</param>
public Genre(string name)
{
Name = name;
}
Name = name;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Indexed, Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Indexed, Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string Name { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,144 +2,143 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An abstract class that holds metadata.
/// </summary>
public abstract class ItemMetadata : IHasArtwork, IHasConcurrencyToken
{
/// <summary>
/// An abstract class that holds metadata.
/// Initializes a new instance of the <see cref="ItemMetadata"/> class.
/// </summary>
public abstract class ItemMetadata : IHasArtwork, IHasConcurrencyToken
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
protected ItemMetadata(string title, string language)
{
/// <summary>
/// Initializes a new instance of the <see cref="ItemMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
protected ItemMetadata(string title, string language)
{
ArgumentException.ThrowIfNullOrEmpty(title);
ArgumentException.ThrowIfNullOrEmpty(language);
ArgumentException.ThrowIfNullOrEmpty(title);
ArgumentException.ThrowIfNullOrEmpty(language);
Title = title;
Language = language;
DateAdded = DateTime.UtcNow;
DateModified = DateAdded;
Title = title;
Language = language;
DateAdded = DateTime.UtcNow;
DateModified = DateAdded;
PersonRoles = new HashSet<PersonRole>();
Genres = new HashSet<Genre>();
Artwork = new HashSet<Artwork>();
Ratings = new HashSet<Rating>();
Sources = new HashSet<MetadataProviderId>();
}
PersonRoles = new HashSet<PersonRole>();
Genres = new HashSet<Genre>();
Artwork = new HashSet<Artwork>();
Ratings = new HashSet<Rating>();
Sources = new HashSet<MetadataProviderId>();
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the title.
/// </summary>
/// <remarks>
/// Required, Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string Title { get; set; }
/// <summary>
/// Gets or sets the title.
/// </summary>
/// <remarks>
/// Required, Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string Title { get; set; }
/// <summary>
/// Gets or sets the original title.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? OriginalTitle { get; set; }
/// <summary>
/// Gets or sets the original title.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? OriginalTitle { get; set; }
/// <summary>
/// Gets or sets the sort title.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? SortTitle { get; set; }
/// <summary>
/// Gets or sets the sort title.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? SortTitle { get; set; }
/// <summary>
/// Gets or sets the language.
/// </summary>
/// <remarks>
/// Required, Min length = 3, Max length = 3.
/// ISO-639-3 3-character language codes.
/// </remarks>
[MinLength(3)]
[MaxLength(3)]
[StringLength(3)]
public string Language { get; set; }
/// <summary>
/// Gets or sets the language.
/// </summary>
/// <remarks>
/// Required, Min length = 3, Max length = 3.
/// ISO-639-3 3-character language codes.
/// </remarks>
[MinLength(3)]
[MaxLength(3)]
[StringLength(3)]
public string Language { get; set; }
/// <summary>
/// Gets or sets the release date.
/// </summary>
public DateTimeOffset? ReleaseDate { get; set; }
/// <summary>
/// Gets or sets the release date.
/// </summary>
public DateTimeOffset? ReleaseDate { get; set; }
/// <summary>
/// Gets the date added.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateAdded { get; private set; }
/// <summary>
/// Gets the date added.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateAdded { get; private set; }
/// <summary>
/// Gets or sets the date modified.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateModified { get; set; }
/// <summary>
/// Gets or sets the date modified.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateModified { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets a collection containing the person roles for this item.
/// </summary>
public virtual ICollection<PersonRole> PersonRoles { get; private set; }
/// <summary>
/// Gets a collection containing the person roles for this item.
/// </summary>
public virtual ICollection<PersonRole> PersonRoles { get; private set; }
/// <summary>
/// Gets a collection containing the genres for this item.
/// </summary>
public virtual ICollection<Genre> Genres { get; private set; }
/// <summary>
/// Gets a collection containing the genres for this item.
/// </summary>
public virtual ICollection<Genre> Genres { get; private set; }
/// <inheritdoc />
public virtual ICollection<Artwork> Artwork { get; private set; }
/// <inheritdoc />
public virtual ICollection<Artwork> Artwork { get; private set; }
/// <summary>
/// Gets a collection containing the ratings for this item.
/// </summary>
public virtual ICollection<Rating> Ratings { get; private set; }
/// <summary>
/// Gets a collection containing the ratings for this item.
/// </summary>
public virtual ICollection<Rating> Ratings { get; private set; }
/// <summary>
/// Gets a collection containing the metadata sources for this item.
/// </summary>
public virtual ICollection<MetadataProviderId> Sources { get; private set; }
/// <summary>
/// Gets a collection containing the metadata sources for this item.
/// </summary>
public virtual ICollection<MetadataProviderId> Sources { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,63 +2,62 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a library.
/// </summary>
public class Library : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a library.
/// Initializes a new instance of the <see cref="Library"/> class.
/// </summary>
public class Library : IHasConcurrencyToken
/// <param name="name">The name of the library.</param>
/// <param name="path">The path of the library.</param>
public Library(string name, string path)
{
/// <summary>
/// Initializes a new instance of the <see cref="Library"/> class.
/// </summary>
/// <param name="name">The name of the library.</param>
/// <param name="path">The path of the library.</param>
public Library(string name, string path)
{
Name = name;
Path = path;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Required, Max length = 128.
/// </remarks>
[MaxLength(128)]
[StringLength(128)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the root path of the library.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public string Path { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
Name = name;
Path = path;
}
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Required, Max length = 128.
/// </remarks>
[MaxLength(128)]
[StringLength(128)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the root path of the library.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public string Path { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,58 +2,57 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a library item.
/// </summary>
public abstract class LibraryItem : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a library item.
/// Initializes a new instance of the <see cref="LibraryItem"/> class.
/// </summary>
public abstract class LibraryItem : IHasConcurrencyToken
/// <param name="library">The library of this item.</param>
protected LibraryItem(Library library)
{
/// <summary>
/// Initializes a new instance of the <see cref="LibraryItem"/> class.
/// </summary>
/// <param name="library">The library of this item.</param>
protected LibraryItem(Library library)
{
DateAdded = DateTime.UtcNow;
Library = library;
}
DateAdded = DateTime.UtcNow;
Library = library;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the date this library item was added.
/// </summary>
public DateTime DateAdded { get; private set; }
/// <summary>
/// Gets the date this library item was added.
/// </summary>
public DateTime DateAdded { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets or sets the library of this item.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public virtual Library Library { get; set; }
/// <summary>
/// Gets or sets the library of this item.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public virtual Library Library { get; set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -9,68 +11,65 @@ using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Enums;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a file on disk.
/// </summary>
public class MediaFile : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a file on disk.
/// Initializes a new instance of the <see cref="MediaFile"/> class.
/// </summary>
public class MediaFile : IHasConcurrencyToken
/// <param name="path">The path relative to the LibraryRoot.</param>
/// <param name="kind">The file kind.</param>
public MediaFile(string path, MediaFileKind kind)
{
/// <summary>
/// Initializes a new instance of the <see cref="MediaFile"/> class.
/// </summary>
/// <param name="path">The path relative to the LibraryRoot.</param>
/// <param name="kind">The file kind.</param>
public MediaFile(string path, MediaFileKind kind)
{
ArgumentException.ThrowIfNullOrEmpty(path);
ArgumentException.ThrowIfNullOrEmpty(path);
Path = path;
Kind = kind;
Path = path;
Kind = kind;
MediaFileStreams = new HashSet<MediaFileStream>();
}
MediaFileStreams = new HashSet<MediaFileStream>();
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the path relative to the library root.
/// </summary>
/// <remarks>
/// Required, Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string Path { get; set; }
/// <summary>
/// Gets or sets the path relative to the library root.
/// </summary>
/// <remarks>
/// Required, Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string Path { get; set; }
/// <summary>
/// Gets or sets the kind of media file.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public MediaFileKind Kind { get; set; }
/// <summary>
/// Gets or sets the kind of media file.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public MediaFileKind Kind { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets a collection containing the streams in this file.
/// </summary>
public virtual ICollection<MediaFileStream> MediaFileStreams { get; private set; }
/// <summary>
/// Gets a collection containing the streams in this file.
/// </summary>
public virtual ICollection<MediaFileStream> MediaFileStreams { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,53 +2,52 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a stream in a media file.
/// </summary>
public class MediaFileStream : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a stream in a media file.
/// Initializes a new instance of the <see cref="MediaFileStream"/> class.
/// </summary>
public class MediaFileStream : IHasConcurrencyToken
/// <param name="streamNumber">The number of this stream.</param>
public MediaFileStream(int streamNumber)
{
/// <summary>
/// Initializes a new instance of the <see cref="MediaFileStream"/> class.
/// </summary>
/// <param name="streamNumber">The number of this stream.</param>
public MediaFileStream(int streamNumber)
{
StreamNumber = streamNumber;
}
StreamNumber = streamNumber;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the stream number.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int StreamNumber { get; set; }
/// <summary>
/// Gets or sets the stream number.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int StreamNumber { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,56 +2,55 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a metadata provider.
/// </summary>
public class MetadataProvider : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a metadata provider.
/// Initializes a new instance of the <see cref="MetadataProvider"/> class.
/// </summary>
public class MetadataProvider : IHasConcurrencyToken
/// <param name="name">The name of the metadata provider.</param>
public MetadataProvider(string name)
{
/// <summary>
/// Initializes a new instance of the <see cref="MetadataProvider"/> class.
/// </summary>
/// <param name="name">The name of the metadata provider.</param>
public MetadataProvider(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name);
ArgumentException.ThrowIfNullOrEmpty(name);
Name = name;
}
Name = name;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Required, Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Required, Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string Name { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,66 +2,66 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a unique identifier for a metadata provider.
/// </summary>
public class MetadataProviderId : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a unique identifier for a metadata provider.
/// Initializes a new instance of the <see cref="MetadataProviderId"/> class.
/// </summary>
public class MetadataProviderId : IHasConcurrencyToken
/// <param name="providerId">The provider id.</param>
/// <param name="metadataProvider">The metadata provider.</param>
public MetadataProviderId(string providerId, MetadataProvider metadataProvider)
{
/// <summary>
/// Initializes a new instance of the <see cref="MetadataProviderId"/> class.
/// </summary>
/// <param name="providerId">The provider id.</param>
/// <param name="metadataProvider">The metadata provider.</param>
public MetadataProviderId(string providerId, MetadataProvider metadataProvider)
{
ArgumentException.ThrowIfNullOrEmpty(providerId);
ArgumentException.ThrowIfNullOrEmpty(providerId);
ProviderId = providerId;
MetadataProvider = metadataProvider;
}
ProviderId = providerId;
MetadataProvider = metadataProvider;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the provider id.
/// </summary>
/// <remarks>
/// Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string ProviderId { get; set; }
/// <summary>
/// Gets or sets the provider id.
/// </summary>
/// <remarks>
/// Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string ProviderId { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets or sets the metadata provider.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public virtual MetadataProvider MetadataProvider { get; set; }
/// <summary>
/// Gets or sets the metadata provider.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public virtual MetadataProvider MetadataProvider { get; set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,32 +2,31 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a movie.
/// </summary>
public class Movie : LibraryItem, IHasReleases
{
/// <summary>
/// An entity representing a movie.
/// Initializes a new instance of the <see cref="Movie"/> class.
/// </summary>
public class Movie : LibraryItem, IHasReleases
/// <param name="library">The library.</param>
public Movie(Library library) : base(library)
{
/// <summary>
/// Initializes a new instance of the <see cref="Movie"/> class.
/// </summary>
/// <param name="library">The library.</param>
public Movie(Library library) : base(library)
{
Releases = new HashSet<Release>();
MovieMetadata = new HashSet<MovieMetadata>();
}
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
/// <summary>
/// Gets a collection containing the metadata for this movie.
/// </summary>
public virtual ICollection<MovieMetadata> MovieMetadata { get; private set; }
Releases = new HashSet<Release>();
MovieMetadata = new HashSet<MovieMetadata>();
}
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
/// <summary>
/// Gets a collection containing the metadata for this movie.
/// </summary>
public virtual ICollection<MovieMetadata> MovieMetadata { get; private set; }
}
@@ -2,73 +2,72 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity holding the metadata for a movie.
/// </summary>
public class MovieMetadata : ItemMetadata, IHasCompanies
{
/// <summary>
/// An entity holding the metadata for a movie.
/// Initializes a new instance of the <see cref="MovieMetadata"/> class.
/// </summary>
public class MovieMetadata : ItemMetadata, IHasCompanies
/// <param name="title">The title or name of the movie.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public MovieMetadata(string title, string language) : base(title, language)
{
/// <summary>
/// Initializes a new instance of the <see cref="MovieMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the movie.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public MovieMetadata(string title, string language) : base(title, language)
{
Studios = new HashSet<Company>();
}
/// <summary>
/// Gets or sets the outline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Outline { get; set; }
/// <summary>
/// Gets or sets the tagline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Tagline { get; set; }
/// <summary>
/// Gets or sets the plot.
/// </summary>
/// <remarks>
/// Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string? Plot { get; set; }
/// <summary>
/// Gets or sets the country code.
/// </summary>
/// <remarks>
/// Max length = 2.
/// </remarks>
[MaxLength(2)]
[StringLength(2)]
public string? Country { get; set; }
/// <summary>
/// Gets the studios that produced this movie.
/// </summary>
public virtual ICollection<Company> Studios { get; private set; }
/// <inheritdoc />
public ICollection<Company> Companies => Studios;
Studios = new HashSet<Company>();
}
/// <summary>
/// Gets or sets the outline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Outline { get; set; }
/// <summary>
/// Gets or sets the tagline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Tagline { get; set; }
/// <summary>
/// Gets or sets the plot.
/// </summary>
/// <remarks>
/// Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string? Plot { get; set; }
/// <summary>
/// Gets or sets the country code.
/// </summary>
/// <remarks>
/// Max length = 2.
/// </remarks>
[MaxLength(2)]
[StringLength(2)]
public string? Country { get; set; }
/// <summary>
/// Gets the studios that produced this movie.
/// </summary>
public virtual ICollection<Company> Studios { get; private set; }
/// <inheritdoc />
public ICollection<Company> Companies => Studios;
}
@@ -2,33 +2,32 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a music album.
/// </summary>
public class MusicAlbum : LibraryItem
{
/// <summary>
/// An entity representing a music album.
/// Initializes a new instance of the <see cref="MusicAlbum"/> class.
/// </summary>
public class MusicAlbum : LibraryItem
/// <param name="library">The library.</param>
public MusicAlbum(Library library) : base(library)
{
/// <summary>
/// Initializes a new instance of the <see cref="MusicAlbum"/> class.
/// </summary>
/// <param name="library">The library.</param>
public MusicAlbum(Library library) : base(library)
{
MusicAlbumMetadata = new HashSet<MusicAlbumMetadata>();
Tracks = new HashSet<Track>();
}
/// <summary>
/// Gets a collection containing the album metadata.
/// </summary>
public virtual ICollection<MusicAlbumMetadata> MusicAlbumMetadata { get; private set; }
/// <summary>
/// Gets a collection containing the tracks.
/// </summary>
public virtual ICollection<Track> Tracks { get; private set; }
MusicAlbumMetadata = new HashSet<MusicAlbumMetadata>();
Tracks = new HashSet<Track>();
}
/// <summary>
/// Gets a collection containing the album metadata.
/// </summary>
public virtual ICollection<MusicAlbumMetadata> MusicAlbumMetadata { get; private set; }
/// <summary>
/// Gets a collection containing the tracks.
/// </summary>
public virtual ICollection<Track> Tracks { get; private set; }
}
@@ -2,59 +2,58 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity holding the metadata for a music album.
/// </summary>
public class MusicAlbumMetadata : ItemMetadata
{
/// <summary>
/// An entity holding the metadata for a music album.
/// Initializes a new instance of the <see cref="MusicAlbumMetadata"/> class.
/// </summary>
public class MusicAlbumMetadata : ItemMetadata
/// <param name="title">The title or name of the album.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public MusicAlbumMetadata(string title, string language) : base(title, language)
{
/// <summary>
/// Initializes a new instance of the <see cref="MusicAlbumMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the album.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public MusicAlbumMetadata(string title, string language) : base(title, language)
{
Labels = new HashSet<Company>();
}
/// <summary>
/// Gets or sets the barcode.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string? Barcode { get; set; }
/// <summary>
/// Gets or sets the label number.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string? LabelNumber { get; set; }
/// <summary>
/// Gets or sets the country code.
/// </summary>
/// <remarks>
/// Max length = 2.
/// </remarks>
[MaxLength(2)]
[StringLength(2)]
public string? Country { get; set; }
/// <summary>
/// Gets a collection containing the labels.
/// </summary>
public virtual ICollection<Company> Labels { get; private set; }
Labels = new HashSet<Company>();
}
/// <summary>
/// Gets or sets the barcode.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string? Barcode { get; set; }
/// <summary>
/// Gets or sets the label number.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string? LabelNumber { get; set; }
/// <summary>
/// Gets or sets the country code.
/// </summary>
/// <remarks>
/// Max length = 2.
/// </remarks>
[MaxLength(2)]
[StringLength(2)]
public string? Country { get; set; }
/// <summary>
/// Gets a collection containing the labels.
/// </summary>
public virtual ICollection<Company> Labels { get; private set; }
}
@@ -2,92 +2,91 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a person.
/// </summary>
public class Person : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a person.
/// Initializes a new instance of the <see cref="Person"/> class.
/// </summary>
public class Person : IHasConcurrencyToken
/// <param name="name">The name of the person.</param>
public Person(string name)
{
/// <summary>
/// Initializes a new instance of the <see cref="Person"/> class.
/// </summary>
/// <param name="name">The name of the person.</param>
public Person(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name);
ArgumentException.ThrowIfNullOrEmpty(name);
Name = name;
DateAdded = DateTime.UtcNow;
DateModified = DateAdded;
Name = name;
DateAdded = DateTime.UtcNow;
DateModified = DateAdded;
Sources = new HashSet<MetadataProviderId>();
}
Sources = new HashSet<MetadataProviderId>();
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Required, Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Required, Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the source id.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(256)]
[StringLength(256)]
public string? SourceId { get; set; }
/// <summary>
/// Gets or sets the source id.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(256)]
[StringLength(256)]
public string? SourceId { get; set; }
/// <summary>
/// Gets the date added.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateAdded { get; private set; }
/// <summary>
/// Gets the date added.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateAdded { get; private set; }
/// <summary>
/// Gets or sets the date modified.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateModified { get; set; }
/// <summary>
/// Gets or sets the date modified.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public DateTime DateModified { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets a list of metadata sources for this person.
/// </summary>
public virtual ICollection<MetadataProviderId> Sources { get; private set; }
/// <summary>
/// Gets a list of metadata sources for this person.
/// </summary>
public virtual ICollection<MetadataProviderId> Sources { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,83 +2,82 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Enums;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a person's role in media.
/// </summary>
public class PersonRole : IHasArtwork, IHasConcurrencyToken
{
/// <summary>
/// An entity representing a person's role in media.
/// Initializes a new instance of the <see cref="PersonRole"/> class.
/// </summary>
public class PersonRole : IHasArtwork, IHasConcurrencyToken
/// <param name="type">The role type.</param>
/// <param name="person">The person.</param>
public PersonRole(PersonRoleType type, Person person)
{
/// <summary>
/// Initializes a new instance of the <see cref="PersonRole"/> class.
/// </summary>
/// <param name="type">The role type.</param>
/// <param name="person">The person.</param>
public PersonRole(PersonRoleType type, Person person)
{
Type = type;
Person = person;
Artwork = new HashSet<Artwork>();
Sources = new HashSet<MetadataProviderId>();
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name of the person's role.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Role { get; set; }
/// <summary>
/// Gets or sets the person's role type.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public PersonRoleType Type { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets or sets the person.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public virtual Person Person { get; set; }
/// <inheritdoc />
public virtual ICollection<Artwork> Artwork { get; private set; }
/// <summary>
/// Gets a collection containing the metadata sources for this person role.
/// </summary>
public virtual ICollection<MetadataProviderId> Sources { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
Type = type;
Person = person;
Artwork = new HashSet<Artwork>();
Sources = new HashSet<MetadataProviderId>();
}
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name of the person's role.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Role { get; set; }
/// <summary>
/// Gets or sets the person's role type.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public PersonRoleType Type { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets or sets the person.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public virtual Person Person { get; set; }
/// <inheritdoc />
public virtual ICollection<Artwork> Artwork { get; private set; }
/// <summary>
/// Gets a collection containing the metadata sources for this person role.
/// </summary>
public virtual ICollection<MetadataProviderId> Sources { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,32 +2,32 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a photo.
/// </summary>
public class Photo : LibraryItem, IHasReleases
{
/// <summary>
/// An entity representing a photo.
/// Initializes a new instance of the <see cref="Photo"/> class.
/// </summary>
public class Photo : LibraryItem, IHasReleases
/// <param name="library">The library.</param>
public Photo(Library library) : base(library)
{
/// <summary>
/// Initializes a new instance of the <see cref="Photo"/> class.
/// </summary>
/// <param name="library">The library.</param>
public Photo(Library library) : base(library)
{
PhotoMetadata = new HashSet<PhotoMetadata>();
Releases = new HashSet<Release>();
}
/// <summary>
/// Gets a collection containing the photo metadata.
/// </summary>
public virtual ICollection<PhotoMetadata> PhotoMetadata { get; private set; }
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
PhotoMetadata = new HashSet<PhotoMetadata>();
Releases = new HashSet<Release>();
}
/// <summary>
/// Gets a collection containing the photo metadata.
/// </summary>
public virtual ICollection<PhotoMetadata> PhotoMetadata { get; private set; }
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
}
@@ -3,19 +3,19 @@
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity that holds metadata for a photo.
/// </summary>
public class PhotoMetadata : ItemMetadata
{
/// <summary>
/// An entity that holds metadata for a photo.
/// Initializes a new instance of the <see cref="PhotoMetadata"/> class.
/// </summary>
public class PhotoMetadata : ItemMetadata
/// <param name="title">The title or name of the photo.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public PhotoMetadata(string title, string language) : base(title, language)
{
/// <summary>
/// Initializes a new instance of the <see cref="PhotoMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the photo.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public PhotoMetadata(string title, string language) : base(title, language)
{
}
}
}
@@ -2,62 +2,61 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a rating for an entity.
/// </summary>
public class Rating : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a rating for an entity.
/// Initializes a new instance of the <see cref="Rating"/> class.
/// </summary>
public class Rating : IHasConcurrencyToken
/// <param name="value">The value.</param>
public Rating(double value)
{
/// <summary>
/// Initializes a new instance of the <see cref="Rating"/> class.
/// </summary>
/// <param name="value">The value.</param>
public Rating(double value)
{
Value = value;
}
Value = value;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the value.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public double Value { get; set; }
/// <summary>
/// Gets or sets the value.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public double Value { get; set; }
/// <summary>
/// Gets or sets the number of votes.
/// </summary>
public int? Votes { get; set; }
/// <summary>
/// Gets or sets the number of votes.
/// </summary>
public int? Votes { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets or sets the rating type.
/// If this is <c>null</c> it's the internal user rating.
/// </summary>
public virtual RatingSource? RatingType { get; set; }
/// <summary>
/// Gets or sets the rating type.
/// If this is <c>null</c> it's the internal user rating.
/// </summary>
public virtual RatingSource? RatingType { get; set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,76 +2,75 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// This is the entity to store review ratings, not age ratings.
/// </summary>
public class RatingSource : IHasConcurrencyToken
{
/// <summary>
/// This is the entity to store review ratings, not age ratings.
/// Initializes a new instance of the <see cref="RatingSource"/> class.
/// </summary>
public class RatingSource : IHasConcurrencyToken
/// <param name="minimumValue">The minimum value.</param>
/// <param name="maximumValue">The maximum value.</param>
public RatingSource(double minimumValue, double maximumValue)
{
/// <summary>
/// Initializes a new instance of the <see cref="RatingSource"/> class.
/// </summary>
/// <param name="minimumValue">The minimum value.</param>
/// <param name="maximumValue">The maximum value.</param>
public RatingSource(double minimumValue, double maximumValue)
{
MinimumValue = minimumValue;
MaximumValue = maximumValue;
}
MinimumValue = minimumValue;
MaximumValue = maximumValue;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Name { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Name { get; set; }
/// <summary>
/// Gets or sets the minimum value.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public double MinimumValue { get; set; }
/// <summary>
/// Gets or sets the minimum value.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public double MinimumValue { get; set; }
/// <summary>
/// Gets or sets the maximum value.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public double MaximumValue { get; set; }
/// <summary>
/// Gets or sets the maximum value.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public double MaximumValue { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets or sets the metadata source.
/// </summary>
public virtual MetadataProviderId? Source { get; set; }
/// <summary>
/// Gets or sets the metadata source.
/// </summary>
public virtual MetadataProviderId? Source { get; set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,70 +2,70 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a release for a library item, eg. Director's cut vs. standard.
/// </summary>
public class Release : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a release for a library item, eg. Director's cut vs. standard.
/// Initializes a new instance of the <see cref="Release"/> class.
/// </summary>
public class Release : IHasConcurrencyToken
/// <param name="name">The name of this release.</param>
public Release(string name)
{
/// <summary>
/// Initializes a new instance of the <see cref="Release"/> class.
/// </summary>
/// <param name="name">The name of this release.</param>
public Release(string name)
{
ArgumentException.ThrowIfNullOrEmpty(name);
ArgumentException.ThrowIfNullOrEmpty(name);
Name = name;
Name = name;
MediaFiles = new HashSet<MediaFile>();
Chapters = new HashSet<Chapter>();
}
MediaFiles = new HashSet<MediaFile>();
Chapters = new HashSet<Chapter>();
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Required, Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <remarks>
/// Required, Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string Name { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets a collection containing the media files for this release.
/// </summary>
public virtual ICollection<MediaFile> MediaFiles { get; private set; }
/// <summary>
/// Gets a collection containing the media files for this release.
/// </summary>
public virtual ICollection<MediaFile> MediaFiles { get; private set; }
/// <summary>
/// Gets a collection containing the chapters for this release.
/// </summary>
public virtual ICollection<Chapter> Chapters { get; private set; }
/// <summary>
/// Gets a collection containing the chapters for this release.
/// </summary>
public virtual ICollection<Chapter> Chapters { get; private set; }
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc />
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,38 +2,38 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a season.
/// </summary>
public class Season : LibraryItem
{
/// <summary>
/// An entity representing a season.
/// Initializes a new instance of the <see cref="Season"/> class.
/// </summary>
public class Season : LibraryItem
/// <param name="library">The library.</param>
public Season(Library library) : base(library)
{
/// <summary>
/// Initializes a new instance of the <see cref="Season"/> class.
/// </summary>
/// <param name="library">The library.</param>
public Season(Library library) : base(library)
{
Episodes = new HashSet<Episode>();
SeasonMetadata = new HashSet<SeasonMetadata>();
}
/// <summary>
/// Gets or sets the season number.
/// </summary>
public int? SeasonNumber { get; set; }
/// <summary>
/// Gets the season metadata.
/// </summary>
public virtual ICollection<SeasonMetadata> SeasonMetadata { get; private set; }
/// <summary>
/// Gets a collection containing the number of episodes.
/// </summary>
public virtual ICollection<Episode> Episodes { get; private set; }
Episodes = new HashSet<Episode>();
SeasonMetadata = new HashSet<SeasonMetadata>();
}
/// <summary>
/// Gets or sets the season number.
/// </summary>
public int? SeasonNumber { get; set; }
/// <summary>
/// Gets the season metadata.
/// </summary>
public virtual ICollection<SeasonMetadata> SeasonMetadata { get; private set; }
/// <summary>
/// Gets a collection containing the number of episodes.
/// </summary>
public virtual ICollection<Episode> Episodes { get; private set; }
}
@@ -2,32 +2,31 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.ComponentModel.DataAnnotations;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity that holds metadata for seasons.
/// </summary>
public class SeasonMetadata : ItemMetadata
{
/// <summary>
/// An entity that holds metadata for seasons.
/// Initializes a new instance of the <see cref="SeasonMetadata"/> class.
/// </summary>
public class SeasonMetadata : ItemMetadata
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public SeasonMetadata(string title, string language) : base(title, language)
{
/// <summary>
/// Initializes a new instance of the <see cref="SeasonMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public SeasonMetadata(string title, string language) : base(title, language)
{
}
/// <summary>
/// Gets or sets the outline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Outline { get; set; }
}
/// <summary>
/// Gets or sets the outline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Outline { get; set; }
}
@@ -2,49 +2,50 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System;
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a series.
/// </summary>
public class Series : LibraryItem
{
/// <summary>
/// An entity representing a series.
/// Initializes a new instance of the <see cref="Series"/> class.
/// </summary>
public class Series : LibraryItem
/// <param name="library">The library.</param>
public Series(Library library) : base(library)
{
/// <summary>
/// Initializes a new instance of the <see cref="Series"/> class.
/// </summary>
/// <param name="library">The library.</param>
public Series(Library library) : base(library)
{
Seasons = new HashSet<Season>();
SeriesMetadata = new HashSet<SeriesMetadata>();
}
/// <summary>
/// Gets or sets the days of week.
/// </summary>
public DayOfWeek? AirsDayOfWeek { get; set; }
/// <summary>
/// Gets or sets the time the show airs, ignore the date portion.
/// </summary>
public DateTimeOffset? AirsTime { get; set; }
/// <summary>
/// Gets or sets the date the series first aired.
/// </summary>
public DateTime? FirstAired { get; set; }
/// <summary>
/// Gets a collection containing the series metadata.
/// </summary>
public virtual ICollection<SeriesMetadata> SeriesMetadata { get; private set; }
/// <summary>
/// Gets a collection containing the seasons.
/// </summary>
public virtual ICollection<Season> Seasons { get; private set; }
Seasons = new HashSet<Season>();
SeriesMetadata = new HashSet<SeriesMetadata>();
}
/// <summary>
/// Gets or sets the days of week.
/// </summary>
public DayOfWeek? AirsDayOfWeek { get; set; }
/// <summary>
/// Gets or sets the time the show airs, ignore the date portion.
/// </summary>
public DateTimeOffset? AirsTime { get; set; }
/// <summary>
/// Gets or sets the date the series first aired.
/// </summary>
public DateTime? FirstAired { get; set; }
/// <summary>
/// Gets a collection containing the series metadata.
/// </summary>
public virtual ICollection<SeriesMetadata> SeriesMetadata { get; private set; }
/// <summary>
/// Gets a collection containing the seasons.
/// </summary>
public virtual ICollection<Season> Seasons { get; private set; }
}
@@ -2,73 +2,72 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing series metadata.
/// </summary>
public class SeriesMetadata : ItemMetadata, IHasCompanies
{
/// <summary>
/// An entity representing series metadata.
/// Initializes a new instance of the <see cref="SeriesMetadata"/> class.
/// </summary>
public class SeriesMetadata : ItemMetadata, IHasCompanies
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public SeriesMetadata(string title, string language) : base(title, language)
{
/// <summary>
/// Initializes a new instance of the <see cref="SeriesMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public SeriesMetadata(string title, string language) : base(title, language)
{
Networks = new HashSet<Company>();
}
/// <summary>
/// Gets or sets the outline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Outline { get; set; }
/// <summary>
/// Gets or sets the plot.
/// </summary>
/// <remarks>
/// Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string? Plot { get; set; }
/// <summary>
/// Gets or sets the tagline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Tagline { get; set; }
/// <summary>
/// Gets or sets the country code.
/// </summary>
/// <remarks>
/// Max length = 2.
/// </remarks>
[MaxLength(2)]
[StringLength(2)]
public string? Country { get; set; }
/// <summary>
/// Gets a collection containing the networks.
/// </summary>
public virtual ICollection<Company> Networks { get; private set; }
/// <inheritdoc />
public ICollection<Company> Companies => Networks;
Networks = new HashSet<Company>();
}
/// <summary>
/// Gets or sets the outline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Outline { get; set; }
/// <summary>
/// Gets or sets the plot.
/// </summary>
/// <remarks>
/// Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string? Plot { get; set; }
/// <summary>
/// Gets or sets the tagline.
/// </summary>
/// <remarks>
/// Max length = 1024.
/// </remarks>
[MaxLength(1024)]
[StringLength(1024)]
public string? Tagline { get; set; }
/// <summary>
/// Gets or sets the country code.
/// </summary>
/// <remarks>
/// Max length = 2.
/// </remarks>
[MaxLength(2)]
[StringLength(2)]
public string? Country { get; set; }
/// <summary>
/// Gets a collection containing the networks.
/// </summary>
public virtual ICollection<Company> Networks { get; private set; }
/// <inheritdoc />
public ICollection<Company> Companies => Networks;
}
@@ -2,37 +2,37 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity representing a track.
/// </summary>
public class Track : LibraryItem, IHasReleases
{
/// <summary>
/// An entity representing a track.
/// Initializes a new instance of the <see cref="Track"/> class.
/// </summary>
public class Track : LibraryItem, IHasReleases
/// <param name="library">The library.</param>
public Track(Library library) : base(library)
{
/// <summary>
/// Initializes a new instance of the <see cref="Track"/> class.
/// </summary>
/// <param name="library">The library.</param>
public Track(Library library) : base(library)
{
Releases = new HashSet<Release>();
TrackMetadata = new HashSet<TrackMetadata>();
}
/// <summary>
/// Gets or sets the track number.
/// </summary>
public int? TrackNumber { get; set; }
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
/// <summary>
/// Gets a collection containing the track metadata.
/// </summary>
public virtual ICollection<TrackMetadata> TrackMetadata { get; private set; }
Releases = new HashSet<Release>();
TrackMetadata = new HashSet<TrackMetadata>();
}
/// <summary>
/// Gets or sets the track number.
/// </summary>
public int? TrackNumber { get; set; }
/// <inheritdoc />
public virtual ICollection<Release> Releases { get; private set; }
/// <summary>
/// Gets a collection containing the track metadata.
/// </summary>
public virtual ICollection<TrackMetadata> TrackMetadata { get; private set; }
}
@@ -3,19 +3,19 @@
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Libraries
/// <summary>
/// An entity holding metadata for a track.
/// </summary>
public class TrackMetadata : ItemMetadata
{
/// <summary>
/// An entity holding metadata for a track.
/// Initializes a new instance of the <see cref="TrackMetadata"/> class.
/// </summary>
public class TrackMetadata : ItemMetadata
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public TrackMetadata(string title, string language) : base(title, language)
{
/// <summary>
/// Initializes a new instance of the <see cref="TrackMetadata"/> class.
/// </summary>
/// <param name="title">The title or name of the object.</param>
/// <param name="language">ISO-639-3 3-character language codes.</param>
public TrackMetadata(string title, string language) : base(title, language)
{
}
}
}
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities;
using System;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Enums;
namespace Jellyfin.Database.Implementations.Entities;
/// <summary>
/// An entity representing the metadata for a group of trickplay tiles.
/// </summary>
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
using System;
namespace Jellyfin.Database.Implementations.Entities;
public class MediaStreamInfo
{
public required Guid ItemId { get; set; }
@@ -2,13 +2,13 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities;
#pragma warning disable CA2227 // Collection properties should be read only
using System;
using System.Collections.Generic;
namespace Jellyfin.Database.Implementations.Entities;
/// <summary>
/// People entity.
/// </summary>
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Jellyfin.Database.Implementations.Entities;
using System;
/// <summary>
/// Mapping table for People to BaseItems.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
using System;
@@ -10,63 +12,61 @@ using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Enums;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities
/// <summary>
/// An entity representing whether the associated user has a specific permission.
/// </summary>
public class Permission : IHasConcurrencyToken
{
/// <summary>
/// An entity representing whether the associated user has a specific permission.
/// Initializes a new instance of the <see cref="Permission"/> class.
/// Public constructor with required data.
/// </summary>
public class Permission : IHasConcurrencyToken
/// <param name="kind">The permission kind.</param>
/// <param name="value">The value of this permission.</param>
public Permission(PermissionKind kind, bool value)
{
/// <summary>
/// Initializes a new instance of the <see cref="Permission"/> class.
/// Public constructor with required data.
/// </summary>
/// <param name="kind">The permission kind.</param>
/// <param name="value">The value of this permission.</param>
public Permission(PermissionKind kind, bool value)
{
Kind = kind;
Value = value;
}
Kind = kind;
Value = value;
}
/// <summary>
/// Gets the id of this permission.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the id of this permission.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the id of the associated user.
/// </summary>
public Guid? UserId { get; set; }
/// <summary>
/// Gets or sets the id of the associated user.
/// </summary>
public Guid? UserId { get; set; }
/// <summary>
/// Gets the type of this permission.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public PermissionKind Kind { get; private set; }
/// <summary>
/// Gets the type of this permission.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public PermissionKind Kind { get; private set; }
/// <summary>
/// Gets or sets a value indicating whether the associated user has this permission.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool Value { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the associated user has this permission.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool Value { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc/>
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc/>
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,71 +2,70 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Jellyfin.Database.Implementations.Enums;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities
/// <summary>
/// An entity representing a preference attached to a user or group.
/// </summary>
public class Preference : IHasConcurrencyToken
{
/// <summary>
/// An entity representing a preference attached to a user or group.
/// Initializes a new instance of the <see cref="Preference"/> class.
/// Public constructor with required data.
/// </summary>
public class Preference : IHasConcurrencyToken
/// <param name="kind">The preference kind.</param>
/// <param name="value">The value.</param>
public Preference(PreferenceKind kind, string value)
{
/// <summary>
/// Initializes a new instance of the <see cref="Preference"/> class.
/// Public constructor with required data.
/// </summary>
/// <param name="kind">The preference kind.</param>
/// <param name="value">The value.</param>
public Preference(PreferenceKind kind, string value)
{
Kind = kind;
Value = value ?? throw new ArgumentNullException(nameof(value));
}
/// <summary>
/// Gets the id of this preference.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the id of the associated user.
/// </summary>
public Guid? UserId { get; set; }
/// <summary>
/// Gets the type of this preference.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public PreferenceKind Kind { get; private set; }
/// <summary>
/// Gets or sets the value of this preference.
/// </summary>
/// <remarks>
/// Required, Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string Value { get; set; }
/// <inheritdoc/>
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc/>
public void OnSavingChanges()
{
RowVersion++;
}
Kind = kind;
Value = value ?? throw new ArgumentNullException(nameof(value));
}
}
/// <summary>
/// Gets the id of this preference.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the id of the associated user.
/// </summary>
public Guid? UserId { get; set; }
/// <summary>
/// Gets the type of this preference.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public PreferenceKind Kind { get; private set; }
/// <summary>
/// Gets or sets the value of this preference.
/// </summary>
/// <remarks>
/// Required, Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string Value { get; set; }
/// <inheritdoc/>
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc/>
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,59 +2,58 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Security
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Globalization;
namespace Jellyfin.Database.Implementations.Entities.Security
/// <summary>
/// An entity representing an API key.
/// </summary>
public class ApiKey
{
/// <summary>
/// An entity representing an API key.
/// Initializes a new instance of the <see cref="ApiKey"/> class.
/// </summary>
public class ApiKey
/// <param name="name">The name.</param>
public ApiKey(string name)
{
/// <summary>
/// Initializes a new instance of the <see cref="ApiKey"/> class.
/// </summary>
/// <param name="name">The name.</param>
public ApiKey(string name)
{
Name = name;
Name = name;
AccessToken = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
DateCreated = DateTime.UtcNow;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the date created.
/// </summary>
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the date of last activity.
/// </summary>
public DateTime DateLastActivity { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
[MaxLength(64)]
[StringLength(64)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the access token.
/// </summary>
public string AccessToken { get; set; }
AccessToken = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
DateCreated = DateTime.UtcNow;
}
/// <summary>
/// Gets the id.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets or sets the date created.
/// </summary>
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the date of last activity.
/// </summary>
public DateTime DateLastActivity { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
[MaxLength(64)]
[StringLength(64)]
public string Name { get; set; }
/// <summary>
/// Gets or sets the access token.
/// </summary>
public string AccessToken { get; set; }
}
@@ -2,110 +2,109 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Security
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Globalization;
namespace Jellyfin.Database.Implementations.Entities.Security
/// <summary>
/// An entity representing a device.
/// </summary>
public class Device
{
/// <summary>
/// An entity representing a device.
/// Initializes a new instance of the <see cref="Device"/> class.
/// </summary>
public class Device
/// <param name="userId">The user id.</param>
/// <param name="appName">The app name.</param>
/// <param name="appVersion">The app version.</param>
/// <param name="deviceName">The device name.</param>
/// <param name="deviceId">The device id.</param>
public Device(Guid userId, string appName, string appVersion, string deviceName, string deviceId)
{
/// <summary>
/// Initializes a new instance of the <see cref="Device"/> class.
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="appName">The app name.</param>
/// <param name="appVersion">The app version.</param>
/// <param name="deviceName">The device name.</param>
/// <param name="deviceId">The device id.</param>
public Device(Guid userId, string appName, string appVersion, string deviceName, string deviceId)
{
UserId = userId;
AppName = appName;
AppVersion = appVersion;
DeviceName = deviceName;
DeviceId = deviceId;
UserId = userId;
AppName = appName;
AppVersion = appVersion;
DeviceName = deviceName;
DeviceId = deviceId;
AccessToken = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
DateCreated = DateTime.UtcNow;
DateModified = DateCreated;
DateLastActivity = DateCreated;
AccessToken = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
DateCreated = DateTime.UtcNow;
DateModified = DateCreated;
DateLastActivity = DateCreated;
// Non-nullable for EF Core, as this is a required relationship.
User = null!;
}
/// <summary>
/// Gets the id.
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the user id.
/// </summary>
public Guid UserId { get; private set; }
/// <summary>
/// Gets or sets the access token.
/// </summary>
public string AccessToken { get; set; }
/// <summary>
/// Gets or sets the app name.
/// </summary>
[MaxLength(64)]
[StringLength(64)]
public string AppName { get; set; }
/// <summary>
/// Gets or sets the app version.
/// </summary>
[MaxLength(32)]
[StringLength(32)]
public string AppVersion { get; set; }
/// <summary>
/// Gets or sets the device name.
/// </summary>
[MaxLength(64)]
[StringLength(64)]
public string DeviceName { get; set; }
/// <summary>
/// Gets or sets the device id.
/// </summary>
[MaxLength(256)]
[StringLength(256)]
public string DeviceId { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this device is active.
/// </summary>
public bool IsActive { get; set; }
/// <summary>
/// Gets or sets the date created.
/// </summary>
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the date modified.
/// </summary>
public DateTime DateModified { get; set; }
/// <summary>
/// Gets or sets the date of last activity.
/// </summary>
public DateTime DateLastActivity { get; set; }
/// <summary>
/// Gets the user.
/// </summary>
public User User { get; private set; }
// Non-nullable for EF Core, as this is a required relationship.
User = null!;
}
/// <summary>
/// Gets the id.
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the user id.
/// </summary>
public Guid UserId { get; private set; }
/// <summary>
/// Gets or sets the access token.
/// </summary>
public string AccessToken { get; set; }
/// <summary>
/// Gets or sets the app name.
/// </summary>
[MaxLength(64)]
[StringLength(64)]
public string AppName { get; set; }
/// <summary>
/// Gets or sets the app version.
/// </summary>
[MaxLength(32)]
[StringLength(32)]
public string AppVersion { get; set; }
/// <summary>
/// Gets or sets the device name.
/// </summary>
[MaxLength(64)]
[StringLength(64)]
public string DeviceName { get; set; }
/// <summary>
/// Gets or sets the device id.
/// </summary>
[MaxLength(256)]
[StringLength(256)]
public string DeviceId { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this device is active.
/// </summary>
public bool IsActive { get; set; }
/// <summary>
/// Gets or sets the date created.
/// </summary>
public DateTime DateCreated { get; set; }
/// <summary>
/// Gets or sets the date modified.
/// </summary>
public DateTime DateModified { get; set; }
/// <summary>
/// Gets or sets the date of last activity.
/// </summary>
public DateTime DateLastActivity { get; set; }
/// <summary>
/// Gets the user.
/// </summary>
public User User { get; private set; }
}
@@ -2,38 +2,37 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities.Security
using System.ComponentModel.DataAnnotations.Schema;
namespace Jellyfin.Database.Implementations.Entities.Security
/// <summary>
/// An entity representing custom options for a device.
/// </summary>
public class DeviceOptions
{
/// <summary>
/// An entity representing custom options for a device.
/// Initializes a new instance of the <see cref="DeviceOptions"/> class.
/// </summary>
public class DeviceOptions
/// <param name="deviceId">The device id.</param>
public DeviceOptions(string deviceId)
{
/// <summary>
/// Initializes a new instance of the <see cref="DeviceOptions"/> class.
/// </summary>
/// <param name="deviceId">The device id.</param>
public DeviceOptions(string deviceId)
{
DeviceId = deviceId;
}
/// <summary>
/// Gets the id.
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the device id.
/// </summary>
public string DeviceId { get; private set; }
/// <summary>
/// Gets or sets the custom name.
/// </summary>
public string? CustomName { get; set; }
DeviceId = deviceId;
}
/// <summary>
/// Gets the id.
/// </summary>
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; private set; }
/// <summary>
/// Gets the device id.
/// </summary>
public string DeviceId { get; private set; }
/// <summary>
/// Gets or sets the custom name.
/// </summary>
public string? CustomName { get; set; }
}
@@ -2,11 +2,11 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities;
using System;
using System.Text.Json.Serialization;
namespace Jellyfin.Database.Implementations.Entities;
/// <summary>
/// An entity representing the metadata for a group of trickplay tiles.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Entities
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@@ -10,335 +12,333 @@ using System.Text.Json.Serialization;
using Jellyfin.Database.Implementations.Enums;
using Jellyfin.Database.Implementations.Interfaces;
namespace Jellyfin.Database.Implementations.Entities
/// <summary>
/// An entity representing a user.
/// </summary>
public class User : IHasPermissions, IHasConcurrencyToken
{
/// <summary>
/// An entity representing a user.
/// Initializes a new instance of the <see cref="User"/> class.
/// Public constructor with required data.
/// </summary>
public class User : IHasPermissions, IHasConcurrencyToken
/// <param name="username">The username for the new user.</param>
/// <param name="authenticationProviderId">The Id of the user's authentication provider.</param>
/// <param name="passwordResetProviderId">The Id of the user's password reset provider.</param>
public User(string username, string authenticationProviderId, string passwordResetProviderId)
{
/// <summary>
/// Initializes a new instance of the <see cref="User"/> class.
/// Public constructor with required data.
/// </summary>
/// <param name="username">The username for the new user.</param>
/// <param name="authenticationProviderId">The Id of the user's authentication provider.</param>
/// <param name="passwordResetProviderId">The Id of the user's password reset provider.</param>
public User(string username, string authenticationProviderId, string passwordResetProviderId)
{
ArgumentException.ThrowIfNullOrEmpty(username);
ArgumentException.ThrowIfNullOrEmpty(authenticationProviderId);
ArgumentException.ThrowIfNullOrEmpty(passwordResetProviderId);
ArgumentException.ThrowIfNullOrEmpty(username);
ArgumentException.ThrowIfNullOrEmpty(authenticationProviderId);
ArgumentException.ThrowIfNullOrEmpty(passwordResetProviderId);
Username = username;
AuthenticationProviderId = authenticationProviderId;
PasswordResetProviderId = passwordResetProviderId;
Username = username;
AuthenticationProviderId = authenticationProviderId;
PasswordResetProviderId = passwordResetProviderId;
AccessSchedules = new HashSet<AccessSchedule>();
DisplayPreferences = new HashSet<DisplayPreferences>();
ItemDisplayPreferences = new HashSet<ItemDisplayPreferences>();
// Groups = new HashSet<Group>();
Permissions = new HashSet<Permission>();
Preferences = new HashSet<Preference>();
// ProviderMappings = new HashSet<ProviderMapping>();
AccessSchedules = new HashSet<AccessSchedule>();
DisplayPreferences = new HashSet<DisplayPreferences>();
ItemDisplayPreferences = new HashSet<ItemDisplayPreferences>();
// Groups = new HashSet<Group>();
Permissions = new HashSet<Permission>();
Preferences = new HashSet<Preference>();
// ProviderMappings = new HashSet<ProviderMapping>();
// Set default values
Id = Guid.NewGuid();
InvalidLoginAttemptCount = 0;
EnableUserPreferenceAccess = true;
MustUpdatePassword = false;
DisplayMissingEpisodes = false;
DisplayCollectionsView = false;
HidePlayedInLatest = true;
RememberAudioSelections = true;
RememberSubtitleSelections = true;
EnableNextEpisodeAutoPlay = true;
EnableAutoLogin = false;
PlayDefaultAudioTrack = true;
SubtitleMode = SubtitlePlaybackMode.Default;
SyncPlayAccess = SyncPlayUserAccessType.CreateAndJoinGroups;
}
// Set default values
Id = Guid.NewGuid();
InvalidLoginAttemptCount = 0;
EnableUserPreferenceAccess = true;
MustUpdatePassword = false;
DisplayMissingEpisodes = false;
DisplayCollectionsView = false;
HidePlayedInLatest = true;
RememberAudioSelections = true;
RememberSubtitleSelections = true;
EnableNextEpisodeAutoPlay = true;
EnableAutoLogin = false;
PlayDefaultAudioTrack = true;
SubtitleMode = SubtitlePlaybackMode.Default;
SyncPlayAccess = SyncPlayUserAccessType.CreateAndJoinGroups;
}
/// <summary>
/// Gets or sets the Id of the user.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the Id of the user.
/// </summary>
/// <remarks>
/// Identity, Indexed, Required.
/// </remarks>
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the user's name.
/// </summary>
/// <remarks>
/// Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string Username { get; set; }
/// <summary>
/// Gets or sets the user's name.
/// </summary>
/// <remarks>
/// Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string Username { get; set; }
/// <summary>
/// Gets or sets the user's password, or <c>null</c> if none is set.
/// </summary>
/// <remarks>
/// Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string? Password { get; set; }
/// <summary>
/// Gets or sets the user's password, or <c>null</c> if none is set.
/// </summary>
/// <remarks>
/// Max length = 65535.
/// </remarks>
[MaxLength(65535)]
[StringLength(65535)]
public string? Password { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the user must update their password.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool MustUpdatePassword { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the user must update their password.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool MustUpdatePassword { get; set; }
/// <summary>
/// Gets or sets the audio language preference.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string? AudioLanguagePreference { get; set; }
/// <summary>
/// Gets or sets the audio language preference.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string? AudioLanguagePreference { get; set; }
/// <summary>
/// Gets or sets the authentication provider id.
/// </summary>
/// <remarks>
/// Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string AuthenticationProviderId { get; set; }
/// <summary>
/// Gets or sets the authentication provider id.
/// </summary>
/// <remarks>
/// Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string AuthenticationProviderId { get; set; }
/// <summary>
/// Gets or sets the password reset provider id.
/// </summary>
/// <remarks>
/// Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string PasswordResetProviderId { get; set; }
/// <summary>
/// Gets or sets the password reset provider id.
/// </summary>
/// <remarks>
/// Required, Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string PasswordResetProviderId { get; set; }
/// <summary>
/// Gets or sets the invalid login attempt count.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int InvalidLoginAttemptCount { get; set; }
/// <summary>
/// Gets or sets the invalid login attempt count.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public int InvalidLoginAttemptCount { get; set; }
/// <summary>
/// Gets or sets the last activity date.
/// </summary>
public DateTime? LastActivityDate { get; set; }
/// <summary>
/// Gets or sets the last activity date.
/// </summary>
public DateTime? LastActivityDate { get; set; }
/// <summary>
/// Gets or sets the last login date.
/// </summary>
public DateTime? LastLoginDate { get; set; }
/// <summary>
/// Gets or sets the last login date.
/// </summary>
public DateTime? LastLoginDate { get; set; }
/// <summary>
/// Gets or sets the number of login attempts the user can make before they are locked out.
/// </summary>
public int? LoginAttemptsBeforeLockout { get; set; }
/// <summary>
/// Gets or sets the number of login attempts the user can make before they are locked out.
/// </summary>
public int? LoginAttemptsBeforeLockout { get; set; }
/// <summary>
/// Gets or sets the maximum number of active sessions the user can have at once.
/// </summary>
public int MaxActiveSessions { get; set; }
/// <summary>
/// Gets or sets the maximum number of active sessions the user can have at once.
/// </summary>
public int MaxActiveSessions { get; set; }
/// <summary>
/// Gets or sets the subtitle mode.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public SubtitlePlaybackMode SubtitleMode { get; set; }
/// <summary>
/// Gets or sets the subtitle mode.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public SubtitlePlaybackMode SubtitleMode { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the default audio track should be played.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool PlayDefaultAudioTrack { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the default audio track should be played.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool PlayDefaultAudioTrack { get; set; }
/// <summary>
/// Gets or sets the subtitle language preference.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string? SubtitleLanguagePreference { get; set; }
/// <summary>
/// Gets or sets the subtitle language preference.
/// </summary>
/// <remarks>
/// Max length = 255.
/// </remarks>
[MaxLength(255)]
[StringLength(255)]
public string? SubtitleLanguagePreference { get; set; }
/// <summary>
/// Gets or sets a value indicating whether missing episodes should be displayed.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool DisplayMissingEpisodes { get; set; }
/// <summary>
/// Gets or sets a value indicating whether missing episodes should be displayed.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool DisplayMissingEpisodes { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to display the collections view.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool DisplayCollectionsView { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to display the collections view.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool DisplayCollectionsView { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the user has a local password.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool EnableLocalPassword { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the user has a local password.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool EnableLocalPassword { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the server should hide played content in "Latest".
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool HidePlayedInLatest { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the server should hide played content in "Latest".
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool HidePlayedInLatest { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to remember audio selections on played content.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool RememberAudioSelections { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to remember audio selections on played content.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool RememberAudioSelections { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to remember subtitle selections on played content.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool RememberSubtitleSelections { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to remember subtitle selections on played content.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool RememberSubtitleSelections { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to enable auto-play for the next episode.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool EnableNextEpisodeAutoPlay { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to enable auto-play for the next episode.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool EnableNextEpisodeAutoPlay { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the user should auto-login.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool EnableAutoLogin { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the user should auto-login.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool EnableAutoLogin { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the user can change their preferences.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool EnableUserPreferenceAccess { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the user can change their preferences.
/// </summary>
/// <remarks>
/// Required.
/// </remarks>
public bool EnableUserPreferenceAccess { get; set; }
/// <summary>
/// Gets or sets the maximum parental rating score.
/// </summary>
public int? MaxParentalRatingScore { get; set; }
/// <summary>
/// Gets or sets the maximum parental rating score.
/// </summary>
public int? MaxParentalRatingScore { get; set; }
/// <summary>
/// Gets or sets the maximum parental rating sub score.
/// </summary>
public int? MaxParentalRatingSubScore { get; set; }
/// <summary>
/// Gets or sets the maximum parental rating sub score.
/// </summary>
public int? MaxParentalRatingSubScore { get; set; }
/// <summary>
/// Gets or sets the remote client bitrate limit.
/// </summary>
public int? RemoteClientBitrateLimit { get; set; }
/// <summary>
/// Gets or sets the remote client bitrate limit.
/// </summary>
public int? RemoteClientBitrateLimit { get; set; }
/// <summary>
/// Gets or sets the internal id.
/// This is a temporary stopgap for until the library db is migrated.
/// This corresponds to the value of the index of this user in the library db.
/// </summary>
public long InternalId { get; set; }
/// <summary>
/// Gets or sets the internal id.
/// This is a temporary stopgap for until the library db is migrated.
/// This corresponds to the value of the index of this user in the library db.
/// </summary>
public long InternalId { get; set; }
/// <summary>
/// Gets or sets the user's profile image. Can be <c>null</c>.
/// </summary>
// [ForeignKey("UserId")]
public virtual ImageInfo? ProfileImage { get; set; }
/// <summary>
/// Gets or sets the user's profile image. Can be <c>null</c>.
/// </summary>
// [ForeignKey("UserId")]
public virtual ImageInfo? ProfileImage { get; set; }
/// <summary>
/// Gets the user's display preferences.
/// </summary>
public virtual ICollection<DisplayPreferences> DisplayPreferences { get; private set; }
/// <summary>
/// Gets the user's display preferences.
/// </summary>
public virtual ICollection<DisplayPreferences> DisplayPreferences { get; private set; }
/// <summary>
/// Gets or sets the level of sync play permissions this user has.
/// </summary>
public SyncPlayUserAccessType SyncPlayAccess { get; set; }
/// <summary>
/// Gets or sets the level of sync play permissions this user has.
/// </summary>
public SyncPlayUserAccessType SyncPlayAccess { get; set; }
/// <summary>
/// Gets or sets the cast receiver id.
/// </summary>
[StringLength(32)]
public string? CastReceiverId { get; set; }
/// <summary>
/// Gets or sets the cast receiver id.
/// </summary>
[StringLength(32)]
public string? CastReceiverId { get; set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <inheritdoc />
[ConcurrencyCheck]
public uint RowVersion { get; private set; }
/// <summary>
/// Gets the list of access schedules this user has.
/// </summary>
public virtual ICollection<AccessSchedule> AccessSchedules { get; private set; }
/// <summary>
/// Gets the list of access schedules this user has.
/// </summary>
public virtual ICollection<AccessSchedule> AccessSchedules { get; private set; }
/// <summary>
/// Gets the list of item display preferences.
/// </summary>
public virtual ICollection<ItemDisplayPreferences> ItemDisplayPreferences { get; private set; }
/// <summary>
/// Gets the list of item display preferences.
/// </summary>
public virtual ICollection<ItemDisplayPreferences> ItemDisplayPreferences { get; private set; }
/*
/// <summary>
/// Gets the list of groups this user is a member of.
/// </summary>
public virtual ICollection<Group> Groups { get; private set; }
*/
/*
/// <summary>
/// Gets the list of groups this user is a member of.
/// </summary>
public virtual ICollection<Group> Groups { get; private set; }
*/
/// <summary>
/// Gets the list of permissions this user has.
/// </summary>
[ForeignKey("Permission_Permissions_Guid")]
public virtual ICollection<Permission> Permissions { get; private set; }
/// <summary>
/// Gets the list of permissions this user has.
/// </summary>
[ForeignKey("Permission_Permissions_Guid")]
public virtual ICollection<Permission> Permissions { get; private set; }
/*
/// <summary>
/// Gets the list of provider mappings this user has.
/// </summary>
public virtual ICollection<ProviderMapping> ProviderMappings { get; private set; }
*/
/*
/// <summary>
/// Gets the list of provider mappings this user has.
/// </summary>
public virtual ICollection<ProviderMapping> ProviderMappings { get; private set; }
*/
/// <summary>
/// Gets the list of preferences this user has.
/// </summary>
[ForeignKey("Preference_Preferences_Guid")]
public virtual ICollection<Preference> Preferences { get; private set; }
/// <summary>
/// Gets the list of preferences this user has.
/// </summary>
[ForeignKey("Preference_Preferences_Guid")]
public virtual ICollection<Preference> Preferences { get; private set; }
/// <inheritdoc/>
public void OnSavingChanges()
{
RowVersion++;
}
/// <inheritdoc/>
public void OnSavingChanges()
{
RowVersion++;
}
}
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using System;
namespace Jellyfin.Database.Implementations.Entities;
using System;
/// <summary>
/// Provides <see cref="BaseItemEntity"/> and <see cref="User"/> related data.
/// </summary>
@@ -32,5 +32,5 @@ public enum ArtKind
/// <summary>
/// A logo.
/// </summary>
Logo = 4
Logo = 4,
}
@@ -17,5 +17,5 @@ public enum ChromecastVersion
/// <summary>
/// Unstable Chromecast version.
/// </summary>
Unstable = 1
Unstable = 1,
}
@@ -57,5 +57,5 @@ public enum DynamicDayOfWeek
/// <summary>
/// Saturday and Sunday.
/// </summary>
Weekend = 9
Weekend = 9,
}
@@ -22,5 +22,5 @@ public enum IndexingKind
/// <summary>
/// Index by the community rating.
/// </summary>
CommunityRating = 2
CommunityRating = 2,
}
@@ -32,5 +32,5 @@ public enum MediaFileKind
/// <summary>
/// An additional stream for the main file.
/// </summary>
AdditionalStream = 4
AdditionalStream = 4,
}
@@ -2,10 +2,10 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
using Jellyfin.Database.Implementations.Entities;
namespace Jellyfin.Database.Implementations.Enums;
using Jellyfin.Database.Implementations.Entities;
/// <summary>
/// Defines the types of content an individual <see cref="MediaSegment"/> represents.
/// </summary>
@@ -39,5 +39,5 @@ public enum MediaSegmentType
/// <summary>
/// Intro.
/// </summary>
Intro = 5
Intro = 5,
}
@@ -67,5 +67,5 @@ public enum PersonRoleType
/// <summary>
/// An editor.
/// </summary>
Editor = 11
Editor = 11,
}
@@ -72,5 +72,5 @@ public enum PreferenceKind
/// <summary>
/// A list of allowed tags.
/// </summary>
AllowedTags = 12
AllowedTags = 12,
}
@@ -17,5 +17,5 @@ public enum ScrollDirection
/// <summary>
/// Vertical scrolling direction.
/// </summary>
Vertical = 1
Vertical = 1,
}
@@ -17,5 +17,5 @@ public enum SortOrder
/// <summary>
/// Sort in decreasing order.
/// </summary>
Descending = 1
Descending = 1,
}
@@ -32,5 +32,5 @@ public enum SubtitlePlaybackMode
/// <summary>
/// Only show subtitles when the current audio stream is in a different language.
/// </summary>
Smart = 4
Smart = 4,
}
@@ -22,5 +22,5 @@ public enum SyncPlayUserAccessType
/// <summary>
/// SyncPlay is disabled for the user.
/// </summary>
None = 2
None = 2,
}
@@ -112,5 +112,5 @@ public enum ViewType
/// <summary>
/// Shows upcoming.
/// </summary>
Upcoming = 20
Upcoming = 20,
}
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations;
using System;
using System.Collections.Generic;
using System.Threading;
@@ -9,8 +11,6 @@ using System.Threading.Tasks;
using Jellyfin.Database.Implementations.DbConfiguration;
using Microsoft.EntityFrameworkCore;
namespace Jellyfin.Database.Implementations;
/// <summary>
/// Defines the type and extension points for multi database support.
/// </summary>
@@ -2,19 +2,18 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Interfaces
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Entities.Libraries;
namespace Jellyfin.Database.Implementations.Interfaces
/// <summary>
/// An interface abstracting an entity that has artwork.
/// </summary>
public interface IHasArtwork
{
/// <summary>
/// An interface abstracting an entity that has artwork.
/// Gets a collection containing this entity's artwork.
/// </summary>
public interface IHasArtwork
{
/// <summary>
/// Gets a collection containing this entity's artwork.
/// </summary>
ICollection<Artwork> Artwork { get; }
}
ICollection<Artwork> Artwork { get; }
}
@@ -2,19 +2,18 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Interfaces
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Entities.Libraries;
namespace Jellyfin.Database.Implementations.Interfaces
/// <summary>
/// An abstraction representing an entity that has companies.
/// </summary>
public interface IHasCompanies
{
/// <summary>
/// An abstraction representing an entity that has companies.
/// Gets a collection containing this entity's companies.
/// </summary>
public interface IHasCompanies
{
/// <summary>
/// Gets a collection containing this entity's companies.
/// </summary>
ICollection<Company> Companies { get; }
}
ICollection<Company> Companies { get; }
}
@@ -2,11 +2,11 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Interfaces;
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Entities;
namespace Jellyfin.Database.Implementations.Interfaces;
/// <summary>
/// An abstraction representing an entity that has permissions.
/// </summary>
@@ -2,11 +2,11 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Interfaces;
using System.Collections.Generic;
using Jellyfin.Database.Implementations.Entities.Libraries;
namespace Jellyfin.Database.Implementations.Interfaces;
/// <summary>
/// An abstraction representing an entity that has releases.
/// </summary>
@@ -12,7 +12,7 @@ public sealed class JellyfinDatabaseProviderKeyAttribute : System.Attribute
{
// See the attribute guidelines at
// http://go.microsoft.com/fwlink/?LinkId=85236
private readonly string _databaseProviderKey;
private readonly string databaseProviderKey;
/// <summary>
/// Initializes a new instance of the <see cref="JellyfinDatabaseProviderKeyAttribute"/> class.
@@ -20,7 +20,7 @@ public sealed class JellyfinDatabaseProviderKeyAttribute : System.Attribute
/// <param name="databaseProviderKey">The key on which to identify the annotated provider.</param>
public JellyfinDatabaseProviderKeyAttribute(string databaseProviderKey)
{
_databaseProviderKey = databaseProviderKey;
databaseProviderKey = databaseProviderKey;
}
/// <summary>
@@ -28,6 +28,6 @@ public sealed class JellyfinDatabaseProviderKeyAttribute : System.Attribute
/// </summary>
public string DatabaseProviderKey
{
get { return _databaseProviderKey; }
get { return databaseProviderKey; }
}
}
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations;
using System;
using System.Data.Common;
using System.Linq;
@@ -15,7 +17,6 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.Logging;
namespace Jellyfin.Database.Implementations;
/// <inheritdoc/>
/// <summary>
@@ -4,6 +4,8 @@
#pragma warning disable RS0030 // Do not use banned APIs
namespace Jellyfin.Database.Implementations;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -13,8 +15,6 @@ using System.Reflection;
using Jellyfin.Database.Implementations.Entities;
using Microsoft.EntityFrameworkCore;
namespace Jellyfin.Database.Implementations;
/// <summary>
/// Contains a number of query related extensions.
/// </summary>
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Locking;
using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
namespace Jellyfin.Database.Implementations.Locking;
/// <summary>
/// Defines a jellyfin locking behavior that can be configured.
/// </summary>
@@ -2,13 +2,13 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Locking;
using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace Jellyfin.Database.Implementations.Locking;
/// <summary>
/// Default lock behavior. Defines no explicit application locking behavior.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Locking;
#pragma warning disable CA1873
using System;
@@ -15,8 +17,6 @@ using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.Logging;
using Polly;
namespace Jellyfin.Database.Implementations.Locking;
/// <summary>
/// Defines a locking mechanism that will retry any write operation for a few times.
/// </summary>
@@ -2,6 +2,8 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.Locking;
#pragma warning disable MT1013 // Releasing lock without guarantee of execution
#pragma warning disable MT1012 // Acquiring lock without guarantee of releasing
#pragma warning disable CA1873
@@ -16,8 +18,6 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.Logging;
namespace Jellyfin.Database.Implementations.Locking;
/// <summary>
/// A locking behavior that will always block any operation while a write is requested. Mimicks the old SqliteRepository behavior.
/// </summary>
@@ -2,12 +2,12 @@
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Database.Implementations.ModelConfiguration;
using Jellyfin.Database.Implementations.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Jellyfin.Database.Implementations.ModelConfiguration;
/// <summary>
/// FluentAPI configuration for the ActivityLog entity.
/// </summary>

Some files were not shown because too many files have changed in this diff Show More