mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Order files before creating concat config
This commit is contained in:
parent
f34c56282d
commit
52c79c050b
@ -1111,6 +1111,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
return allVobs
|
return allVobs
|
||||||
.Where(vob => titles.Contains(_fileSystem.GetFileNameWithoutExtension(vob).AsSpan().RightPart('_').ToString()))
|
.Where(vob => titles.Contains(_fileSystem.GetFileNameWithoutExtension(vob).AsSpan().RightPart('_').ToString()))
|
||||||
.Select(i => i.FullName)
|
.Select(i => i.FullName)
|
||||||
|
.Order()
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1127,6 +1128,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
return directoryFiles
|
return directoryFiles
|
||||||
.Where(f => validPlaybackFiles.Contains(f.Name, StringComparer.OrdinalIgnoreCase))
|
.Where(f => validPlaybackFiles.Contains(f.Name, StringComparer.OrdinalIgnoreCase))
|
||||||
.Select(f => f.FullName)
|
.Select(f => f.FullName)
|
||||||
|
.Order()
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1150,31 +1152,29 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generate concat configuration entries for each file and write to file
|
// Generate concat configuration entries for each file and write to file
|
||||||
using (StreamWriter sw = new StreamWriter(concatFilePath))
|
using StreamWriter sw = new StreamWriter(concatFilePath);
|
||||||
|
foreach (var path in files)
|
||||||
{
|
{
|
||||||
foreach (var path in files)
|
var mediaInfoResult = GetMediaInfo(
|
||||||
{
|
new MediaInfoRequest
|
||||||
var mediaInfoResult = GetMediaInfo(
|
{
|
||||||
new MediaInfoRequest
|
MediaType = DlnaProfileType.Video,
|
||||||
|
MediaSource = new MediaSourceInfo
|
||||||
{
|
{
|
||||||
MediaType = DlnaProfileType.Video,
|
Path = path,
|
||||||
MediaSource = new MediaSourceInfo
|
Protocol = MediaProtocol.File,
|
||||||
{
|
VideoType = videoType
|
||||||
Path = path,
|
}
|
||||||
Protocol = MediaProtocol.File,
|
},
|
||||||
VideoType = videoType
|
CancellationToken.None).GetAwaiter().GetResult();
|
||||||
}
|
|
||||||
},
|
|
||||||
CancellationToken.None).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
var duration = TimeSpan.FromTicks(mediaInfoResult.RunTimeTicks.Value).TotalSeconds;
|
var duration = TimeSpan.FromTicks(mediaInfoResult.RunTimeTicks.Value).TotalSeconds;
|
||||||
|
|
||||||
// Add file path stanza to concat configuration
|
// Add file path stanza to concat configuration
|
||||||
sw.WriteLine("file '{0}'", path);
|
sw.WriteLine("file '{0}'", path);
|
||||||
|
|
||||||
// Add duration stanza to concat configuration
|
// Add duration stanza to concat configuration
|
||||||
sw.WriteLine("duration {0}", duration);
|
sw.WriteLine("duration {0}", duration);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user