artifacts: split out each artifact source into a submodule, move archive.rs into artifacts/beets.rs
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::artifacts::{Album, Artifact, Artist, SourceID};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, JsonSchema)]
|
||||
pub struct BandcampQueryArgs {
|
||||
pub query: String
|
||||
}
|
||||
|
||||
impl Into<Artifact> for bandcamp::Artist {
|
||||
fn into(self) -> Artifact {
|
||||
Artifact::Artist(Artist { name: self.name, bio: self.bio, location: self.location, sources: vec![SourceID::Bandcamp(self.id)] })
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Artifact> for bandcamp::Album {
|
||||
fn into(self) -> Artifact {
|
||||
Artifact::Album(Album {
|
||||
about: self.about,
|
||||
title: self.title,
|
||||
artist: self.band.name,
|
||||
credits: self.credits,
|
||||
release_date: Some(self.release_date),
|
||||
sources: vec!{SourceID::Bandcamp(self.id)}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user