mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-26 14:40:57 +03:00
Deleting a file will now delete its downloaded thumbnail as well
Thumbnails will now have their permissions auto updated to align themselves with the other downloaded files
This commit is contained in:
@@ -195,10 +195,12 @@ async function deleteSubscriptionFile(sub, file, deleteForever, file_uid = null,
|
||||
var jsonPath = path.join(__dirname,filePath,name+'.info.json');
|
||||
var videoFilePath = path.join(__dirname,filePath,name+ext);
|
||||
var imageFilePath = path.join(__dirname,filePath,name+'.jpg');
|
||||
var altImageFilePath = path.join(__dirname,filePath,name+'.jpg');
|
||||
|
||||
jsonExists = fs.existsSync(jsonPath);
|
||||
videoFileExists = fs.existsSync(videoFilePath);
|
||||
imageFileExists = fs.existsSync(imageFilePath);
|
||||
altImageFileExists = fs.existsSync(altImageFilePath);
|
||||
|
||||
if (jsonExists) {
|
||||
retrievedID = JSON.parse(fs.readFileSync(jsonPath, 'utf8'))['id'];
|
||||
@@ -209,6 +211,10 @@ async function deleteSubscriptionFile(sub, file, deleteForever, file_uid = null,
|
||||
fs.unlinkSync(imageFilePath);
|
||||
}
|
||||
|
||||
if (altImageFileExists) {
|
||||
fs.unlinkSync(altImageFilePath);
|
||||
}
|
||||
|
||||
if (videoFileExists) {
|
||||
fs.unlink(videoFilePath, function(err) {
|
||||
if (fs.existsSync(jsonPath) || fs.existsSync(videoFilePath)) {
|
||||
|
||||
Reference in New Issue
Block a user