Add song.link (Odesli) sharing integration
- Create share module with SongLinkClient for Odesli API - Support for tracks via ISRC and albums via UPC - In-memory cache with 1-hour TTL - Commands: share_track_songlink, share_album_songlink - Qobuz URL generators for tracks, albums, artists - Proper error handling for missing identifiers
This commit is contained in:
1 parent
7e2740d297
commit
ff7b598522
7 files changed
+453
No files matched your search
@@ -0,0 +1,36 @@
|
||||
//! Error types for the share module
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum ShareError {
|
||||
#[error("Missing ISRC for track")]
|
||||
MissingIsrc,
|
||||
|
||||
#[error("Missing UPC for album")]
|
||||
MissingUpc,
|
||||
|
||||
#[error("Network error: {0}")]
|
||||
NetworkError(#[from] reqwest::Error),
|
||||
|
||||
#[error("Odesli API error: {0}")]
|
||||
OdesliError(String),
|
||||
|
||||
#[error("No matches found on Odesli")]
|
||||
NoMatches,
|
||||
|
||||
#[error("Invalid content type: {0}")]
|
||||
InvalidContentType(String),
|
||||
|
||||
#[error("Request timeout")]
|
||||
Timeout,
|
||||
}
|
||||
|
||||
impl serde::Serialize for ShareError {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: serde::Serializer,
|
||||
{
|
||||
serializer.serialize_str(&self.to_string())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user