mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-18 13:40:45 +01:00
First pass at cleaning entity classes.
- Documents all library entities - Fixes styling warnings for library entities - Updates library entities to inherit from interfaces - Makes library entites no longer partial.
This commit is contained in:
16
Jellyfin.Data/Interfaces/IHasArtwork.cs
Normal file
16
Jellyfin.Data/Interfaces/IHasArtwork.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using Jellyfin.Data.Entities.Libraries;
|
||||
|
||||
namespace Jellyfin.Data.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface abstracting an entity that has artwork.
|
||||
/// </summary>
|
||||
public interface IHasArtwork
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a collection containing this entity's artwork.
|
||||
/// </summary>
|
||||
ICollection<Artwork> Artwork { get; }
|
||||
}
|
||||
}
|
||||
16
Jellyfin.Data/Interfaces/IHasCompanies.cs
Normal file
16
Jellyfin.Data/Interfaces/IHasCompanies.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using Jellyfin.Data.Entities.Libraries;
|
||||
|
||||
namespace Jellyfin.Data.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// An abstraction representing an entity that has companies.
|
||||
/// </summary>
|
||||
public interface IHasCompanies
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a collection containing this entity's companies.
|
||||
/// </summary>
|
||||
ICollection<Company> Companies { get; }
|
||||
}
|
||||
}
|
||||
18
Jellyfin.Data/Interfaces/IHasConcurrencyToken.cs
Normal file
18
Jellyfin.Data/Interfaces/IHasConcurrencyToken.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace Jellyfin.Data.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface abstracting an entity that has a concurrency token.
|
||||
/// </summary>
|
||||
public interface IHasConcurrencyToken
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the version of this row. Acts as a concurrency token.
|
||||
/// </summary>
|
||||
uint RowVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Called when saving changes to this entity.
|
||||
/// </summary>
|
||||
void OnSavingChanges();
|
||||
}
|
||||
}
|
||||
31
Jellyfin.Data/Interfaces/IHasPermissions.cs
Normal file
31
Jellyfin.Data/Interfaces/IHasPermissions.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using Jellyfin.Data.Entities;
|
||||
using Jellyfin.Data.Enums;
|
||||
|
||||
namespace Jellyfin.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// An abstraction representing an entity that has permissions.
|
||||
/// </summary>
|
||||
public interface IHasPermissions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a collection containing this entity's permissions.
|
||||
/// </summary>
|
||||
ICollection<Permission> Permissions { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether this entity has the specified permission kind.
|
||||
/// </summary>
|
||||
/// <param name="kind">The kind of permission.</param>
|
||||
/// <returns><c>true</c> if this entity has the specified permission, <c>false</c> otherwise.</returns>
|
||||
bool HasPermission(PermissionKind kind);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the specified permission to the provided value.
|
||||
/// </summary>
|
||||
/// <param name="kind">The kind of permission.</param>
|
||||
/// <param name="value">The value to set.</param>
|
||||
void SetPermission(PermissionKind kind, bool value);
|
||||
}
|
||||
}
|
||||
16
Jellyfin.Data/Interfaces/IHasReleases.cs
Normal file
16
Jellyfin.Data/Interfaces/IHasReleases.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using Jellyfin.Data.Entities.Libraries;
|
||||
|
||||
namespace Jellyfin.Data.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// An abstraction representing an entity that has releases.
|
||||
/// </summary>
|
||||
public interface IHasReleases
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a collection containing this entity's releases.
|
||||
/// </summary>
|
||||
ICollection<Release> Releases { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user