aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Data
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2023-11-09 22:03:55 -0700
committerGitHub <noreply@github.com>2023-11-09 22:03:55 -0700
commit892973a9e372000ad7babe2381e4e83b39591951 (patch)
treefc408136c09e6377309629ad6b2d4b2b26ff3c3f /Jellyfin.Data
parent35bd0c00c965176d6ddb167605ed3a3eba9a4524 (diff)
parent44b771bfb4b6412360b18c80621c90902c0a43a7 (diff)
Merge branch 'master' into media-type
Diffstat (limited to 'Jellyfin.Data')
-rw-r--r--Jellyfin.Data/Attributes/OpenApiIgnoreEnumAttribute.cs11
-rw-r--r--Jellyfin.Data/Entities/TrickplayInfo.cs75
-rw-r--r--Jellyfin.Data/Entities/User.cs7
-rw-r--r--Jellyfin.Data/Enums/CollectionType.cs164
-rw-r--r--Jellyfin.Data/Enums/ItemSortBy.cs167
-rw-r--r--Jellyfin.Data/Enums/PermissionKind.cs7
-rw-r--r--Jellyfin.Data/Jellyfin.Data.csproj6
7 files changed, 435 insertions, 2 deletions
diff --git a/Jellyfin.Data/Attributes/OpenApiIgnoreEnumAttribute.cs b/Jellyfin.Data/Attributes/OpenApiIgnoreEnumAttribute.cs
new file mode 100644
index 000000000..ff613d9f8
--- /dev/null
+++ b/Jellyfin.Data/Attributes/OpenApiIgnoreEnumAttribute.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace Jellyfin.Data.Attributes;
+
+/// <summary>
+/// Attribute to specify that the enum value is to be ignored when generating the openapi spec.
+/// </summary>
+[AttributeUsage(AttributeTargets.Field)]
+public sealed class OpenApiIgnoreEnumAttribute : Attribute
+{
+}
diff --git a/Jellyfin.Data/Entities/TrickplayInfo.cs b/Jellyfin.Data/Entities/TrickplayInfo.cs
new file mode 100644
index 000000000..64e7da1b5
--- /dev/null
+++ b/Jellyfin.Data/Entities/TrickplayInfo.cs
@@ -0,0 +1,75 @@
+using System;
+using System.Text.Json.Serialization;
+
+namespace Jellyfin.Data.Entities;
+
+/// <summary>
+/// An entity representing the metadata for a group of trickplay tiles.
+/// </summary>
+public class TrickplayInfo
+{
+ /// <summary>
+ /// Gets or sets the id of the associated item.
+ /// </summary>
+ /// <remarks>
+ /// Required.
+ /// </remarks>
+ [JsonIgnore]
+ public Guid ItemId { get; set; }
+
+ /// <summary>
+ /// Gets or sets width of an individual thumbnail.
+ /// </summary>
+ /// <remarks>
+ /// Required.
+ /// </remarks>
+ public int Width { get; set; }
+
+ /// <summary>
+ /// Gets or sets height of an individual thumbnail.
+ /// </summary>
+ /// <remarks>
+ /// Required.
+ /// </remarks>
+ public int Height { get; set; }
+
+ /// <summary>
+ /// Gets or sets amount of thumbnails per row.
+ /// </summary>
+ /// <remarks>
+ /// Required.
+ /// </remarks>
+ public int TileWidth { get; set; }
+
+ /// <summary>
+ /// Gets or sets amount of thumbnails per column.
+ /// </summary>
+ /// <remarks>
+ /// Required.
+ /// </remarks>
+ public int TileHeight { get; set; }
+
+ /// <summary>
+ /// Gets or sets total amount of non-black thumbnails.
+ /// </summary>
+ /// <remarks>
+ /// Required.
+ /// </remarks>
+ public int ThumbnailCount { get; set; }
+
+ /// <summary>
+ /// Gets or sets interval in milliseconds between each trickplay thumbnail.
+ /// </summary>
+ /// <remarks>
+ /// Required.
+ /// </remarks>
+ public int Interval { get; set; }
+
+ /// <summary>
+ /// Gets or sets peak bandwith usage in bits per second.
+ /// </summary>
+ /// <remarks>
+ /// Required.
+ /// </remarks>
+ public int Bandwidth { get; set; }
+}
diff --git a/Jellyfin.Data/Entities/User.cs b/Jellyfin.Data/Entities/User.cs
index 58ddaaf83..ea0de3016 100644
--- a/Jellyfin.Data/Entities/User.cs
+++ b/Jellyfin.Data/Entities/User.cs
@@ -288,6 +288,12 @@ namespace Jellyfin.Data.Entities
/// </summary>
public SyncPlayUserAccessType SyncPlayAccess { 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; }
@@ -499,6 +505,7 @@ namespace Jellyfin.Data.Entities
Permissions.Add(new Permission(PermissionKind.ForceRemoteSourceTranscoding, false));
Permissions.Add(new Permission(PermissionKind.EnableRemoteControlOfOtherUsers, false));
Permissions.Add(new Permission(PermissionKind.EnableCollectionManagement, false));
+ Permissions.Add(new Permission(PermissionKind.EnableSubtitleManagement, false));
}
/// <summary>
diff --git a/Jellyfin.Data/Enums/CollectionType.cs b/Jellyfin.Data/Enums/CollectionType.cs
new file mode 100644
index 000000000..e2044a0bc
--- /dev/null
+++ b/Jellyfin.Data/Enums/CollectionType.cs
@@ -0,0 +1,164 @@
+using Jellyfin.Data.Attributes;
+
+namespace Jellyfin.Data.Enums;
+
+/// <summary>
+/// Collection type.
+/// </summary>
+public enum CollectionType
+{
+ /// <summary>
+ /// Unknown collection.
+ /// </summary>
+ Unknown = 0,
+
+ /// <summary>
+ /// Movies collection.
+ /// </summary>
+ Movies = 1,
+
+ /// <summary>
+ /// Tv shows collection.
+ /// </summary>
+ TvShows = 2,
+
+ /// <summary>
+ /// Music collection.
+ /// </summary>
+ Music = 3,
+
+ /// <summary>
+ /// Music videos collection.
+ /// </summary>
+ MusicVideos = 4,
+
+ /// <summary>
+ /// Trailers collection.
+ /// </summary>
+ Trailers = 5,
+
+ /// <summary>
+ /// Home videos collection.
+ /// </summary>
+ HomeVideos = 6,
+
+ /// <summary>
+ /// Box sets collection.
+ /// </summary>
+ BoxSets = 7,
+
+ /// <summary>
+ /// Books collection.
+ /// </summary>
+ Books = 8,
+
+ /// <summary>
+ /// Photos collection.
+ /// </summary>
+ Photos = 9,
+
+ /// <summary>
+ /// Live tv collection.
+ /// </summary>
+ LiveTv = 10,
+
+ /// <summary>
+ /// Playlists collection.
+ /// </summary>
+ Playlists = 11,
+
+ /// <summary>
+ /// Folders collection.
+ /// </summary>
+ Folders = 12,
+
+ /// <summary>
+ /// Tv show series collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ TvShowSeries = 101,
+
+ /// <summary>
+ /// Tv genres collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ TvGenres = 102,
+
+ /// <summary>
+ /// Tv genre collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ TvGenre = 103,
+
+ /// <summary>
+ /// Tv latest collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ TvLatest = 104,
+
+ /// <summary>
+ /// Tv next up collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ TvNextUp = 105,
+
+ /// <summary>
+ /// Tv resume collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ TvResume = 106,
+
+ /// <summary>
+ /// Tv favorite series collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ TvFavoriteSeries = 107,
+
+ /// <summary>
+ /// Tv favorite episodes collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ TvFavoriteEpisodes = 108,
+
+ /// <summary>
+ /// Latest movies collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ MovieLatest = 109,
+
+ /// <summary>
+ /// Movies to resume collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ MovieResume = 110,
+
+ /// <summary>
+ /// Movie movie collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ MovieMovies = 111,
+
+ /// <summary>
+ /// Movie collections collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ MovieCollections = 112,
+
+ /// <summary>
+ /// Movie favorites collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ MovieFavorites = 113,
+
+ /// <summary>
+ /// Movie genres collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ MovieGenres = 114,
+
+ /// <summary>
+ /// Movie genre collection.
+ /// </summary>
+ [OpenApiIgnoreEnum]
+ MovieGenre = 115
+}
diff --git a/Jellyfin.Data/Enums/ItemSortBy.cs b/Jellyfin.Data/Enums/ItemSortBy.cs
new file mode 100644
index 000000000..17bf1166d
--- /dev/null
+++ b/Jellyfin.Data/Enums/ItemSortBy.cs
@@ -0,0 +1,167 @@
+namespace Jellyfin.Data.Enums;
+
+/// <summary>
+/// These represent sort orders.
+/// </summary>
+public enum ItemSortBy
+{
+ /// <summary>
+ /// Default sort order.
+ /// </summary>
+ Default = 0,
+
+ /// <summary>
+ /// The aired episode order.
+ /// </summary>
+ AiredEpisodeOrder = 1,
+
+ /// <summary>
+ /// The album.
+ /// </summary>
+ Album = 2,
+
+ /// <summary>
+ /// The album artist.
+ /// </summary>
+ AlbumArtist = 3,
+
+ /// <summary>
+ /// The artist.
+ /// </summary>
+ Artist = 4,
+
+ /// <summary>
+ /// The date created.
+ /// </summary>
+ DateCreated = 5,
+
+ /// <summary>
+ /// The official rating.
+ /// </summary>
+ OfficialRating = 6,
+
+ /// <summary>
+ /// The date played.
+ /// </summary>
+ DatePlayed = 7,
+
+ /// <summary>
+ /// The premiere date.
+ /// </summary>
+ PremiereDate = 8,
+
+ /// <summary>
+ /// The start date.
+ /// </summary>
+ StartDate = 9,
+
+ /// <summary>
+ /// The sort name.
+ /// </summary>
+ SortName = 10,
+
+ /// <summary>
+ /// The name.
+ /// </summary>
+ Name = 11,
+
+ /// <summary>
+ /// The random.
+ /// </summary>
+ Random = 12,
+
+ /// <summary>
+ /// The runtime.
+ /// </summary>
+ Runtime = 13,
+
+ /// <summary>
+ /// The community rating.
+ /// </summary>
+ CommunityRating = 14,
+
+ /// <summary>
+ /// The production year.
+ /// </summary>
+ ProductionYear = 15,
+
+ /// <summary>
+ /// The play count.
+ /// </summary>
+ PlayCount = 16,
+
+ /// <summary>
+ /// The critic rating.
+ /// </summary>
+ CriticRating = 17,
+
+ /// <summary>
+ /// The IsFolder boolean.
+ /// </summary>
+ IsFolder = 18,
+
+ /// <summary>
+ /// The IsUnplayed boolean.
+ /// </summary>
+ IsUnplayed = 19,
+
+ /// <summary>
+ /// The IsPlayed boolean.
+ /// </summary>
+ IsPlayed = 20,
+
+ /// <summary>
+ /// The series sort.
+ /// </summary>
+ SeriesSortName = 21,
+
+ /// <summary>
+ /// The video bitrate.
+ /// </summary>
+ VideoBitRate = 22,
+
+ /// <summary>
+ /// The air time.
+ /// </summary>
+ AirTime = 23,
+
+ /// <summary>
+ /// The studio.
+ /// </summary>
+ Studio = 24,
+
+ /// <summary>
+ /// The IsFavouriteOrLiked boolean.
+ /// </summary>
+ IsFavoriteOrLiked = 25,
+
+ /// <summary>
+ /// The last content added date.
+ /// </summary>
+ DateLastContentAdded = 26,
+
+ /// <summary>
+ /// The series last played date.
+ /// </summary>
+ SeriesDatePlayed = 27,
+
+ /// <summary>
+ /// The parent index number.
+ /// </summary>
+ ParentIndexNumber = 28,
+
+ /// <summary>
+ /// The index number.
+ /// </summary>
+ IndexNumber = 29,
+
+ /// <summary>
+ /// The similarity score.
+ /// </summary>
+ SimilarityScore = 30,
+
+ /// <summary>
+ /// The search score.
+ /// </summary>
+ SearchScore = 31,
+}
diff --git a/Jellyfin.Data/Enums/PermissionKind.cs b/Jellyfin.Data/Enums/PermissionKind.cs
index 40280b95e..6644f0151 100644
--- a/Jellyfin.Data/Enums/PermissionKind.cs
+++ b/Jellyfin.Data/Enums/PermissionKind.cs
@@ -113,6 +113,11 @@ namespace Jellyfin.Data.Enums
/// <summary>
/// Whether the user can create, modify and delete collections.
/// </summary>
- EnableCollectionManagement = 21
+ EnableCollectionManagement = 21,
+
+ /// <summary>
+ /// Whether the user can edit subtitles.
+ /// </summary>
+ EnableSubtitleManagement = 22
}
}
diff --git a/Jellyfin.Data/Jellyfin.Data.csproj b/Jellyfin.Data/Jellyfin.Data.csproj
index 1bc5d8bf9..847853ca0 100644
--- a/Jellyfin.Data/Jellyfin.Data.csproj
+++ b/Jellyfin.Data/Jellyfin.Data.csproj
@@ -27,8 +27,12 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>
- <!-- Code analysers-->
+ <!-- Code Analyzers -->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <PackageReference Include="IDisposableAnalyzers">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
+ </PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>