artifacts: make beets more forgiving, and handle errors with logs
This commit is contained in:
+8
-1
@@ -138,8 +138,15 @@ impl Session {
|
||||
async fn tool_artifact_query(&mut self, args: BeatsQueryArgs) -> ToolResults {
|
||||
let mut messages = vec![];
|
||||
messages.push(ConversationEntry::ShipComputer(format!("Executing archive query {:?}", args)));
|
||||
log::info!("Executing beets query {:?}", args);
|
||||
if let Ok(output) = args.execute() {
|
||||
self.scenery.artifacts.push(output);
|
||||
for track in &output {
|
||||
if let Some(merge_target) = self.scenery.artifacts.iter_mut().find(|a| { *a == track }) {
|
||||
merge_target.merge(track.clone());
|
||||
} else {
|
||||
self.scenery.artifacts.push(track.clone());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
messages.push(ConversationEntry::ShipComputer("Unable to execute query!".into()));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user