0.10.2-16 Frontend Features
This commit is contained in:
@@ -2110,9 +2110,14 @@ class HistoryService {
|
||||
toNormalizedPath(resolvedPaths?.rawDir),
|
||||
...explicitRawPaths.map((candidatePath) => toNormalizedPath(path.dirname(candidatePath)))
|
||||
]);
|
||||
// Only configured base dirs become protectedRoots (must never be deleted themselves)
|
||||
const movieRoots = sanitizeRoots([
|
||||
...getConfiguredMediaPathList(settings || {}, 'movie_dir'),
|
||||
toNormalizedPath(resolvedPaths?.movieDir),
|
||||
toNormalizedPath(resolvedPaths?.movieDir)
|
||||
]);
|
||||
// Includes parent dirs of output files for addCandidate safety checks
|
||||
const movieAllowedPaths = sanitizeRoots([
|
||||
...movieRoots,
|
||||
...explicitMoviePaths.map((candidatePath) => toNormalizedPath(path.dirname(candidatePath)))
|
||||
]);
|
||||
|
||||
@@ -2204,7 +2209,7 @@ class HistoryService {
|
||||
'movie',
|
||||
outputPath,
|
||||
artifactMoviePathSet.has(outputPath) ? 'lineage_output_path' : 'output_path',
|
||||
movieRoots
|
||||
movieAllowedPaths
|
||||
);
|
||||
const parentDir = toNormalizedPath(path.dirname(outputPath));
|
||||
if (parentDir && !movieRoots.includes(parentDir)) {
|
||||
@@ -2213,7 +2218,7 @@ class HistoryService {
|
||||
'movie',
|
||||
parentDir,
|
||||
artifactMoviePathSet.has(outputPath) ? 'lineage_output_parent' : 'output_parent',
|
||||
movieRoots
|
||||
movieAllowedPaths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user