mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 05:53:03 +03:00
support track selection before playback
This commit is contained in:
@@ -17,6 +17,7 @@ using System.Threading.Tasks;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
|
||||
namespace Emby.Server.Implementations.MediaEncoder
|
||||
{
|
||||
@@ -89,7 +90,7 @@ namespace Emby.Server.Implementations.MediaEncoder
|
||||
/// </summary>
|
||||
private static readonly long FirstChapterTicks = TimeSpan.FromSeconds(15).Ticks;
|
||||
|
||||
public async Task<bool> RefreshChapterImages(Video video, List<ChapterInfo> chapters, bool extractImages, bool saveChapters, CancellationToken cancellationToken)
|
||||
public async Task<bool> RefreshChapterImages(Video video, IDirectoryService directoryService, List<ChapterInfo> chapters, bool extractImages, bool saveChapters, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!IsEligibleForChapterImageExtraction(video))
|
||||
{
|
||||
@@ -101,7 +102,7 @@ namespace Emby.Server.Implementations.MediaEncoder
|
||||
|
||||
var runtimeTicks = video.RunTimeTicks ?? 0;
|
||||
|
||||
var currentImages = GetSavedChapterImages(video);
|
||||
var currentImages = GetSavedChapterImages(video, directoryService);
|
||||
|
||||
foreach (var chapter in chapters)
|
||||
{
|
||||
@@ -194,13 +195,13 @@ namespace Emby.Server.Implementations.MediaEncoder
|
||||
return Path.Combine(GetChapterImagesPath(video), filename);
|
||||
}
|
||||
|
||||
private List<string> GetSavedChapterImages(Video video)
|
||||
private List<string> GetSavedChapterImages(Video video, IDirectoryService directoryService)
|
||||
{
|
||||
var path = GetChapterImagesPath(video);
|
||||
|
||||
try
|
||||
{
|
||||
return _fileSystem.GetFilePaths(path)
|
||||
return directoryService.GetFilePaths(path)
|
||||
.ToList();
|
||||
}
|
||||
catch (IOException)
|
||||
|
||||
Reference in New Issue
Block a user