add 移动多文件

This commit is contained in:
2023-08-07 22:05:55 +08:00
parent 4bc2504a44
commit b675e3033d
5 changed files with 59 additions and 34 deletions

View File

@@ -2,7 +2,7 @@ const fs = require("fs")
const { getMediaState } = require("../sql/download.js");
const path = require("path");
const { cwd } = require("process");
const { createTorrent, getVideoSpecifyTimeImage, uploadImg, getMediaInfoSend, deleteFolder } = require("../utils.js");
const { createTorrent, getVideoSpecifyTimeImage, uploadImg, getMediaInfoSend, deleteFolder, moveDir } = require("../utils.js");
const { getVideoInfo } = require("../sql/video.js");
const { mkdirRecursions } = require("../markdir.js");
const { default: axios } = require("axios");
@@ -106,11 +106,10 @@ async function sendSeed(info) {
}
// 移动到做种文件夹
mkdirRecursions(newDir + "/" + info.seedName + "/")
fs.renameSync(info.newPath + "/" + info.rname, newDir + "/" + info.seedName + "/" + info.rname);
// fs.renameSync(info.newPath + "/" + info.rname, newDir + "/" + info.seedName + "/" + info.rname);
moveDir(info.newPath + "/" ,newDir + "/" + info.seedName + "/")
// 删除下载的文件夹
deleteFolder(info.newPath)
} else {
console.log("未下载完成")
}