Добавлена синхронизация файлов обоев
This commit is contained in:
@@ -219,6 +219,19 @@ class ReaderWorker {
|
||||
return `disk://${hash}`;
|
||||
}
|
||||
|
||||
async saveFileBuf(buf) {
|
||||
const hash = await utils.getBufHash(buf, 'sha256', 'hex');
|
||||
const outFilename = `${this.config.uploadDir}/${hash}`;
|
||||
|
||||
if (!await fs.pathExists(outFilename)) {
|
||||
await fs.writeFile(outFilename, buf);
|
||||
} else {
|
||||
await utils.touchFile(outFilename);
|
||||
}
|
||||
|
||||
return `disk://${hash}`;
|
||||
}
|
||||
|
||||
async restoreRemoteFile(filename) {
|
||||
const basename = path.basename(filename);
|
||||
const targetName = `${this.config.tempPublicDir}/${basename}`;
|
||||
|
||||
Reference in New Issue
Block a user