mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-18 11:46:34 -07:00
feat: add first listened to dates for media items (#92)
This commit is contained in:
parent
300bac0e19
commit
800c77d05e
12 changed files with 134 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue