diff --git a/server/src/api/documents.rs b/server/src/api/documents.rs index a30c822..646d1ee 100644 --- a/server/src/api/documents.rs +++ b/server/src/api/documents.rs @@ -65,11 +65,14 @@ pub enum Included { impl PartialEq for Included { fn eq(&self, other: &Self) -> bool { match (self, other) { + (Included::User(a), Included::User(b)) => a.id == b.id, + (Included::Scrobble(a), Included::Scrobble(b)) => a.id == b.id, (Included::Image(a), Included::Image(b)) => a.id == b.id, (Included::Artist(a), Included::Artist(b)) => a.id == b.id, (Included::Track(a), Included::Track(b)) => a.id == b.id, (Included::Medium(a), Included::Medium(b)) => a.id == b.id, (Included::Release(a), Included::Release(b)) => a.id == b.id, + (Included::Genre(a), Included::Genre(b)) => a.id == b.id, (_, _) => false, } } @@ -85,11 +88,14 @@ impl std::cmp::PartialOrd for Included { impl std::cmp::Ord for Included { fn cmp(&self, other: &Self) -> std::cmp::Ordering { match (self, other) { + (Included::User(a), Included::User(b)) => a.id.cmp(&b.id), + (Included::Scrobble(a), Included::Scrobble(b)) => a.id.cmp(&b.id), (Included::Image(a), Included::Image(b)) => a.id.cmp(&b.id), (Included::Artist(a), Included::Artist(b)) => a.id.cmp(&b.id), (Included::Track(a), Included::Track(b)) => a.id.cmp(&b.id), (Included::Medium(a), Included::Medium(b)) => a.id.cmp(&b.id), (Included::Release(a), Included::Release(b)) => a.id.cmp(&b.id), + (Included::Genre(a), Included::Genre(b)) => a.id.cmp(&b.id), (_, _) => std::cmp::Ordering::Less, } } diff --git a/server/src/api/internal/documents.rs b/server/src/api/internal/documents.rs index c99bb66..1aacfdf 100644 --- a/server/src/api/internal/documents.rs +++ b/server/src/api/internal/documents.rs @@ -129,6 +129,7 @@ impl PartialEq for Included { match (self, other) { (Included::Directory(a), Included::Directory(b)) => a.id == b.id, (Included::Import(a), Included::Import(b)) => a.id == b.id, + (Included::TempoInclude(a), Included::TempoInclude(b)) => a == b, (_, _) => false, } } @@ -146,6 +147,7 @@ impl std::cmp::Ord for Included { match (self, other) { (Included::Directory(a), Included::Directory(b)) => a.id.cmp(&b.id), (Included::Import(a), Included::Import(b)) => a.id.cmp(&b.id), + (Included::TempoInclude(a), Included::TempoInclude(b)) => a.cmp(&b), (_, _) => std::cmp::Ordering::Less, } }