From 0f69a5a3ad4e06a2d61aaf58a05463a7046b7854 Mon Sep 17 00:00:00 2001 From: Victoria Fischer Date: Fri, 26 Jun 2026 10:21:20 +0200 Subject: [PATCH] artifacts: add more metadata accessable through the mixxedbeets plugin --- src/artifacts/mod.rs | 28 ++++++++++++++++++++-------- src/prediction/toolbox.rs | 2 +- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/artifacts/mod.rs b/src/artifacts/mod.rs index fa83374..94a01b3 100644 --- a/src/artifacts/mod.rs +++ b/src/artifacts/mod.rs @@ -64,17 +64,29 @@ impl PartialEq for Album { #[derive(Debug, Serialize, Deserialize, Clone, Default)] pub struct Track { pub title: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub year: Option, - #[serde(skip_serializing_if = "Vec::is_empty")] - #[serde(default)] - pub genres: Vec, + #[serde(skip_serializing_if = "Option::is_none")] pub album: Option, #[serde(skip_serializing_if = "Option::is_none")] pub artist: Option, + + #[serde(skip_serializing_if = "HashSet::is_empty")] + #[serde(default)] + pub genres: HashSet, + + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub release_date: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub last_played: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub added: Option>, + + #[serde(skip_serializing_if = "Option::is_none")] + pub rating: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub bpm: Option } @@ -238,7 +250,7 @@ impl Merge for Contents { impl Merge for Track { fn merge(&mut self, other: Self) { - merge_fields!(self, other, album, label, year, artist, bpm); + merge_fields!(self, other, album, label, release_date, artist, bpm, rating, added, last_played); } } diff --git a/src/prediction/toolbox.rs b/src/prediction/toolbox.rs index 71f4b82..4ade5cc 100644 --- a/src/prediction/toolbox.rs +++ b/src/prediction/toolbox.rs @@ -84,7 +84,7 @@ impl Toolbox for ArchiveToolbox { fn tools(&self) -> Vec { vec![ Tool { name: "synchronize_artifacts".into(), description: "Attempts to automatically synchronize the current set of artifacts with missing sources".into(), schema: schema_for!(ArtifactSyncArgs)}.into(), - Tool { name: "task_list".into(), description: "Allows you to maintain a long-running todo list as you complete your research".into(), schema: schema_for!(TaskListArgs)}.into(), + Tool { name: "task_list".into(), description: "Allows you to maintain a long-running todo list as you complete your research".into(), schema: schema_for!(TaskListOperations)}.into(), // TODO: There should only be two queries, one against the ship's onboard archive, and another against the relay network, or whatever we call it. Both should be structured with the same arguments schema // TODO: A query should specify what parts of metadata are sufficient for the result, so we don't always have to hit all the layers of data. beets can of course, ignore this. // TODO: A query should be hierarchical somehow? eg, "I already know about artist X, but I want to know everything about track Y from album Z" or "I don't know anything about artist X/album Y, please give me an overview"