From bb976fed4f9283d02fb8e4e05cd38a7f9fadc22e Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Sat, 31 Jan 2026 21:08:51 -0500 Subject: [PATCH] add 1337 kbps bitrate to external track MediaSources --- .../Jellyfin/JellyfinResponseBuilder.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/allstarr/Services/Jellyfin/JellyfinResponseBuilder.cs b/allstarr/Services/Jellyfin/JellyfinResponseBuilder.cs index 21feaef..dd4dcea 100644 --- a/allstarr/Services/Jellyfin/JellyfinResponseBuilder.cs +++ b/allstarr/Services/Jellyfin/JellyfinResponseBuilder.cs @@ -289,6 +289,24 @@ public class JellyfinResponseBuilder var providerIds = (Dictionary)item["ProviderIds"]!; providerIds["ISRC"] = song.Isrc; } + + // Add MediaSources with bitrate for external tracks + item["MediaSources"] = new[] + { + new Dictionary + { + ["Id"] = song.Id, + ["Type"] = "Default", + ["Container"] = "flac", + ["Size"] = (song.Duration ?? 180) * 1337 * 128, // Approximate file size + ["Bitrate"] = 1337000, // 1337 kbps in bps + ["Path"] = $"/music/{song.Artist}/{song.Album}/{song.Title}.flac", + ["Protocol"] = "File", + ["SupportsDirectStream"] = true, + ["SupportsTranscoding"] = true, + ["SupportsDirectPlay"] = true + } + }; } if (!string.IsNullOrEmpty(song.Genre))