refactor(discovery): share provider pipelines

This commit is contained in:
objz committed 2026-08-04 21:10:57 +02:00
1 parent d488954548
commit d001ab8d0a
5 files changed
+343 -517

No files matched your search

+26
View File
@@ -32,6 +32,13 @@ pub trait ContentProvider: Send + Sync {
limit: usize,
) -> Result<DiscoveryResults, crate::net::NetError>;
async fn search_modpacks(
&self,
query: &str,
offset: usize,
limit: usize,
) -> Result<DiscoveryResults, crate::net::NetError>;
async fn resolve_files(
&self,
files: &[FingerprintQuery],
@@ -99,6 +106,15 @@ impl ContentProvider for ModrinthProvider {
.await
}
async fn search_modpacks(
&self,
query: &str,
offset: usize,
limit: usize,
) -> Result<DiscoveryResults, crate::net::NetError> {
crate::net::modrinth::search_modpacks(&self.client, query, offset, limit).await
}
async fn resolve_files(
&self,
files: &[FingerprintQuery],
@@ -230,6 +246,16 @@ impl ContentProvider for CurseForgeProvider {
.await
}
async fn search_modpacks(
&self,
query: &str,
offset: usize,
limit: usize,
) -> Result<DiscoveryResults, crate::net::NetError> {
crate::net::curseforge::search_modpacks(&self.client, &self.api_key, query, offset, limit)
.await
}
async fn resolve_files(
&self,
files: &[FingerprintQuery],