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

@ -73,7 +73,7 @@ out:
for _, scrobble := range result.List {
if scrobble.ListenedAt > oldestTimestamp.Unix() {
p.Elapsed += 1
listens = append(listens, scrobble.ToListen())
listens = append(listens, scrobble.AsListen())
} else {
break out
}
@ -116,7 +116,7 @@ func (b *MalojaApiBackend) ImportListens(export models.ListensResult, importResu
return importResult, nil
}
func (s Scrobble) ToListen() models.Listen {
func (s Scrobble) AsListen() models.Listen {
track := s.Track
listen := models.Listen{
ListenedAt: time.Unix(s.ListenedAt, 0),