mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-13 19:04:57 +02:00
Removing remaining legacy objects, remove njodb error for fileExists
This commit is contained in:
parent
99e2ea228d
commit
c60807f998
15 changed files with 18 additions and 2602 deletions
|
@ -27,7 +27,7 @@ const max = (a, b) => {
|
|||
const convertSize = (size) => {
|
||||
const sizes = ["bytes", "KB", "MB", "GB"];
|
||||
|
||||
var index = Math.floor(Math.log2(size)/10);
|
||||
var index = Math.floor(Math.log2(size) / 10);
|
||||
if (index > 3) index = 3;
|
||||
|
||||
return Math.round(((size / Math.pow(1024, index)) + Number.EPSILON) * 100) / 100 + " " + sizes[index];
|
||||
|
@ -38,7 +38,7 @@ const fileExists = async (a) => {
|
|||
await promisify(access)(a, constants.F_OK);
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
// console.error(error); file does not exist no need for error
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue