mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-22 18:56:00 +02:00
Add --quick option to fb scan ...
This commit is contained in:
parent
cd51cc1adb
commit
9ad38f84a7
2 changed files with 134 additions and 23 deletions
|
@ -221,6 +221,19 @@ module.exports = class FileEntry {
|
|||
return paths.join(storageDir, this.fileName);
|
||||
}
|
||||
|
||||
static quickCheckExistsByPath(fullPath, cb) {
|
||||
fileDb.get(
|
||||
`SELECT COUNT() AS count
|
||||
FROM file
|
||||
WHERE file_name = ?
|
||||
LIMIT 1;`,
|
||||
[ paths.basename(fullPath) ],
|
||||
(err, rows) => {
|
||||
return err ? cb(err) : cb(null, rows.count > 0 ? true : false);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
static persistUserRating(fileId, userId, rating, cb) {
|
||||
return fileDb.run(
|
||||
`REPLACE INTO file_user_rating (file_id, user_id, rating)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue