add 1337 kbps bitrate to external track MediaSources

This commit is contained in:
2026-01-31 21:08:51 -05:00
parent df77b16640
commit bb976fed4f

View File

@@ -289,6 +289,24 @@ public class JellyfinResponseBuilder
var providerIds = (Dictionary<string, string>)item["ProviderIds"]!; var providerIds = (Dictionary<string, string>)item["ProviderIds"]!;
providerIds["ISRC"] = song.Isrc; providerIds["ISRC"] = song.Isrc;
} }
// Add MediaSources with bitrate for external tracks
item["MediaSources"] = new[]
{
new Dictionary<string, object?>
{
["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)) if (!string.IsNullOrEmpty(song.Genre))