prediction: don't inflate data with hammering bandcamp, at least until we get musicbrainz working
This commit is contained in:
+20
-3
@@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
use serde_json::{Serializer, ser::CompactFormatter};
|
use serde_json::{Serializer, ser::CompactFormatter};
|
||||||
use tokio::sync::{RwLock, mpsc, watch};
|
use tokio::sync::{RwLock, mpsc, watch};
|
||||||
|
|
||||||
use crate::{SaveData, archive::BeatsQueryArgs, artifacts::{BandcampQueryArgs, MixxxDB}, scene::{Scene, Scenery, StageDirection, conversation::ConversationEntry}};
|
use crate::{SaveData, archive::BeatsQueryArgs, artifacts::{Album, Artifact, Artist, BandcampQueryArgs, MixxxDB, Track}, scene::{Scene, Scenery, StageDirection, conversation::ConversationEntry}};
|
||||||
|
|
||||||
|
|
||||||
const SYSTEM_PROMPT: &str = include_str!("system-prompt.txt");
|
const SYSTEM_PROMPT: &str = include_str!("system-prompt.txt");
|
||||||
@@ -108,11 +108,28 @@ impl Session {
|
|||||||
log::debug!("Result: {:?}", result);
|
log::debug!("Result: {:?}", result);
|
||||||
match result {
|
match result {
|
||||||
SearchResultItem::Artist(data) => {
|
SearchResultItem::Artist(data) => {
|
||||||
let result = bandcamp::fetch_artist(data.artist_id).await.unwrap().into();
|
let result = Artifact::Artist(Artist {
|
||||||
|
name: data.name,
|
||||||
|
location: data.location,
|
||||||
|
..Default::default()
|
||||||
|
});
|
||||||
json_results.push(result);
|
json_results.push(result);
|
||||||
},
|
},
|
||||||
SearchResultItem::Album(data) => {
|
SearchResultItem::Album(data) => {
|
||||||
let result = bandcamp::fetch_album(data.band_id, data.album_id).await.unwrap().into();
|
let result = Artifact::Album(Album {
|
||||||
|
title: data.name,
|
||||||
|
artist: data.band_name,
|
||||||
|
..Default::default()
|
||||||
|
});
|
||||||
|
json_results.push(result);
|
||||||
|
},
|
||||||
|
SearchResultItem::Track(data) => {
|
||||||
|
let result = Artifact::Track(Track {
|
||||||
|
title: data.name,
|
||||||
|
artist: Some(data.band_name),
|
||||||
|
album: data.album_name,
|
||||||
|
..Default::default()
|
||||||
|
});
|
||||||
json_results.push(result);
|
json_results.push(result);
|
||||||
}
|
}
|
||||||
_ => ()
|
_ => ()
|
||||||
|
|||||||
Reference in New Issue
Block a user