diff --git a/src/index.html b/src/index.html index 6fac36e..238b420 100644 --- a/src/index.html +++ b/src/index.html @@ -28,7 +28,7 @@
- + {{it.title}} diff --git a/src/js/app.js b/src/js/app.js index 4c15159..dc3ad95 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -77,7 +77,7 @@ Anot({ while (this.load.curr < this.load.num) { this.load.curr++ let book = files.pop() - let res = app.dispatch('parse-book', { book, cate: this.burr }) + let res = app.dispatch('parse-book', { book, cate: this.curr }) console.log(res) if (res) { this.books.push(res) diff --git a/src/main.js b/src/main.js index 5fb2ee4..2cb7969 100644 --- a/src/main.js +++ b/src/main.js @@ -65,11 +65,11 @@ app.once('ready', () => { }) protocol.registerStreamProtocol('book', function(req, cb) { - var file = decodeURIComponent(req.url.replace(/^book:[\/]+/, '/')) + var file = decodeURIComponent(req.url.replace(/^book:[\/]+cache/, './')) var ext = path.extname(file) file = path.resolve(CACHE_DIR, file) - + console.log(file) cb({ data: fs.origin.createReadStream(file), mimeType: MIME_TYPES[ext] || MIME_TYPES.all, diff --git a/src/tools/socket.js b/src/tools/socket.js index 6cd0b8f..656da4b 100644 --- a/src/tools/socket.js +++ b/src/tools/socket.js @@ -113,6 +113,7 @@ module.exports = function(app) { } else { cache[cate] = [info] } + fs.echo(JSON.stringify(cache), DB_FILE) ev.returnValue = info }) diff --git "a/{\"undefined\":[{\"title\":\"HTML5 canvas开发详解(第2版) (无)\",\"cover\":\"cover.jpeg\"}]}" "b/{\"undefined\":[{\"title\":\"HTML5 canvas开发详解(第2版) (无)\",\"cover\":\"cover.jpeg\"}]}" new file mode 100644 index 0000000..0864ee2 --- /dev/null +++ "b/{\"undefined\":[{\"title\":\"HTML5 canvas开发详解(第2版) (无)\",\"cover\":\"cover.jpeg\"}]}" @@ -0,0 +1 @@ +/Users/yutent/Library/Application Support/org.bytedo.epub/app.cache \ No newline at end of file