Do not always download the favicon of a book. Download as needed.

When parsing a opds feed, the favicon is a url, not a dataurl.
If we download the favicon all the times, it may take a lot of time to
parse the feed.

We store the url and download the favicon only when needed (when displayed)
This commit is contained in:
Matthieu Gautier
2018-10-24 11:56:05 +02:00
parent c20ae18bff
commit c6206edfb4
3 changed files with 22 additions and 22 deletions

View File

@ -45,7 +45,7 @@ class Book
bool update(const Book& other);
void update(const Reader& reader);
void updateFromXml(const pugi::xml_node& node, const std::string& baseDir);
void updateFromOpds(const pugi::xml_node& node);
void updateFromOpds(const pugi::xml_node& node, const std::string& urlHost);
std::string getHumanReadableIdFromPath();
bool readOnly() const { return m_readOnly; }
@ -67,7 +67,7 @@ class Book
const uint64_t& getArticleCount() const { return m_articleCount; }
const uint64_t& getMediaCount() const { return m_mediaCount; }
const uint64_t& getSize() const { return m_size; }
const std::string& getFavicon() const { return m_favicon; }
const std::string& getFavicon() const;
const std::string& getFaviconMimeType() const { return m_faviconMimeType; }
const std::string& getDownloadId() const { return m_downloadId; }
@ -115,7 +115,8 @@ class Book
uint64_t m_mediaCount;
bool m_readOnly;
uint64_t m_size;
std::string m_favicon;
mutable std::string m_favicon;
std::string m_faviconUrl;
std::string m_faviconMimeType;
};