mirror of
https://git.sr.ht/~phw/scotty
synced 2025-05-10 10:17:04 +02:00
Simplify timestamp comparisons
This commit is contained in:
parent
389c7c6ec1
commit
c305b6c7e3
7 changed files with 14 additions and 14 deletions
|
@ -139,7 +139,7 @@ func (b *SpotifyApiBackend) ExportListens(oldestTimestamp time.Time, results cha
|
|||
|
||||
for _, listen := range result.Items {
|
||||
l := listen.AsListen()
|
||||
if l.ListenedAt.Unix() > oldestTimestamp.Unix() {
|
||||
if l.ListenedAt.After(oldestTimestamp) {
|
||||
listens = append(listens, l)
|
||||
} else {
|
||||
// result contains listens older then oldestTimestamp
|
||||
|
@ -195,7 +195,7 @@ out:
|
|||
loves := make(models.LovesList, 0, perPage)
|
||||
for _, track := range result.Items {
|
||||
love := track.AsLove()
|
||||
if love.Created.Unix() > oldestTimestamp.Unix() {
|
||||
if love.Created.After(oldestTimestamp) {
|
||||
loves = append(loves, love)
|
||||
} else {
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue