mirror of
https://github.com/arabianq/lyrics_fetcher.git
synced 2026-04-28 08:01:22 +00:00
use lofty to support formats different from mp3
This commit is contained in:
+7
-2
@@ -6,13 +6,18 @@ pub use lrclib::LrcLibSource;
|
||||
|
||||
use anyhow::{Result, anyhow};
|
||||
use async_trait::async_trait;
|
||||
use id3::Tag;
|
||||
use lofty::{properties::FileProperties, tag::Tag};
|
||||
use std::sync::Arc;
|
||||
|
||||
#[async_trait]
|
||||
pub trait LyricsSource: Send + Sync {
|
||||
fn name(&self) -> &'static str;
|
||||
async fn fetch_lyrics(&self, tag: &Tag, allow_inaccurate: bool) -> Result<String>;
|
||||
async fn fetch_lyrics(
|
||||
&self,
|
||||
tag: &Tag,
|
||||
properties: &FileProperties,
|
||||
allow_inaccurate: bool,
|
||||
) -> Result<String>;
|
||||
}
|
||||
|
||||
pub async fn create_source(name: &str) -> Result<Arc<dyn LyricsSource>> {
|
||||
|
||||
Reference in New Issue
Block a user