aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Data/Interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Data/Interfaces')
-rw-r--r--Jellyfin.Data/Interfaces/IHasArtwork.cs16
-rw-r--r--Jellyfin.Data/Interfaces/IHasCompanies.cs16
-rw-r--r--Jellyfin.Data/Interfaces/IHasConcurrencyToken.cs18
-rw-r--r--Jellyfin.Data/Interfaces/IHasPermissions.cs31
-rw-r--r--Jellyfin.Data/Interfaces/IHasReleases.cs16
5 files changed, 97 insertions, 0 deletions
diff --git a/Jellyfin.Data/Interfaces/IHasArtwork.cs b/Jellyfin.Data/Interfaces/IHasArtwork.cs
new file mode 100644
index 000000000..a4d9c54af
--- /dev/null
+++ b/Jellyfin.Data/Interfaces/IHasArtwork.cs
@@ -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; }
+ }
+}
diff --git a/Jellyfin.Data/Interfaces/IHasCompanies.cs b/Jellyfin.Data/Interfaces/IHasCompanies.cs
new file mode 100644
index 000000000..8f19ce04f
--- /dev/null
+++ b/Jellyfin.Data/Interfaces/IHasCompanies.cs
@@ -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; }
+ }
+}
diff --git a/Jellyfin.Data/Interfaces/IHasConcurrencyToken.cs b/Jellyfin.Data/Interfaces/IHasConcurrencyToken.cs
new file mode 100644
index 000000000..2c4091493
--- /dev/null
+++ b/Jellyfin.Data/Interfaces/IHasConcurrencyToken.cs
@@ -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();
+ }
+}
diff --git a/Jellyfin.Data/Interfaces/IHasPermissions.cs b/Jellyfin.Data/Interfaces/IHasPermissions.cs
new file mode 100644
index 000000000..3be72259a
--- /dev/null
+++ b/Jellyfin.Data/Interfaces/IHasPermissions.cs
@@ -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);
+ }
+}
diff --git a/Jellyfin.Data/Interfaces/IHasReleases.cs b/Jellyfin.Data/Interfaces/IHasReleases.cs
new file mode 100644
index 000000000..3b615893e
--- /dev/null
+++ b/Jellyfin.Data/Interfaces/IHasReleases.cs
@@ -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; }
+ }
+}