mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 03:26:05 -04:00
Use real url for icon in the contentManager instead of data url.
The update of book info are made somehow sync. (They are async, but somehow, the view update hangout). Getting the favicon content is pretty long and it seems that the view (and getting remote content) take a long time. By using a real url, QWebViewEngine handle everything nicely and it speed up everything.
This commit is contained in:
parent
a98ea49cac
commit
4cbf001de4
@ -20,7 +20,7 @@ function createDict(keys, values) {
|
||||
}
|
||||
return d;
|
||||
}
|
||||
const BOOK_KEYS = ["id", "name", "path", "url", "size", "description", "title", "tags", "date", "favicon", "faviconMimeType", "downloadId"];
|
||||
const BOOK_KEYS = ["id", "name", "path", "url", "size", "description", "title", "tags", "date", "faviconUrl", "faviconMimeType", "downloadId"];
|
||||
function addBook(values) {
|
||||
var b = createDict(BOOK_KEYS, values);
|
||||
if (b.downloadId && !downloadUpdaters.hasOwnProperty(b.id)) {
|
||||
@ -189,7 +189,8 @@ button {
|
||||
<details v-for="book in books" class="book">
|
||||
<summary class="tablerow">
|
||||
<span class="tablecell cell0">
|
||||
<img v-bind:src="'data:image/png;base64,' + book.favicon"/>
|
||||
<img v-if="book.faviconUrl" v-bind:src="'http://' + book.faviconUrl" />
|
||||
<img v-else-if="book.faviconMimeType" v-bind:src="'zim://' + book.id + '.favicon.meta'" />
|
||||
</span>
|
||||
<span class="tablecell cell1">
|
||||
{{ book.title }}
|
||||
|
@ -68,6 +68,7 @@ QStringList ContentManager::getBookInfos(QString id, const QStringList &keys)
|
||||
ADD_V("origId", getOrigId);
|
||||
ADD_V("faviconMimeType", getFaviconMimeType);
|
||||
ADD_V("downloadId", getDownloadId);
|
||||
ADD_V("faviconUrl", getFaviconUrl);
|
||||
if (key == "favicon") {
|
||||
auto s = b.getFavicon();
|
||||
values.append(QByteArray::fromStdString(s).toBase64());
|
||||
|
Loading…
x
Reference in New Issue
Block a user