feat: Send optional document metadata with KOSync progress uploads (#1820)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user