feat: Send optional document metadata with KOSync progress uploads (#1820)

This commit is contained in:
Nick Perez
2026-07-12 23:50:38 -04:00
committed by GitHub
parent 39ea4b045f
commit 3a97f3e63e
33 changed files with 95 additions and 11 deletions
@@ -206,6 +206,17 @@ void KOReaderSyncActivity::performUpload() {
progress.progress = localProgress.xpath;
progress.percentage = localProgress.percentage;
// Optionally include document metadata (KOReader PR #15306)
if (KOREADER_STORE.getSendMetadata()) {
KOReaderMetadata meta;
// Extract filename from path
const auto lastSlash = epubPath.rfind('/');
meta.filename = (lastSlash != std::string::npos) ? epubPath.substr(lastSlash + 1) : epubPath;
meta.title = epub->getTitle();
meta.authors = epub->getAuthor();
progress.metadata = std::move(meta);
}
const auto result = KOReaderSyncClient::updateProgress(progress);
// Drop the radio while user reads the result; full teardown happens at silent reboot.