aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2026-05-15 15:44:22 +0200
committerGitHub <noreply@github.com>2026-05-15 15:44:22 +0200
commit9d420271ad4d9468683fda79d906bcd348f4979c (patch)
treed6adbc5e2bc327242c50c81e200167720cdbd3d2 /Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs
parentd93e2d6667872ea16c523202f200c873fc8191ad (diff)
parentfae4950ac2b5918081198ee5f876dd82ca81ae5d (diff)
Merge pull request #9787 from TheMelmacian/feature/language_filters
New filters for audio and subtitle languages
Diffstat (limited to 'Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs')
-rw-r--r--Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs b/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs
index dd0446f49a..7fa33c8639 100644
--- a/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs
+++ b/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs
@@ -55,6 +55,17 @@ public class MediaStreamRepository : IMediaStreamRepository
return TranslateQuery(context.MediaStreamInfos.AsNoTracking(), filter).AsEnumerable().Select(Map).ToArray();
}
+ /// <inheritdoc />
+ public IReadOnlyList<string> GetMediaStreamLanguages(MediaStreamType mediaStreamType)
+ {
+ using var context = _dbProvider.CreateDbContext();
+ return context.MediaStreamInfos
+ .Where(e => e.StreamType == (MediaStreamTypeEntity)mediaStreamType)
+ .Select(s => string.IsNullOrEmpty(s.Language) ? "und" : s.Language) // und = undetermined
+ .Distinct()
+ .ToArray();
+ }
+
private string? GetPathToSave(string? path)
{
if (path is null)