Added the playlist generator
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use shanty_data::MetadataFetcher;
|
||||
use shanty_data::MusicBrainzFetcher;
|
||||
use shanty_data::http::RateLimiter;
|
||||
|
||||
use crate::error::SearchResult;
|
||||
use crate::provider::{
|
||||
@@ -17,6 +18,13 @@ impl MusicBrainzSearch {
|
||||
.map_err(|e| crate::error::SearchError::Provider(e.to_string()))?;
|
||||
Ok(Self { client })
|
||||
}
|
||||
|
||||
/// Create with a shared rate limiter (to coordinate with other MB clients).
|
||||
pub fn with_limiter(limiter: RateLimiter) -> SearchResult<Self> {
|
||||
let client = MusicBrainzFetcher::with_limiter(limiter)
|
||||
.map_err(|e| crate::error::SearchError::Provider(e.to_string()))?;
|
||||
Ok(Self { client })
|
||||
}
|
||||
}
|
||||
|
||||
impl SearchProvider for MusicBrainzSearch {
|
||||
|
||||
Reference in New Issue
Block a user