diff options
| author | Cody Robibero <cody@robibe.ro> | 2023-05-13 12:44:31 -0600 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2023-10-10 15:57:15 -0600 |
| commit | 2920611ffc206d845563637c4a865bf3f02d1374 (patch) | |
| tree | c69c43264165df71866220966929e7a07a907d20 /Jellyfin.Server.Implementations/Events | |
| parent | 74f61fbd79ef2e2ad4a986f5f886581b2827de07 (diff) | |
Convert string MediaType to enum MediaType
Diffstat (limited to 'Jellyfin.Server.Implementations/Events')
| -rw-r--r-- | Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStartLogger.cs | 7 | ||||
| -rw-r--r-- | Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStartLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStartLogger.cs index 27726a57a..8a33383e3 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStartLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStartLogger.cs @@ -2,6 +2,7 @@ using System.Globalization; using System.Threading.Tasks; using Jellyfin.Data.Entities; +using Jellyfin.Data.Enums; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Activity; @@ -89,14 +90,14 @@ namespace Jellyfin.Server.Implementations.Events.Consumers.Session return name; } - private static string GetPlaybackNotificationType(string mediaType) + private static string GetPlaybackNotificationType(MediaType mediaType) { - if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase)) + if (mediaType == MediaType.Audio) { return NotificationType.AudioPlayback.ToString(); } - if (string.Equals(mediaType, MediaType.Video, StringComparison.OrdinalIgnoreCase)) + if (mediaType == MediaType.Video) { return NotificationType.VideoPlayback.ToString(); } diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs index 6b16477aa..4c2effc2e 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs @@ -2,6 +2,7 @@ using System.Globalization; using System.Threading.Tasks; using Jellyfin.Data.Entities; +using Jellyfin.Data.Enums; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Activity; @@ -97,14 +98,14 @@ namespace Jellyfin.Server.Implementations.Events.Consumers.Session return name; } - private static string? GetPlaybackStoppedNotificationType(string mediaType) + private static string? GetPlaybackStoppedNotificationType(MediaType mediaType) { - if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase)) + if (mediaType == MediaType.Audio) { return NotificationType.AudioPlaybackStopped.ToString(); } - if (string.Equals(mediaType, MediaType.Video, StringComparison.OrdinalIgnoreCase)) + if (mediaType == MediaType.Video) { return NotificationType.VideoPlaybackStopped.ToString(); } |
