mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-06 14:31:30 +03:00
Fixed bug where subscriptions may register the same file multiple times
This commit is contained in:
@@ -61,6 +61,10 @@ function registerFileDB(file_path, type, multiUserMode = null, sub = null) {
|
|||||||
} else {
|
} else {
|
||||||
sub_db = db.get('subscriptions').find({id: sub.id});
|
sub_db = db.get('subscriptions').find({id: sub.id});
|
||||||
}
|
}
|
||||||
|
if (sub_db.get('videos').find({id: file_object.id}).value()) {
|
||||||
|
logger.verbose(`Subscription video ${file_object.id} already exists, skipping DB registration.`);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
sub_db.get('videos').push(file_object).write();
|
sub_db.get('videos').push(file_object).write();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user