feat: add first listened to dates for media items (#92)

This commit is contained in:
Gabe Farrell 2025-11-18 19:50:34 -05:00 committed by GitHub
parent 300bac0e19
commit 800c77d05e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 134 additions and 2 deletions

View file

@ -98,8 +98,14 @@ func (d *Psql) GetAlbum(ctx context.Context, opts db.GetAlbumOpts) (*models.Albu
return nil, fmt.Errorf("GetAlbum: CountTimeListenedToItem: %w", err)
}
firstListen, err := d.q.GetFirstListenFromRelease(ctx, ret.ID)
if err != nil {
return nil, fmt.Errorf("GetAlbum: GetFirstListenFromRelease: %w", err)
}
ret.ListenCount = count
ret.TimeListened = seconds
ret.FirstListen = firstListen.ListenedAt.Unix()
return ret, nil
}