Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
Parse key on win32 platform only
Browse files Browse the repository at this point in the history
  • Loading branch information
Caley Woods committed Oct 6, 2019
1 parent a407a07 commit b5695ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/shared/dbUtilis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down Expand Up @@ -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
Expand All @@ -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',
Expand Down

0 comments on commit b5695ab

Please sign in to comment.