mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-08 08:37:38 +03:00
Fix clang-format issues
This commit is contained in:
parent
fbc8af0dba
commit
50f9a701e1
@ -261,9 +261,7 @@ void OpdsBookBrowserActivity::fetchFeed(const std::string& path) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string url = UrlUtils::buildUrlWithAuth(serverUrl, path,
|
std::string url = UrlUtils::buildUrlWithAuth(serverUrl, path, SETTINGS.calibreUsername, SETTINGS.calibrePassword);
|
||||||
SETTINGS.calibreUsername,
|
|
||||||
SETTINGS.calibrePassword);
|
|
||||||
Serial.printf("[%lu] [OPDS] Fetching: %s\n", millis(), url.c_str());
|
Serial.printf("[%lu] [OPDS] Fetching: %s\n", millis(), url.c_str());
|
||||||
|
|
||||||
std::string content;
|
std::string content;
|
||||||
@ -337,9 +335,8 @@ void OpdsBookBrowserActivity::downloadBook(const OpdsEntry& book) {
|
|||||||
updateRequired = true;
|
updateRequired = true;
|
||||||
|
|
||||||
// Build full download URL
|
// Build full download URL
|
||||||
std::string downloadUrl = UrlUtils::buildUrlWithAuth(SETTINGS.opdsServerUrl, book.href,
|
std::string downloadUrl =
|
||||||
SETTINGS.calibreUsername,
|
UrlUtils::buildUrlWithAuth(SETTINGS.opdsServerUrl, book.href, SETTINGS.calibreUsername, SETTINGS.calibrePassword);
|
||||||
SETTINGS.calibrePassword);
|
|
||||||
|
|
||||||
// Create Calibre-style folder structure: /Books/AuthorName/BookName/BookFile.epub
|
// Create Calibre-style folder structure: /Books/AuthorName/BookName/BookFile.epub
|
||||||
std::string authorFolder = book.author.empty() ? "Unknown Author" : StringUtils::sanitizeFilename(book.author);
|
std::string authorFolder = book.author.empty() ? "Unknown Author" : StringUtils::sanitizeFilename(book.author);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#include "UrlUtils.h"
|
#include "UrlUtils.h"
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
namespace UrlUtils {
|
namespace UrlUtils {
|
||||||
|
|
||||||
@ -61,8 +61,8 @@ std::string urlEncode(const std::string& value) {
|
|||||||
return escaped.str();
|
return escaped.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string buildUrlWithAuth(const std::string& serverUrl, const std::string& path,
|
std::string buildUrlWithAuth(const std::string& serverUrl, const std::string& path, const std::string& username,
|
||||||
const std::string& username, const std::string& password) {
|
const std::string& password) {
|
||||||
// If no credentials, use regular buildUrl
|
// If no credentials, use regular buildUrl
|
||||||
if (username.empty() && password.empty()) {
|
if (username.empty() && password.empty()) {
|
||||||
return buildUrl(serverUrl, path);
|
return buildUrl(serverUrl, path);
|
||||||
|
|||||||
@ -30,7 +30,7 @@ std::string urlEncode(const std::string& value);
|
|||||||
* If username and password are provided, adds them to the URL.
|
* If username and password are provided, adds them to the URL.
|
||||||
* Example: https://username:password@example.com/path
|
* Example: https://username:password@example.com/path
|
||||||
*/
|
*/
|
||||||
std::string buildUrlWithAuth(const std::string& serverUrl, const std::string& path,
|
std::string buildUrlWithAuth(const std::string& serverUrl, const std::string& path, const std::string& username,
|
||||||
const std::string& username, const std::string& password);
|
const std::string& password);
|
||||||
|
|
||||||
} // namespace UrlUtils
|
} // namespace UrlUtils
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user