arama özelliği eklendi
This commit is contained in:
@@ -2811,23 +2811,25 @@ app.delete("/api/file", requireAuth, (req, res) => {
|
||||
if (!name) return false;
|
||||
if (name === INFO_FILENAME) return false;
|
||||
if (name.startsWith(".")) return false;
|
||||
const full = path.join(rootDir, name);
|
||||
try {
|
||||
const stat = fs.statSync(full);
|
||||
if (stat.isDirectory()) {
|
||||
const subItems = fs.readdirSync(full);
|
||||
return subItems.some((entry) => !entry.startsWith("."));
|
||||
}
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
if (meaningful.length === 0 || stats?.isDirectory?.()) {
|
||||
purgeRootFolder(folderId);
|
||||
pruneInfoEntry(folderId, relWithinRoot);
|
||||
removeSeriesEpisode(folderId, relWithinRoot);
|
||||
|
||||
if (meaningful.length === 0) {
|
||||
removeAllThumbnailsForRoot(folderId);
|
||||
removeMovieData(folderId);
|
||||
removeSeriesData(folderId);
|
||||
const infoPath = path.join(rootDir, INFO_FILENAME);
|
||||
if (fs.existsSync(infoPath)) {
|
||||
try {
|
||||
fs.rmSync(infoPath, { force: true });
|
||||
} catch (err) {
|
||||
console.warn(`⚠️ info.json kaldırılamadı (${infoPath}): ${err.message}`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pruneInfoEntry(folderId, relWithinRoot);
|
||||
const infoAfter = readInfoForRoot(folderId);
|
||||
const displayName = infoAfter?.name || folderId;
|
||||
const primaryVideo = infoAfter?.primaryVideoPath || guessPrimaryVideo(folderId);
|
||||
@@ -2843,7 +2845,6 @@ app.delete("/api/file", requireAuth, (req, res) => {
|
||||
)
|
||||
);
|
||||
}
|
||||
removeSeriesEpisode(folderId, relWithinRoot);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user