summaryrefslogtreecommitdiffstats
path: root/src/artist.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2024-11-14 21:43:54 +0000
committerLibravatar cel 🌸 <cel@blos.sm>2024-11-14 21:43:54 +0000
commit67b54449a1bbde257e9454419e7bb70ebc515c0f (patch)
treee23710c2d1f5d219205f26af727b478e455a0071 /src/artist.rs
parent469a3ad33914f7eff6edc9ca7fabb12f2950da84 (diff)
downloadcritch-67b54449a1bbde257e9454419e7bb70ebc515c0f.tar.gz
critch-67b54449a1bbde257e9454419e7bb70ebc515c0f.tar.bz2
critch-67b54449a1bbde257e9454419e7bb70ebc515c0f.zip
implement artwork uploadHEADmain
Diffstat (limited to 'src/artist.rs')
-rw-r--r--src/artist.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/artist.rs b/src/artist.rs
index 476dad9..0ea9131 100644
--- a/src/artist.rs
+++ b/src/artist.rs
@@ -1,9 +1,9 @@
use crate::error::Error;
use crate::Result;
-#[derive(sqlx::FromRow)]
+#[derive(sqlx::FromRow, sqlx::Type)]
pub struct Artist {
- id: Option<i32>,
+ artist_id: Option<i32>,
pub handle: String,
pub name: Option<String>,
pub bio: Option<String>,
@@ -11,7 +11,17 @@ pub struct Artist {
}
impl Artist {
- pub fn id(&self) -> Option<i32> {
- self.id
+ pub fn new(handle: String) -> Self {
+ Self {
+ artist_id: None,
+ handle,
+ name: None,
+ bio: None,
+ site: None,
+ }
+ }
+
+ pub fn artist_id(&self) -> Option<i32> {
+ self.artist_id
}
}