diff options
| author | Franck Cuny <franck@fcuny.net> | 2021-10-10 13:22:14 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2021-10-10 13:22:14 -0700 |
| commit | e86984a78aa0c95bca878c8d24f143b1e515a3f0 (patch) | |
| tree | ee7652c3f42580049a5678f076fea4351f52ee37 /internal/scrobbler/record.go | |
| parent | mpd-stats: pass database path to the scrobbler (diff) | |
| download | x-e86984a78aa0c95bca878c8d24f143b1e515a3f0.tar.gz | |
record: add some basic testing
Diffstat (limited to 'internal/scrobbler/record.go')
| -rw-r--r-- | internal/scrobbler/record.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/scrobbler/record.go b/internal/scrobbler/record.go index b9f95a0..e252fd3 100644 --- a/internal/scrobbler/record.go +++ b/internal/scrobbler/record.go @@ -34,3 +34,9 @@ func NewRecord(attrs mpd.Attrs) (*Record, error) { record.Duration = time.Second * time.Duration(dur) return &record, nil } + +func (r *Record) EqualAttrs(attrs mpd.Attrs) bool { + return r.Title == attrs["Title"] && + r.Album == attrs["Album"] && + r.Artist == attrs["Artist"] +} |
