mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-25 13:57:56 +02:00
Updated all import/export interfaces
This commit is contained in:
parent
729a3d0ed0
commit
ab04eb1123
12 changed files with 247 additions and 167 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue