mirror of
https://github.com/flibusta-apps/telegram_files_cache_server.git
synced 2026-03-03 23:20:48 +01:00
Fix
This commit is contained in:
@@ -47,3 +47,22 @@ pub async fn get_book(
|
||||
) -> Result<types::BookWithRemote, Box<dyn std::error::Error + Send + Sync>> {
|
||||
_make_request(format!("/api/v1/books/{book_id}").as_str(), vec![]).await
|
||||
}
|
||||
|
||||
pub async fn get_books(
|
||||
page: u32,
|
||||
page_size: u32,
|
||||
uploaded_gte: String,
|
||||
uploaded_lte: String,
|
||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
let _params: Vec<(&str, String)> = vec![
|
||||
("page", page.to_string()),
|
||||
("page_size", page_size.to_string()),
|
||||
("uploaded_gte", uploaded_gte),
|
||||
("uploaded_lte", uploaded_lte)
|
||||
];
|
||||
|
||||
// TODO
|
||||
// _make_request(format!("/api/v1/books/").as_str(), params).await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use reqwest::Response;
|
||||
use serde::Deserialize;
|
||||
use tracing::log;
|
||||
|
||||
use crate::config::CONFIG;
|
||||
|
||||
@@ -21,6 +22,8 @@ pub async fn download_from_downloader(
|
||||
CONFIG.downloader_url
|
||||
);
|
||||
|
||||
log::info!("{url}");
|
||||
|
||||
let response = reqwest::Client::new()
|
||||
.get(url)
|
||||
.header("Authorization", &CONFIG.downloader_api_key)
|
||||
|
||||
@@ -131,3 +131,9 @@ pub async fn download_from_cache(
|
||||
caption
|
||||
})
|
||||
}
|
||||
|
||||
pub async fn start_update_cache(
|
||||
_db: Database
|
||||
) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user