prediction: rewrite the prompting stack to create the ship computer as a second character, and let characters/agents operate autonomously with their own tasks and event queues
This commit is contained in:
+31
-5
@@ -43,7 +43,7 @@ impl PartialEq for Artist {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Default)]
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||
pub struct Album {
|
||||
pub title: String,
|
||||
pub artist: String,
|
||||
@@ -55,6 +55,20 @@ pub struct Album {
|
||||
pub release_date: Option<DateTime<Utc>>
|
||||
}
|
||||
|
||||
impl PartialEq for Album {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
if self.title != other.title || self.artist != other.artist {
|
||||
return false;
|
||||
}
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
fn ne(&self, other: &Self) -> bool {
|
||||
!self.eq(other)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
|
||||
pub struct Track {
|
||||
pub title: String,
|
||||
@@ -79,11 +93,11 @@ impl PartialEq for Track {
|
||||
return false;
|
||||
}
|
||||
|
||||
if self.artist.is_some() && self.artist != other.artist {
|
||||
if other.artist.is_some() && self.artist.is_some() && self.artist != other.artist {
|
||||
return false;
|
||||
}
|
||||
|
||||
if self.album.is_some() && self.album != other.album {
|
||||
if other.album.is_some() && self.album.is_some() && self.album != other.album {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -224,10 +238,10 @@ impl Merge for Contents {
|
||||
this_track.merge(that_track);
|
||||
},
|
||||
(Self::Album(this_album), Self::Album(that_album)) => {
|
||||
merge_fields!(this_album, that_album, about, credits, release_date);
|
||||
this_album.merge(that_album);
|
||||
},
|
||||
(Self::Artist(this_artist), Self::Artist(that_artist)) => {
|
||||
merge_fields!(this_artist, that_artist, bio, location);
|
||||
this_artist.merge(that_artist);
|
||||
},
|
||||
_ => ()
|
||||
}
|
||||
@@ -238,4 +252,16 @@ impl Merge for Track {
|
||||
fn merge(&mut self, other: Self) {
|
||||
merge_fields!(self, other, album, label, year, artist, bpm);
|
||||
}
|
||||
}
|
||||
|
||||
impl Merge for Artist {
|
||||
fn merge(&mut self, other: Self) {
|
||||
merge_fields!(self, other, bio, location);
|
||||
}
|
||||
}
|
||||
|
||||
impl Merge for Album {
|
||||
fn merge(&mut self, other: Self) {
|
||||
merge_fields!(self, other, about, credits, release_date);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user