mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fixes #101 - Subtitles for TV
This commit is contained in:
parent
dbcb62e462
commit
6cefbdcdbf
@ -253,16 +253,23 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
|
|||||||
|
|
||||||
if (string.Equals(extension, ".srt", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(extension, ".srt", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
if (video.VideoType == VideoType.VideoFile)
|
||||||
|
{
|
||||||
|
// For video files the subtitle filename must match video filename
|
||||||
|
if (!string.Equals(Path.GetFileNameWithoutExtension(video.Path), Path.GetFileNameWithoutExtension(file.Path)))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
streams.Add(new MediaStream
|
streams.Add(new MediaStream
|
||||||
{
|
{
|
||||||
Index = startIndex,
|
Index = startIndex++,
|
||||||
Type = MediaStreamType.Subtitle,
|
Type = MediaStreamType.Subtitle,
|
||||||
IsExternal = true,
|
IsExternal = true,
|
||||||
Path = file.Path,
|
Path = file.Path,
|
||||||
Codec = "srt"
|
Codec = "srt"
|
||||||
});
|
});
|
||||||
|
|
||||||
startIndex++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user