feat: add testing-torrents

This commit is contained in:
2025-04-01 03:00:29 +08:00
parent 07ac7e3376
commit a0fc4c04d9
21 changed files with 2667 additions and 439 deletions

View File

@@ -65,7 +65,7 @@ once_cell = "1.20.2"
reqwest-middleware = "0.4.0"
reqwest-retry = "0.7.0"
reqwest-tracing = "0.5.5"
scraper = "0.22.0"
scraper = "0.23"
leaky-bucket = "1.1.2"
serde_with = "3"
jwt-authorizer = "0.15.0"
@@ -87,8 +87,8 @@ color-eyre = "0.6"
log = "0.4.22"
anyhow = "1.0.95"
bollard = { version = "0.18", optional = true }
async-graphql = { version = "7.0.15", features = [] }
async-graphql-axum = "7.0.15"
async-graphql = { version = "7", features = [] }
async-graphql-axum = "7"
fastrand = "2.3.0"
seaography = { version = "1.1" }
quirks_path = "0.1.1"
@@ -129,13 +129,11 @@ tracing-appender = "0.2.3"
clap = "4.5.31"
futures-util = "0.3.31"
ipnetwork = "0.21.1"
kanal = "0.1.0-pre8"
append-only-vec = "0.1.7"
typed-builder = "0.20.0"
ctor = "0.4.0"
librqbit = "8.0.0"
[dev-dependencies]
serial_test = "3"
insta = { version = "1", features = ["redactions", "yaml", "filters"] }
mockito = "1.6.1"
rstest = "0.24.0"
rstest = "0.25"

View File

@@ -1,11 +1,12 @@
pub mod core;
pub mod error;
pub mod qbit;
mod utils;
pub mod rqbit;
pub mod utils;
pub use core::{
Torrent, TorrentContent, TorrentDownloader, TorrentFilter, TorrentSource, BITTORRENT_MIME_TYPE,
MAGNET_SCHEMA,
BITTORRENT_MIME_TYPE, MAGNET_SCHEMA, Torrent, TorrentContent, TorrentDownloader, TorrentFilter,
TorrentSource,
};
pub use error::TorrentDownloadError;

View File

@@ -0,0 +1 @@
use librqbit::TorrentMetadata;

View File

@@ -8,13 +8,13 @@ use tracing::instrument;
use url::Url;
use crate::{
download::core::BITTORRENT_MIME_TYPE,
errors::{RError, RResult},
extract::mikan::{
MikanClient,
web_extract::{MikanEpisodeHomepage, extract_mikan_episode_id_from_homepage},
},
fetch::bytes::fetch_bytes,
sync::core::BITTORRENT_MIME_TYPE,
};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
@@ -339,11 +339,11 @@ mod tests {
use url::Url;
use crate::{
download::core::BITTORRENT_MIME_TYPE,
extract::mikan::{
MikanBangumiAggregationRssChannel, MikanBangumiRssChannel, MikanRssChannel,
extract_mikan_rss_channel_from_rss_link,
},
sync::core::BITTORRENT_MIME_TYPE,
test_utils::mikan::build_testing_mikan_client,
};

View File

@@ -12,6 +12,7 @@ pub mod app;
pub mod auth;
pub mod cache;
pub mod database;
pub mod download;
pub mod errors;
pub mod extract;
pub mod fetch;
@@ -20,7 +21,6 @@ pub mod logger;
pub mod migrations;
pub mod models;
pub mod storage;
pub mod sync;
pub mod tasks;
#[cfg(test)]
pub mod test_utils;