Allow removing tags via the button

This commit is contained in:
Elias Projahn 2023-10-08 15:25:00 +02:00
parent af57fe020c
commit a790d913af
3 changed files with 50 additions and 5 deletions

View file

@ -291,13 +291,19 @@ impl LibraryResults {
}
}
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq)]
pub struct Person {
pub id: String,
pub first_name: String,
pub last_name: String,
}
impl PartialEq for Person {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}
impl Person {
pub fn from_row(row: &Row) -> rusqlite::Result<Self> {
Ok(Self {
@ -312,12 +318,18 @@ impl Person {
}
}
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq)]
pub struct Ensemble {
pub id: String,
pub name: String,
}
impl PartialEq for Ensemble {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}
impl Ensemble {
pub fn from_row(row: &Row) -> rusqlite::Result<Self> {
Ok(Self {
@ -327,13 +339,19 @@ impl Ensemble {
}
}
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq)]
pub struct Work {
pub id: String,
pub title: String,
pub composer: Person,
}
impl PartialEq for Work {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}
impl Work {
pub fn from_row(row: &Row) -> rusqlite::Result<Self> {
Ok(Self {
@ -348,12 +366,18 @@ impl Work {
}
}
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Eq)]
pub struct Recording {
pub id: String,
pub work: Work,
}
impl PartialEq for Recording {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}
impl Recording {
pub fn from_row(row: &Row) -> rusqlite::Result<Self> {
Ok(Self {