Initial commit

This commit is contained in:
Connor Johnstone
2026-03-17 15:01:19 -04:00
commit 9c59cf73e7
13 changed files with 1409 additions and 0 deletions

30
src/error.rs Normal file
View File

@@ -0,0 +1,30 @@
use shanty_db::DbError;
#[derive(Debug, thiserror::Error)]
pub enum TagError {
#[error("database error: {0}")]
Db(#[from] DbError),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("HTTP error: {0}")]
Http(#[from] reqwest::Error),
#[error("metadata error: {0}")]
Metadata(String),
#[error("no match found for track {0}")]
NoMatch(i32),
#[error("{0}")]
Other(String),
}
impl From<lofty::error::LoftyError> for TagError {
fn from(e: lofty::error::LoftyError) -> Self {
TagError::Metadata(e.to_string())
}
}
pub type TagResult<T> = Result<T, TagError>;