mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-17 11:16:35 -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
|
|
@ -89,8 +89,14 @@ func (d *Psql) GetTrack(ctx context.Context, opts db.GetTrackOpts) (*models.Trac
|
|||
return nil, fmt.Errorf("GetTrack: CountTimeListenedToItem: %w", err)
|
||||
}
|
||||
|
||||
firstListen, err := d.q.GetFirstListenFromTrack(ctx, track.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("GetAlbum: GetFirstListenFromRelease: %w", err)
|
||||
}
|
||||
|
||||
track.ListenCount = count
|
||||
track.TimeListened = seconds
|
||||
track.FirstListen = firstListen.ListenedAt.Unix()
|
||||
|
||||
return &track, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue