Merge pull request #160 from spfenwick/master

fix: Use correct server name for opds download
This commit is contained in:
jpirnay
2026-05-01 15:46:08 +02:00
committed by GitHub
2 changed files with 3 additions and 13 deletions
-9
View File
@@ -277,15 +277,6 @@ inline const std::vector<SettingInfo> list = {
SettingInfo::Toggle(StrId::STR_KO_SYNC_ON_BOOK_CLOSE, &CrossPointSettings::koSyncOnBookClose, "koSyncOnBookClose",
StrId::STR_KOREADER_SYNC),
// --- OPDS Browser (web-only, uses CrossPointSettings char arrays) ---
SettingInfo::String(StrId::STR_OPDS_SERVER_URL, SETTINGS.opdsServerUrl, sizeof(SETTINGS.opdsServerUrl),
"opdsServerUrl", StrId::STR_OPDS_BROWSER),
SettingInfo::String(StrId::STR_USERNAME, SETTINGS.opdsUsername, sizeof(SETTINGS.opdsUsername), "opdsUsername",
StrId::STR_OPDS_BROWSER),
SettingInfo::String(StrId::STR_PASSWORD, SETTINGS.opdsPassword, sizeof(SETTINGS.opdsPassword), "opdsPassword",
StrId::STR_OPDS_BROWSER)
.withObfuscated(),
// --- Status Bar Settings (web-only, uses StatusBarSettingsActivity) ---
SettingInfo::Toggle(StrId::STR_CHAPTER_PAGE_COUNT, &CrossPointSettings::statusBarChapterPageCount,
"statusBarChapterPageCount", StrId::STR_CUSTOMISE_STATUS_BAR),
@@ -398,7 +398,7 @@ void OpdsBookBrowserActivity::chooseBookFormat(const OpdsEntry& book) {
selectedBookIndex = selectorIndex;
formatSelectorIndex = 0;
formatSelectionLabels = buildOpdsFormatSelectionLabels(book.acquisitionLinks, SETTINGS.opdsServerUrl);
formatSelectionLabels = buildOpdsFormatSelectionLabels(book.acquisitionLinks, server.url);
state = BrowserState::FORMAT_SELECTION;
requestUpdate();
}
@@ -411,9 +411,8 @@ void OpdsBookBrowserActivity::downloadBook(const OpdsEntry& book, const OpdsAcqu
downloadTotal = 0;
requestUpdate(true);
std::string downloadUrl = (acquisition.href.rfind("http", 0) == 0)
? acquisition.href
: UrlUtils::buildUrl(SETTINGS.opdsServerUrl, acquisition.href);
std::string downloadUrl =
(acquisition.href.rfind("http", 0) == 0) ? acquisition.href : UrlUtils::buildUrl(server.url, acquisition.href);
std::string filename = "/" +
StringUtils::sanitizeFilename((book.author.empty() ? "" : book.author + " - ") + book.title) +
acquisition.fileExtension;