1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 02:12:30 +01:00
This commit is contained in:
Mikael Finstad 2023-09-21 21:56:22 +08:00
parent 0d8d7b9428
commit 877bcdbdf2
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26
2 changed files with 4 additions and 2 deletions

View File

@ -1776,7 +1776,8 @@ const App = memo(() => {
[lastOpenedPath] = filePaths;
if (filePaths.length === 1 && basename(filePaths[0]) === 'VIDEO_TS') {
// https://en.wikibooks.org/wiki/Inside_DVD-Video/Directory_Structure
if (filePaths.length === 1 && /^VIDEO_TS$/i.test(basename(filePaths[0]))) {
if (mustDisallowVob()) return;
filePaths = await readVideoTs(filePaths[0]);
}

View File

@ -365,7 +365,8 @@ export function mustDisallowVob() {
export async function readVideoTs(videoTsPath) {
const files = await readdir(videoTsPath);
const relevantFiles = files.filter((file) => /VTS_\d+_\d+\.vob/i.test(file) && !/VTS_\d+_00\.vob/i.test(file)); // skip menu
const relevantFiles = files.filter((file) => /^VTS_\d+_\d+\.vob$/i.test(file) && !/^VTS_\d+_00\.vob$/i.test(file)); // skip menu
const ret = sortBy(relevantFiles).map((file) => join(videoTsPath, file));
if (ret.length === 0) throw new Error('No VTS vob files found in folder');
return ret;
}