mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
update subtitle resolution
This commit is contained in:
parent
ad1a9a4932
commit
adab6e21e5
@ -249,21 +249,16 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
|
|||||||
var startIndex = video.MediaStreams == null ? 0 : video.MediaStreams.Count;
|
var startIndex = video.MediaStreams == null ? 0 : video.MediaStreams.Count;
|
||||||
var streams = new List<MediaStream>();
|
var streams = new List<MediaStream>();
|
||||||
|
|
||||||
foreach (var file in fileSystemChildren.Where(f => !f.Attributes.HasFlag(FileAttributes.Directory)))
|
foreach (var file in fileSystemChildren
|
||||||
|
.Where(f => !f.Attributes.HasFlag(FileAttributes.Directory) && string.Equals(Path.GetExtension(f.FullName), ".srt", StringComparison.OrdinalIgnoreCase)))
|
||||||
{
|
{
|
||||||
var fullName = file.FullName;
|
var fullName = file.FullName;
|
||||||
var extension = Path.GetExtension(fullName);
|
|
||||||
|
|
||||||
if (string.Equals(extension, ".srt", StringComparison.OrdinalIgnoreCase))
|
// The subtitle filename must match video filename
|
||||||
{
|
|
||||||
if (video.VideoType == VideoType.VideoFile)
|
|
||||||
{
|
|
||||||
// For video files the subtitle filename must match video filename
|
|
||||||
if (!string.Equals(Path.GetFileNameWithoutExtension(video.Path), Path.GetFileNameWithoutExtension(fullName)))
|
if (!string.Equals(Path.GetFileNameWithoutExtension(video.Path), Path.GetFileNameWithoutExtension(fullName)))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
streams.Add(new MediaStream
|
streams.Add(new MediaStream
|
||||||
{
|
{
|
||||||
@ -274,7 +269,6 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
|
|||||||
Codec = "srt"
|
Codec = "srt"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (video.MediaStreams == null)
|
if (video.MediaStreams == null)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user