aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Models
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-06-25 16:05:15 -0600
committercrobibero <cody@robibe.ro>2020-06-25 16:05:15 -0600
commit0740ec611211cb121a2ea4f97ab43b92d6411d4d (patch)
treebcc5fee8f82e30ebe087966115320dbf66d1fd5c /Jellyfin.Api/Models
parentccd7b3f52435de880158bc41dec9268dc9acbdd5 (diff)
parent7bd91727791d5723e779e63b913e8650380048ce (diff)
Merge remote-tracking branch 'upstream/api-migration' into api-image-service
Diffstat (limited to 'Jellyfin.Api/Models')
-rw-r--r--Jellyfin.Api/Models/ConfigurationPageInfo.cs85
-rw-r--r--Jellyfin.Api/Models/LibraryDtos/LibraryOptionInfoDto.cs18
-rw-r--r--Jellyfin.Api/Models/LibraryDtos/LibraryOptionsResultDto.cs34
-rw-r--r--Jellyfin.Api/Models/LibraryDtos/LibraryTypeOptionsDto.cs41
-rw-r--r--Jellyfin.Api/Models/LibraryDtos/MediaUpdateInfoDto.cs19
-rw-r--r--Jellyfin.Api/Models/PlaylistDtos/CreatePlaylistDto.cs30
6 files changed, 227 insertions, 0 deletions
diff --git a/Jellyfin.Api/Models/ConfigurationPageInfo.cs b/Jellyfin.Api/Models/ConfigurationPageInfo.cs
new file mode 100644
index 000000000..2aa6373aa
--- /dev/null
+++ b/Jellyfin.Api/Models/ConfigurationPageInfo.cs
@@ -0,0 +1,85 @@
+using MediaBrowser.Common.Plugins;
+using MediaBrowser.Controller.Plugins;
+using MediaBrowser.Model.Plugins;
+
+namespace Jellyfin.Api.Models
+{
+ /// <summary>
+ /// The configuration page info.
+ /// </summary>
+ public class ConfigurationPageInfo
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ConfigurationPageInfo"/> class.
+ /// </summary>
+ /// <param name="page">Instance of <see cref="IPluginConfigurationPage"/> interface.</param>
+ public ConfigurationPageInfo(IPluginConfigurationPage page)
+ {
+ Name = page.Name;
+
+ ConfigurationPageType = page.ConfigurationPageType;
+
+ if (page.Plugin != null)
+ {
+ DisplayName = page.Plugin.Name;
+ // Don't use "N" because it needs to match Plugin.Id
+ PluginId = page.Plugin.Id.ToString();
+ }
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ConfigurationPageInfo"/> class.
+ /// </summary>
+ /// <param name="plugin">Instance of <see cref="IPlugin"/> interface.</param>
+ /// <param name="page">Instance of <see cref="PluginPageInfo"/> interface.</param>
+ public ConfigurationPageInfo(IPlugin plugin, PluginPageInfo page)
+ {
+ Name = page.Name;
+ EnableInMainMenu = page.EnableInMainMenu;
+ MenuSection = page.MenuSection;
+ MenuIcon = page.MenuIcon;
+ DisplayName = string.IsNullOrWhiteSpace(page.DisplayName) ? plugin.Name : page.DisplayName;
+
+ // Don't use "N" because it needs to match Plugin.Id
+ PluginId = plugin.Id.ToString();
+ }
+
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the configurations page is enabled in the main menu.
+ /// </summary>
+ public bool EnableInMainMenu { get; set; }
+
+ /// <summary>
+ /// Gets or sets the menu section.
+ /// </summary>
+ public string? MenuSection { get; set; }
+
+ /// <summary>
+ /// Gets or sets the menu icon.
+ /// </summary>
+ public string? MenuIcon { get; set; }
+
+ /// <summary>
+ /// Gets or sets the display name.
+ /// </summary>
+ public string? DisplayName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the type of the configuration page.
+ /// </summary>
+ /// <value>The type of the configuration page.</value>
+ public ConfigurationPageType ConfigurationPageType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the plugin id.
+ /// </summary>
+ /// <value>The plugin id.</value>
+ public string? PluginId { get; set; }
+ }
+}
diff --git a/Jellyfin.Api/Models/LibraryDtos/LibraryOptionInfoDto.cs b/Jellyfin.Api/Models/LibraryDtos/LibraryOptionInfoDto.cs
new file mode 100644
index 000000000..358434434
--- /dev/null
+++ b/Jellyfin.Api/Models/LibraryDtos/LibraryOptionInfoDto.cs
@@ -0,0 +1,18 @@
+namespace Jellyfin.Api.Models.LibraryDtos
+{
+ /// <summary>
+ /// Library option info dto.
+ /// </summary>
+ public class LibraryOptionInfoDto
+ {
+ /// <summary>
+ /// Gets or sets name.
+ /// </summary>
+ public string? Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether default enabled.
+ /// </summary>
+ public bool DefaultEnabled { get; set; }
+ }
+}
diff --git a/Jellyfin.Api/Models/LibraryDtos/LibraryOptionsResultDto.cs b/Jellyfin.Api/Models/LibraryDtos/LibraryOptionsResultDto.cs
new file mode 100644
index 000000000..33eda33cb
--- /dev/null
+++ b/Jellyfin.Api/Models/LibraryDtos/LibraryOptionsResultDto.cs
@@ -0,0 +1,34 @@
+using System.Diagnostics.CodeAnalysis;
+
+namespace Jellyfin.Api.Models.LibraryDtos
+{
+ /// <summary>
+ /// Library options result dto.
+ /// </summary>
+ public class LibraryOptionsResultDto
+ {
+ /// <summary>
+ /// Gets or sets the metadata savers.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1819:ReturnArrays", MessageId = "MetadataSavers", Justification = "Imported from ServiceStack")]
+ public LibraryOptionInfoDto[] MetadataSavers { get; set; } = null!;
+
+ /// <summary>
+ /// Gets or sets the metadata readers.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1819:ReturnArrays", MessageId = "MetadataReaders", Justification = "Imported from ServiceStack")]
+ public LibraryOptionInfoDto[] MetadataReaders { get; set; } = null!;
+
+ /// <summary>
+ /// Gets or sets the subtitle fetchers.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1819:ReturnArrays", MessageId = "SubtitleFetchers", Justification = "Imported from ServiceStack")]
+ public LibraryOptionInfoDto[] SubtitleFetchers { get; set; } = null!;
+
+ /// <summary>
+ /// Gets or sets the type options.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1819:ReturnArrays", MessageId = "TypeOptions", Justification = "Imported from ServiceStack")]
+ public LibraryTypeOptionsDto[] TypeOptions { get; set; } = null!;
+ }
+}
diff --git a/Jellyfin.Api/Models/LibraryDtos/LibraryTypeOptionsDto.cs b/Jellyfin.Api/Models/LibraryDtos/LibraryTypeOptionsDto.cs
new file mode 100644
index 000000000..ad031e95e
--- /dev/null
+++ b/Jellyfin.Api/Models/LibraryDtos/LibraryTypeOptionsDto.cs
@@ -0,0 +1,41 @@
+using System.Diagnostics.CodeAnalysis;
+using MediaBrowser.Model.Configuration;
+using MediaBrowser.Model.Entities;
+
+namespace Jellyfin.Api.Models.LibraryDtos
+{
+ /// <summary>
+ /// Library type options dto.
+ /// </summary>
+ public class LibraryTypeOptionsDto
+ {
+ /// <summary>
+ /// Gets or sets the type.
+ /// </summary>
+ public string? Type { get; set; }
+
+ /// <summary>
+ /// Gets or sets the metadata fetchers.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1819:ReturnArrays", MessageId = "MetadataFetchers", Justification = "Imported from ServiceStack")]
+ public LibraryOptionInfoDto[] MetadataFetchers { get; set; } = null!;
+
+ /// <summary>
+ /// Gets or sets the image fetchers.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1819:ReturnArrays", MessageId = "ImageFetchers", Justification = "Imported from ServiceStack")]
+ public LibraryOptionInfoDto[] ImageFetchers { get; set; } = null!;
+
+ /// <summary>
+ /// Gets or sets the supported image types.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1819:ReturnArrays", MessageId = "SupportedImageTypes", Justification = "Imported from ServiceStack")]
+ public ImageType[] SupportedImageTypes { get; set; } = null!;
+
+ /// <summary>
+ /// Gets or sets the default image options.
+ /// </summary>
+ [SuppressMessage("Microsoft.Performance", "CA1819:ReturnArrays", MessageId = "DefaultImageOptions", Justification = "Imported from ServiceStack")]
+ public ImageOption[] DefaultImageOptions { get; set; } = null!;
+ }
+}
diff --git a/Jellyfin.Api/Models/LibraryDtos/MediaUpdateInfoDto.cs b/Jellyfin.Api/Models/LibraryDtos/MediaUpdateInfoDto.cs
new file mode 100644
index 000000000..991dbfc50
--- /dev/null
+++ b/Jellyfin.Api/Models/LibraryDtos/MediaUpdateInfoDto.cs
@@ -0,0 +1,19 @@
+namespace Jellyfin.Api.Models.LibraryDtos
+{
+ /// <summary>
+ /// Media Update Info Dto.
+ /// </summary>
+ public class MediaUpdateInfoDto
+ {
+ /// <summary>
+ /// Gets or sets media path.
+ /// </summary>
+ public string? Path { get; set; }
+
+ /// <summary>
+ /// Gets or sets media update type.
+ /// Created, Modified, Deleted.
+ /// </summary>
+ public string? UpdateType { get; set; }
+ }
+}
diff --git a/Jellyfin.Api/Models/PlaylistDtos/CreatePlaylistDto.cs b/Jellyfin.Api/Models/PlaylistDtos/CreatePlaylistDto.cs
new file mode 100644
index 000000000..0d67c86f7
--- /dev/null
+++ b/Jellyfin.Api/Models/PlaylistDtos/CreatePlaylistDto.cs
@@ -0,0 +1,30 @@
+using System;
+
+namespace Jellyfin.Api.Models.PlaylistDtos
+{
+ /// <summary>
+ /// Create new playlist dto.
+ /// </summary>
+ public class CreatePlaylistDto
+ {
+ /// <summary>
+ /// Gets or sets the name of the new playlist.
+ /// </summary>
+ public string? Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets item ids to add to the playlist.
+ /// </summary>
+ public string? Ids { get; set; }
+
+ /// <summary>
+ /// Gets or sets the user id.
+ /// </summary>
+ public Guid UserId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the media type.
+ /// </summary>
+ public string? MediaType { get; set; }
+ }
+}