修复书本读取
parent
e855b5cd26
commit
5435bc6482
|
@ -28,7 +28,7 @@
|
|||
<div class="detail" :class="{blur: !curr.code}">
|
||||
|
||||
<book :for="it in books">
|
||||
<img :src="'book://' + it.title + '/' + it.cover">
|
||||
<img :src="'book://cache/' + it.title + '/' + it.cover">
|
||||
{{it.title}}
|
||||
</book>
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -113,6 +113,7 @@ module.exports = function(app) {
|
|||
} else {
|
||||
cache[cate] = [info]
|
||||
}
|
||||
fs.echo(JSON.stringify(cache), DB_FILE)
|
||||
ev.returnValue = info
|
||||
})
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
/Users/yutent/Library/Application Support/org.bytedo.epub/app.cache
|
Loading…
Reference in New Issue