mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #4210] [MERGED] Use enum for WebSocket message types #9950
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/4210
Author: @nielsvanvelzen
Created: 9/25/2020
Status: ✅ Merged
Merged: 10/5/2020
Merged by: @Bond-009
Base:
master← Head:typed-websocket-message📝 Commits (1)
72534f9Use SessionMessageType for WebSocket messages📊 Changes
24 files changed (+156 additions, -63 deletions)
View changed files
📝
Emby.Dlna/PlayTo/PlayToController.cs(+4 -4)📝
Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs(+4 -3)📝
Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs(+6 -5)📝
Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs(+1 -1)📝
Emby.Server.Implementations/HttpServer/WebSocketConnection.cs(+3 -2)📝
Emby.Server.Implementations/Session/SessionManager.cs(+14 -14)📝
Emby.Server.Implementations/Session/SessionWebSocketListener.cs(+2 -1)📝
Emby.Server.Implementations/Session/WebSocketController.cs(+2 -1)📝
Jellyfin.Api/WebSocketListeners/ActivityLogWebSocketListener.cs(+9 -5)📝
Jellyfin.Api/WebSocketListeners/ScheduledTasksWebSocketListener.cs(+9 -5)📝
Jellyfin.Api/WebSocketListeners/SessionInfoWebSocketListener.cs(+8 -1)📝
Jellyfin.Server.Implementations/Events/Consumers/System/TaskCompletedNotifier.cs(+2 -1)📝
Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationCancelledNotifier.cs(+2 -1)📝
Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedNotifier.cs(+2 -1)📝
Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstalledNotifier.cs(+2 -1)📝
Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallingNotifier.cs(+2 -1)📝
Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUninstalledNotifier.cs(+2 -1)📝
Jellyfin.Server.Implementations/Events/Consumers/Users/UserDeletedNotifier.cs(+2 -1)📝
Jellyfin.Server.Implementations/Events/Consumers/Users/UserUpdatedNotifier.cs(+2 -1)📝
MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs(+20 -7)...and 4 more files
📄 Description
While working on the apiclient I needed a list of all websocket message types and found out the server uses strings for those everywhere. I changed it to use an enum to make it easier to see all used types.
Changes
SessionMessageTypeenum for incoming and outgoing websocket message typesPlayStatecommand would usePlaystatePluginUninstalledinstead ofPackageUninstalled)Changes should be backwards compatible and confirmed working by running web:master in 2 browsers and using the "play to" feature to connect them. Inspecting all WebSocket messages everything worked fine.
Issues
I guess it's part of #4029
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.