Skip to content

Commit

Permalink
add HasOneChanged method (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Aug 28, 2023
1 parent 4b4244a commit 05d0acb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ai/model/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,15 @@ func (m *MusicOrientation) HasAllSet() bool {
m.Liveness.HasChanged &&
m.Speechiness.HasChanged
}

func (m *MusicOrientation) HasOneChanged() bool {
return m.Genres.HasChanged ||
m.Danceability.HasChanged ||
m.Valence.HasChanged ||
m.Popularity.HasChanged ||
m.Acousticness.HasChanged ||
m.Energy.HasChanged ||
m.Instrumentalness.HasChanged ||
m.Liveness.HasChanged ||
m.Speechiness.HasChanged
}

0 comments on commit 05d0acb

Please sign in to comment.