This commit is contained in:
Erik 2022-03-24 23:05:49 +02:00
parent 525447be3a
commit 8dd368a8e4
No known key found for this signature in database
GPG Key ID: FEFF4B220DDF5589
2 changed files with 15 additions and 1 deletions

View File

@ -74,6 +74,20 @@ class ClipIndex extends EventEmitter {
} }
delete(filename) {
const clipEntry = this.index[filename];
if (!clipEntry) return false;
this.emit('delete', clipEntry);
delete this.index[filename];
fs.unlinkSync(path.join(this.videoDirectory, filename));
fs.unlinkSync(path.join(this.thumbnailDirectory, clipEntry.thumbnail));
fs.writeFileSync(this.indexDir, JSON.stringify(this.index));
return true;
}
async syncIndex() { async syncIndex() {
const index = Object.values(this.index); const index = Object.values(this.index);

View File

@ -15,7 +15,7 @@ class Logout extends APIEndpoint {
['post', this.post.bind(this)] ['post', this.post.bind(this)]
]; ];
this.middleware = [CheckAuth]; this.middleware = [];
this.init(); this.init();