Merge pull request #160 from spfenwick/master
fix: Use correct server name for opds download
This commit is contained in:
@@ -277,15 +277,6 @@ inline const std::vector<SettingInfo> list = {
|
|||||||
SettingInfo::Toggle(StrId::STR_KO_SYNC_ON_BOOK_CLOSE, &CrossPointSettings::koSyncOnBookClose, "koSyncOnBookClose",
|
SettingInfo::Toggle(StrId::STR_KO_SYNC_ON_BOOK_CLOSE, &CrossPointSettings::koSyncOnBookClose, "koSyncOnBookClose",
|
||||||
StrId::STR_KOREADER_SYNC),
|
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) ---
|
// --- Status Bar Settings (web-only, uses StatusBarSettingsActivity) ---
|
||||||
SettingInfo::Toggle(StrId::STR_CHAPTER_PAGE_COUNT, &CrossPointSettings::statusBarChapterPageCount,
|
SettingInfo::Toggle(StrId::STR_CHAPTER_PAGE_COUNT, &CrossPointSettings::statusBarChapterPageCount,
|
||||||
"statusBarChapterPageCount", StrId::STR_CUSTOMISE_STATUS_BAR),
|
"statusBarChapterPageCount", StrId::STR_CUSTOMISE_STATUS_BAR),
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ void OpdsBookBrowserActivity::chooseBookFormat(const OpdsEntry& book) {
|
|||||||
|
|
||||||
selectedBookIndex = selectorIndex;
|
selectedBookIndex = selectorIndex;
|
||||||
formatSelectorIndex = 0;
|
formatSelectorIndex = 0;
|
||||||
formatSelectionLabels = buildOpdsFormatSelectionLabels(book.acquisitionLinks, SETTINGS.opdsServerUrl);
|
formatSelectionLabels = buildOpdsFormatSelectionLabels(book.acquisitionLinks, server.url);
|
||||||
state = BrowserState::FORMAT_SELECTION;
|
state = BrowserState::FORMAT_SELECTION;
|
||||||
requestUpdate();
|
requestUpdate();
|
||||||
}
|
}
|
||||||
@@ -411,9 +411,8 @@ void OpdsBookBrowserActivity::downloadBook(const OpdsEntry& book, const OpdsAcqu
|
|||||||
downloadTotal = 0;
|
downloadTotal = 0;
|
||||||
requestUpdate(true);
|
requestUpdate(true);
|
||||||
|
|
||||||
std::string downloadUrl = (acquisition.href.rfind("http", 0) == 0)
|
std::string downloadUrl =
|
||||||
? acquisition.href
|
(acquisition.href.rfind("http", 0) == 0) ? acquisition.href : UrlUtils::buildUrl(server.url, acquisition.href);
|
||||||
: UrlUtils::buildUrl(SETTINGS.opdsServerUrl, acquisition.href);
|
|
||||||
std::string filename = "/" +
|
std::string filename = "/" +
|
||||||
StringUtils::sanitizeFilename((book.author.empty() ? "" : book.author + " - ") + book.title) +
|
StringUtils::sanitizeFilename((book.author.empty() ? "" : book.author + " - ") + book.title) +
|
||||||
acquisition.fileExtension;
|
acquisition.fileExtension;
|
||||||
|
|||||||
Reference in New Issue
Block a user