Reduced redundancy in model conversions and consistent naming

This commit is contained in:
Philipp Wolfer 2023-11-22 17:53:09 +01:00
parent e29d8e2a63
commit cac88f316b
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
10 changed files with 107 additions and 107 deletions

View file

@ -32,7 +32,7 @@ func TestFromConfig(t *testing.T) {
assert.IsType(t, &maloja.MalojaApiBackend{}, backend)
}
func TestScrobbleToListen(t *testing.T) {
func TestScrobbleAsListen(t *testing.T) {
scrobble := maloja.Scrobble{
ListenedAt: 1699289873,
Track: maloja.Track{
@ -45,7 +45,7 @@ func TestScrobbleToListen(t *testing.T) {
},
Origin: "client:Funkwhale",
}
listen := scrobble.ToListen()
listen := scrobble.AsListen()
assert := assert.New(t)
assert.Equal(time.Unix(1699289873, 0), listen.ListenedAt)
assert.Equal(time.Duration(414*time.Second), listen.Duration)