pub struct Sources {
pub records: Vec<SourceRecord>,
pub reviews: Vec<SourceReview>,
pub credit_exclusions: Vec<CreditExclusion>,
}Expand description
Everything other sources have said, as it sits in sources.json.
Fields§
§records: Vec<SourceRecord>One row per entity and source.
reviews: Vec<SourceReview>Explicit answers to claims that could not safely resolve themselves.
credit_exclusions: Vec<CreditExclusion>User decisions about individual source credits.
Implementations§
Source§impl Sources
impl Sources
Sourcepub fn get(&self, entity: &EntityRef, source: &str) -> Option<&SourceRecord>
pub fn get(&self, entity: &EntityRef, source: &str) -> Option<&SourceRecord>
What one source says about one entity, if it has said anything.
Sourcepub fn about<'a>(
&'a self,
entity: &'a EntityRef,
) -> impl Iterator<Item = &'a SourceRecord>
pub fn about<'a>( &'a self, entity: &'a EntityRef, ) -> impl Iterator<Item = &'a SourceRecord>
Everything every source says about one entity.
Several rows are the point rather than a defect: two sources that disagree are two rows, and the disagreement is reported instead of being resolved behind the user’s back.
Sourcepub fn review_for(&self, record: &SourceRecord) -> Option<&SourceReview>
pub fn review_for(&self, record: &SourceRecord) -> Option<&SourceReview>
The current decision for this exact source claim.
Sourcepub fn is_trusted(&self, catalog: &Catalog, record: &SourceRecord) -> bool
pub fn is_trusted(&self, catalog: &Catalog, record: &SourceRecord) -> bool
Whether a source record is safe to use as a graph relationship.
A decision wins over the mechanical confidence. With no decision, only exact attachments that do not contradict a local MusicBrainz identity are trusted.
Sourcepub fn contradicts_linked_identity(
&self,
catalog: &Catalog,
record: &SourceRecord,
) -> bool
pub fn contradicts_linked_identity( &self, catalog: &Catalog, record: &SourceRecord, ) -> bool
Whether a biography cache belongs to a different known provider identity.
Only a trusted MusicBrainz relationship can establish a contradiction.
Missing relationships and pending proposals do not invalidate independent
evidence. This is a cache identity check, not a review decision: explicit
reviews of the biography itself still take priority in is_trusted.
Sourcepub fn review_items(&self, catalog: &Catalog) -> Vec<ReviewItem>
pub fn review_items(&self, catalog: &Catalog) -> Vec<ReviewItem>
Every current claim requiring or carrying an explicit review.
Sourcepub fn decide(
&mut self,
catalog: &Catalog,
selector: &str,
decision: ReviewDecision,
reviewed_at: u64,
) -> Result<ReviewItem, String>
pub fn decide( &mut self, catalog: &Catalog, selector: &str, decision: ReviewDecision, reviewed_at: u64, ) -> Result<ReviewItem, String>
Accepts or rejects one review item selected by its full ID or an unambiguous prefix. Returns the reviewed item as it now stands.
Sourcepub fn clear_review(
&mut self,
catalog: &Catalog,
selector: &str,
) -> Result<ReviewItem, String>
pub fn clear_review( &mut self, catalog: &Catalog, selector: &str, ) -> Result<ReviewItem, String>
Removes one explicit decision, returning the item to pending state.
Sourcepub fn set_review(&mut self, review: SourceReview) -> bool
pub fn set_review(&mut self, review: SourceReview) -> bool
Stores one review, replacing the previous decision about the same exact claim.
Sourcepub fn set(&mut self, record: SourceRecord) -> bool
pub fn set(&mut self, record: SourceRecord) -> bool
Files a record, replacing whatever that same source said before.
Returns true when it replaced an existing row. A second fetch is an
update, not a duplicate — but only for the same source: what
MusicBrainz says never overwrites what a plugin said, which is the
whole reason the source is part of the key.
Sourcepub fn work_links(&self, catalog: &Catalog) -> Vec<SourcedWorkLink>
pub fn work_links(&self, catalog: &Catalog) -> Vec<SourcedWorkLink>
Source-asserted recording-to-work links that this catalog can place.
The source record is keyed by a local track path, while the graph’s relationship belongs to the canonical recording carrying that track. Resolving this only when read keeps rescans and source updates independent. Conflicting sources are intentionally all returned.
Sourcepub fn work_parent_links(&self, catalog: &Catalog) -> Vec<SourcedWorkParentLink>
pub fn work_parent_links(&self, catalog: &Catalog) -> Vec<SourcedWorkParentLink>
Explicit part-of-work assertions, retaining the attachment’s trust.
Sourcepub fn credit_links(&self, catalog: &Catalog) -> Vec<SourcedCreditLink>
pub fn credit_links(&self, catalog: &Catalog) -> Vec<SourcedCreditLink>
Rich recording and work credits that can be placed on this catalog.
The relationship remains external evidence. Mapping the source record’s track to its canonical recording makes it traversable without copying the claim into the tag-built catalog.
Sourcepub fn edition_credit_links(
&self,
catalog: &Catalog,
) -> Vec<SourcedEditionCreditLink>
pub fn edition_credit_links( &self, catalog: &Catalog, ) -> Vec<SourcedEditionCreditLink>
Credits anchored to an exact fetched edition or an explicit local manual correction. A release-group-only answer cannot supply these.
Sourcepub fn exclude_credit(&mut self, relation: RelationRef, at: u64)
pub fn exclude_credit(&mut self, relation: RelationRef, at: u64)
Exclude one relationship without losing the underlying fetched claim.
Sourcepub fn exclude_credit_in(
&mut self,
catalog: &Catalog,
relation: RelationRef,
at: u64,
)
pub fn exclude_credit_in( &mut self, catalog: &Catalog, relation: RelationRef, at: u64, )
Exclude a current credit while retaining its artist’s exact identity. Keeping a known MBID makes the decision survive the artist entering or leaving local tags without changing displayed relationship selectors.
Sourcepub fn restore_credit(&mut self, relation: &RelationRef) -> bool
pub fn restore_credit(&mut self, relation: &RelationRef) -> bool
Take back one exclusion and make the original claim eligible again.
Sourcepub fn restore_credit_in(
&mut self,
catalog: &Catalog,
relation: &RelationRef,
) -> bool
pub fn restore_credit_in( &mut self, catalog: &Catalog, relation: &RelationRef, ) -> bool
Restore a credit selected from the current catalog, including an older exclusion whose named endpoint now has an exact MusicBrainz identity.
Sourcepub fn membership_links(&self, catalog: &Catalog) -> Vec<SourcedMembershipLink>
pub fn membership_links(&self, catalog: &Catalog) -> Vec<SourcedMembershipLink>
Dated group memberships, retaining external endpoints when the related artist is not part of the local catalog.
Sourcepub fn find_sourced_works(
&self,
catalog: &Catalog,
query: &str,
) -> Vec<SourcedWork>
pub fn find_sourced_works( &self, catalog: &Catalog, query: &str, ) -> Vec<SourcedWork>
Certain source-backed works matching a title or MusicBrainz ID.
Approximate attachment records stay visible through Sources::work_links
but do not become navigation targets. This is the boundary between
evidence and a relationship safe enough to traverse.
Sourcepub fn label_identity(
&self,
catalog: &Catalog,
label_id: Id,
) -> Option<LabelIdentityResolution>
pub fn label_identity( &self, catalog: &Catalog, label_id: Id, ) -> Option<LabelIdentityResolution>
Reconciles one label’s explicit tag identity with its source record.
Sourcepub fn label_identities(&self, catalog: &Catalog) -> Vec<SourcedLabelIdentity>
pub fn label_identities(&self, catalog: &Catalog) -> Vec<SourcedLabelIdentity>
MusicBrainz label identities that this catalog can place.
Searches are deliberately absent: an equally named label is not an
identity. The Identified confidence records are identifier lookups.
Sourcepub fn forget(&mut self, source: &str) -> usize
pub fn forget(&mut self, source: &str) -> usize
Drops everything one source ever said, and reports how much that was.
The counterpart of an attributed layer: a value that can be traced to a source can also be removed by naming that source, without touching what anybody else said.
Sourcepub fn forget_entity(&mut self, entity: &EntityRef) -> usize
pub fn forget_entity(&mut self, entity: &EntityRef) -> usize
Drops everything said about one entity, whoever said it.