Updated all import/export interfaces

This commit is contained in:
Philipp Wolfer 2023-11-15 19:24:12 +01:00
parent 729a3d0ed0
commit ab04eb1123
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
12 changed files with 247 additions and 167 deletions

View file

@ -67,6 +67,17 @@ type Love struct {
type ListensList []Listen
// Returns a new ListensList with only elements that are newer than t.
func (l ListensList) NewerThan(t time.Time) ListensList {
result := make(ListensList, 0, len(l))
for _, item := range l {
if item.ListenedAt.Unix() > t.Unix() {
result = append(result, item)
}
}
return result
}
func (l ListensList) Len() int {
return len(l)
}