mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #4252] [MERGED] Convert supportedCommands strings to enums #9976
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/4252
Author: @skyfrk
Created: 10/1/2020
Status: ✅ Merged
Merged: 10/4/2020
Merged by: @Bond-009
Base:
master← Head:4214-supported-commands-enum📝 Commits (10+)
dd4f3a7feat: convert supportedCommands strings to enumsf314be9chore(CONTRIBUTORS.md): add skyfrk0655928feat: add CommaDelimitedArrayModelBinderba12ea7feat: use CommaDelimitedArrayModelBinder to retain API4b4c74bfeat: extend CommaDelimitedArrayModelBinder to support auto generated openAPI specd10090bfix: remove unused null check21b39a2refactor: simplify null check9aad772feat: implement CommaDelimitedArrayModelBinderProviderc3e7eb3Merge branch '4214-supported-commands-enum' of https://github.com/skyfrk/jellyfin into 4214-supported-commands-enum33f80dcfeat(CommaDelimitedArrayModelBinder): add none result check📊 Changes
10 files changed (+359 additions, -15 deletions)
View changed files
📝
CONTRIBUTORS.md(+1 -0)📝
Emby.Dlna/PlayTo/PlayToManager.cs(+9 -9)📝
Jellyfin.Api/Controllers/SessionController.cs(+3 -2)➕
Jellyfin.Api/ModelBinders/CommaDelimitedArrayModelBinder.cs(+64 -0)➕
Jellyfin.Api/ModelBinders/CommaDelimitedArrayModelBinderProvider.cs(+29 -0)📝
Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs(+3 -0)📝
MediaBrowser.Controller/Session/SessionInfo.cs(+2 -2)📝
MediaBrowser.Model/Session/ClientCapabilities.cs(+2 -2)➕
tests/Jellyfin.Api.Tests/ModelBinders/CommaDelimitedArrayModelBinderTests.cs(+229 -0)➕
tests/Jellyfin.Api.Tests/ModelBinders/TestType.cs(+17 -0)📄 Description
This PR converts
supportedCommandsstrings to enums as part of #4214.There is a breaking change: Before my changes one could pass a comma separated list of
supportedCommandsto thePostCapabilities()function in theSessionController. Because thesupportedCommandsis an array of enums this is no longer possible. See below how ASP.NET Core handles an array of enums as a query parameter:https://example.com/Sessions/Capabilities?supportedCommands=Mute,Unmutehttps://example.com/Sessions/Capabilities?supportedCommands=Mute&supportedCommands=Unmutehttps://example.com/Sessions/Capabilities?supportedCommands[0]=Mute&supportedCommands[1]=UnmuteThere are ways to retain the old interface using a ModelBinder or an ActionFilter. Should I implement one of them?
Changes
GeneralCommandType[]instead ofstring[]forsupportedCommands.Issues
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.