Use same file name as KOReader for OPDS downloads (by spfenwick, PR1286)

This commit is contained in:
jpirnay
2026-04-05 22:55:56 +02:00
parent 07b36351aa
commit efae9c058d
@@ -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";