Use same file name as KOReader for OPDS downloads (by spfenwick, PR1286)
This commit is contained in:
@@ -315,10 +315,10 @@ void OpdsBookBrowserActivity::downloadBook(const OpdsEntry& book) {
|
|||||||
// Build full download URL
|
// Build full download URL
|
||||||
std::string downloadUrl = UrlUtils::buildUrl(SETTINGS.opdsServerUrl, book.href);
|
std::string downloadUrl = UrlUtils::buildUrl(SETTINGS.opdsServerUrl, book.href);
|
||||||
|
|
||||||
// Create sanitized filename: "Title - Author.epub" or just "Title.epub" if no author
|
// Create sanitized filename: "Author - Title.epub" or just "Title.epub" if no author
|
||||||
std::string baseName = book.title;
|
std::string baseName = book.title;
|
||||||
if (!book.author.empty()) {
|
if (!book.author.empty()) {
|
||||||
baseName += " - " + book.author;
|
baseName = book.author + " - " + baseName;
|
||||||
}
|
}
|
||||||
std::string filename = "/" + StringUtils::sanitizeFilename(baseName) + ".epub";
|
std::string filename = "/" + StringUtils::sanitizeFilename(baseName) + ".epub";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user