Scanner v4, audio file metadata used in setting book details, embedded cover art extracted and used

This commit is contained in:
advplyr 2021-09-29 20:43:36 -05:00
parent b74b12301c
commit b26c1ba886
15 changed files with 371 additions and 108 deletions

View file

@ -1,4 +1,5 @@
const fs = require('fs-extra')
const Logger = require('../Logger')
async function getFileStat(path) {
try {
@ -24,6 +25,17 @@ async function getFileSize(path) {
}
module.exports.getFileSize = getFileSize
async function readTextFile(path) {
try {
var data = await fs.readFile(path)
return String(data)
} catch (error) {
Logger.error(`[FileUtils] ReadTextFile error ${error}`)
return ''
}
}
module.exports.readTextFile = readTextFile
function bytesPretty(bytes, decimals = 0) {
if (bytes === 0) {
return '0 Bytes'