Add a library identifier to disambiguate clashes in the library #238

Merged
wojtek merged 16 commits from 231---differentiate-release-groups-with-same-title-but-different-type-clash into main 2025-01-02 15:50:55 +01:00
Showing only changes of commit 8a1447334e - Show all commits

View File

@ -41,11 +41,11 @@ pub struct AlbumId {
}
impl AlbumId {
pub fn alike(&self, other: &AlbumId) -> bool {
let titles_alike = self.title == other.title;
let lib_id_alike =
pub fn compatible(&self, other: &AlbumId) -> bool {
let titles_compatible = self.title == other.title;
let lib_id_compatible =
self.lib_id.is_none() || other.lib_id.is_none() || (self.lib_id == other.lib_id);
titles_alike && lib_id_alike
titles_compatible && lib_id_compatible
}
}
@ -268,7 +268,7 @@ impl Ord for AlbumMeta {
impl Merge for AlbumMeta {
fn merge_in_place(&mut self, other: Self) {
assert!(self.id.alike(&other.id));
assert!(self.id.compatible(&other.id));
self.seq = std::cmp::max(self.seq, other.seq);