diff --git a/src/shared/dbUtilis.js b/src/shared/dbUtilis.js index b122298..89f1d08 100644 --- a/src/shared/dbUtilis.js +++ b/src/shared/dbUtilis.js @@ -5,6 +5,7 @@ import toBuffer from 'blob-to-buffer'; import { Book } from 'epubjs'; import fileUrl from 'file-url'; import path from 'path'; +import process from 'process'; import * as Vibrant from 'node-vibrant'; /** @@ -203,7 +204,7 @@ function getInfo(filePath, callback) { function addToDB(file, db, cb) { getInfo(file, (info, book) => { - const key = info.id; + let key = info.id; info.lastOpen = new Date().getTime(); // return if book is allready registered @@ -214,6 +215,10 @@ function addToDB(file, db, cb) { return; } + if (process.platform === 'win32') { + key = key.split('\\').pop(); + } + const coverPath = path.join( remote.app.getPath('appData'), 'eplee',