diff --git a/src/core/collection/album.rs b/src/core/collection/album.rs index c10f9d5..b402008 100644 --- a/src/core/collection/album.rs +++ b/src/core/collection/album.rs @@ -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);