mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Use complete paths in BD info
This way we don't need to find the complete path later
This commit is contained in:
parent
64b6805ec3
commit
60c45d6273
@ -86,7 +86,7 @@ public class BdInfoExaminer : IBlurayExaminer
|
|||||||
if (playlist.StreamClips is not null && playlist.StreamClips.Count > 0)
|
if (playlist.StreamClips is not null && playlist.StreamClips.Count > 0)
|
||||||
{
|
{
|
||||||
// Get the files in the playlist
|
// Get the files in the playlist
|
||||||
outputStream.Files = playlist.StreamClips.Select(i => i.StreamFile.Name).ToArray();
|
outputStream.Files = playlist.StreamClips.Select(i => i.StreamFile.FileInfo.FullName).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
return outputStream;
|
return outputStream;
|
||||||
|
@ -1149,18 +1149,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IReadOnlyList<string> GetPrimaryPlaylistM2tsFiles(string path)
|
public IReadOnlyList<string> GetPrimaryPlaylistM2tsFiles(string path)
|
||||||
{
|
=> _blurayExaminer.GetDiscInfo(path).Files;
|
||||||
// Get all playable .m2ts files
|
|
||||||
var validPlaybackFiles = _blurayExaminer.GetDiscInfo(path).Files;
|
|
||||||
|
|
||||||
// Get all files from the BDMV/STREAMING directory
|
|
||||||
// Only return playable local .m2ts files
|
|
||||||
var files = _fileSystem.GetFiles(Path.Join(path, "BDMV", "STREAM")).ToList();
|
|
||||||
return validPlaybackFiles
|
|
||||||
.Select(validFile => files.FirstOrDefault(f => Path.GetFileName(f.FullName.AsSpan()).Equals(validFile, StringComparison.OrdinalIgnoreCase))?.FullName)
|
|
||||||
.Where(f => f is not null)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string GetInputPathArgument(EncodingJobInfo state)
|
public string GetInputPathArgument(EncodingJobInfo state)
|
||||||
@ -1171,8 +1160,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
{
|
{
|
||||||
return mediaSource.VideoType switch
|
return mediaSource.VideoType switch
|
||||||
{
|
{
|
||||||
VideoType.Dvd => GetInputArgument(GetPrimaryPlaylistVobFiles(path, null).ToList(), mediaSource),
|
VideoType.Dvd => GetInputArgument(GetPrimaryPlaylistVobFiles(path, null), mediaSource),
|
||||||
VideoType.BluRay => GetInputArgument(GetPrimaryPlaylistM2tsFiles(path).ToList(), mediaSource),
|
VideoType.BluRay => GetInputArgument(GetPrimaryPlaylistM2tsFiles(path), mediaSource),
|
||||||
_ => GetInputArgument(path, mediaSource)
|
_ => GetInputArgument(path, mediaSource)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -124,11 +124,8 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
// Get BD disc information
|
// Get BD disc information
|
||||||
blurayDiscInfo = GetBDInfo(item.Path);
|
blurayDiscInfo = GetBDInfo(item.Path);
|
||||||
|
|
||||||
// Get playable .m2ts files
|
|
||||||
var m2ts = _mediaEncoder.GetPrimaryPlaylistM2tsFiles(item.Path);
|
|
||||||
|
|
||||||
// Return if no playable .m2ts files are found
|
// Return if no playable .m2ts files are found
|
||||||
if (blurayDiscInfo is null || blurayDiscInfo.Files.Length == 0 || m2ts.Count == 0)
|
if (blurayDiscInfo is null || blurayDiscInfo.Files.Length == 0)
|
||||||
{
|
{
|
||||||
_logger.LogError("No playable .m2ts files found in Blu-ray structure, skipping FFprobe.");
|
_logger.LogError("No playable .m2ts files found in Blu-ray structure, skipping FFprobe.");
|
||||||
return ItemUpdateType.MetadataImport;
|
return ItemUpdateType.MetadataImport;
|
||||||
@ -138,7 +135,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
mediaInfoResult = await GetMediaInfo(
|
mediaInfoResult = await GetMediaInfo(
|
||||||
new Video
|
new Video
|
||||||
{
|
{
|
||||||
Path = m2ts[0]
|
Path = blurayDiscInfo.Files[0]
|
||||||
},
|
},
|
||||||
cancellationToken).ConfigureAwait(false);
|
cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user