feat: port upstream OPDS improvements (PRs #1207, #1209)

Port two upstream PRs:

- PR #1207: Replace manual chunked download loop with
  HTTPClient::writeToStream via a FileWriteStream adapter, improving
  reliability for OPDS file downloads including chunked transfers.

- PR #1209: Add support for multiple OPDS servers with a new
  OpdsServerStore (JSON persistence with MAC-based password obfuscation),
  OpdsServerListActivity and OpdsSettingsActivity UIs, per-server
  credentials passed to HttpDownloader, web UI management endpoints,
  and migration from legacy single-server settings.

Made-with: Cursor
This commit is contained in:
cottongin
2026-02-26 19:14:59 -05:00
parent 19b6ad047b
commit 2aa13ea2de
30 changed files with 1119 additions and 278 deletions

View File

@@ -6,6 +6,7 @@
#include <vector>
#include "../ActivityWithSubactivity.h"
#include "OpdsServerStore.h"
#include "util/ButtonNavigator.h"
/**
@@ -25,8 +26,8 @@ class OpdsBookBrowserActivity final : public ActivityWithSubactivity {
};
explicit OpdsBookBrowserActivity(GfxRenderer& renderer, MappedInputManager& mappedInput,
const std::function<void()>& onGoHome)
: ActivityWithSubactivity("OpdsBookBrowser", renderer, mappedInput), onGoHome(onGoHome) {}
const std::function<void()>& onGoHome, const OpdsServer& server)
: ActivityWithSubactivity("OpdsBookBrowser", renderer, mappedInput), onGoHome(onGoHome), server(server) {}
void onEnter() override;
void onExit() override;
@@ -46,6 +47,7 @@ class OpdsBookBrowserActivity final : public ActivityWithSubactivity {
size_t downloadTotal = 0;
const std::function<void()> onGoHome;
OpdsServer server; // Copied at construction — safe even if the store changes during browsing
void checkAndConnectWifi();
void launchWifiSelection();