mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-17 16:11:28 +03:00
Logic to avoid duplicates for subscription files now uses the video URL instead of its path
This commit is contained in:
@@ -463,12 +463,10 @@ async function handleOutputJSON(sub, output_json, multiUserMode = null, reset_vi
|
|||||||
// add to db
|
// add to db
|
||||||
sub_db.get('videos').push(output_json).write();
|
sub_db.get('videos').push(output_json).write();
|
||||||
} else {
|
} else {
|
||||||
path_object = path.parse(output_json['_filename']);
|
const file_url = output_json['webpage_url']
|
||||||
const path_string = path.format(path_object);
|
|
||||||
|
|
||||||
const file_exists = await db_api.getRecord('files', {path: path_string, sub_id: sub.id});
|
const file_exists = await db_api.getRecord('files', {url: file_url, sub_id: sub.id});
|
||||||
if (file_exists) {
|
if (file_exists) {
|
||||||
// TODO: fix issue where files of different paths due to custom path get downloaded multiple times
|
|
||||||
// file already exists in DB, return early to avoid reseting the download date
|
// file already exists in DB, return early to avoid reseting the download date
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user