dj sets + lyrics: a mix that names its own tracks, and words pulled off the separated voice
This commit is contained in:
1 parent
4efe85b6bf
commit
1dd8573808
41 files changed
+9288
-647
No files matched your search
@@ -4500,6 +4500,27 @@ impl MetadataClient {
|
||||
}
|
||||
}
|
||||
|
||||
/// One catalog track by ISRC — the anchor-exact lookup for rows whose
|
||||
/// identity came from AUDIO RECOGNITION (the recognizer reports the
|
||||
/// matched release's ISRC). An id-grade identity, never a name guess;
|
||||
/// `None` is an honest "that release isn't in the catalog".
|
||||
pub async fn catalog_track_by_isrc(&self, isrc: &str) -> Option<CatalogTrack> {
|
||||
let clean: String = isrc
|
||||
.chars()
|
||||
.filter(|c| c.is_ascii_alphanumeric())
|
||||
.map(|c| c.to_ascii_uppercase())
|
||||
.collect();
|
||||
// ISRCs are exactly 12 characters (CC-XXX-YY-NNNNN without the
|
||||
// dashes); anything else would only ever be a malformed URL.
|
||||
if clean.len() != 12 {
|
||||
return None;
|
||||
}
|
||||
let body = self
|
||||
.deezer(&format!("https://api.deezer.com/track/isrc:{clean}"))
|
||||
.await?;
|
||||
parse_track(&body)
|
||||
}
|
||||
|
||||
/// The two things the search hero can say about an artist that Deezer
|
||||
/// cannot: what they sound like, and how big they are.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user