about summary refs log tree commit diff
path: root/tools/mpd-stats/internal/scrobbler/record.go
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-10-24 17:32:17 -0700
committerFranck Cuny <franck@fcuny.net>2022-10-24 17:32:17 -0700
commitfe7dfdd250b701177f051ad6cdc3dc68695cbfc4 (patch)
tree99d7cf0230ad604c256df2225c1d32ef4266d4ec /tools/mpd-stats/internal/scrobbler/record.go
parentfeat(home/packages): install git-broom (diff)
downloadworld-fe7dfdd250b701177f051ad6cdc3dc68695cbfc4.tar.gz
ref(tools/mpd-stats): delete the project
It's been moved to its own repository at
https://github.com/fcuny/mpd-stats

Update the list of repositories managed by terraform.
Diffstat (limited to 'tools/mpd-stats/internal/scrobbler/record.go')
-rw-r--r--tools/mpd-stats/internal/scrobbler/record.go42
1 files changed, 0 insertions, 42 deletions
diff --git a/tools/mpd-stats/internal/scrobbler/record.go b/tools/mpd-stats/internal/scrobbler/record.go
deleted file mode 100644
index e252fd3..0000000
--- a/tools/mpd-stats/internal/scrobbler/record.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package scrobbler
-
-import (
-	"strconv"
-	"time"
-
-	"github.com/fhs/gompd/v2/mpd"
-	"github.com/google/uuid"
-)
-
-type Record struct {
-	Id        uuid.UUID
-	Title     string
-	Album     string
-	Artist    string
-	Duration  time.Duration
-	Timestamp time.Time
-}
-
-func NewRecord(attrs mpd.Attrs) (*Record, error) {
-	record := Record{
-		Id:        uuid.New(),
-		Title:     attrs["Title"],
-		Album:     attrs["Album"],
-		Artist:    attrs["Artist"],
-		Timestamp: time.Now(),
-	}
-
-	dur, err := strconv.ParseFloat(attrs["duration"], 32)
-	if err != nil {
-		return nil, err
-	}
-
-	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"]
-}