mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
Fix: Songs weren't added to db
This commit is contained in:
@@ -12,10 +12,6 @@ async function LogSpotifyHistory(): Promise<void> {
|
||||
|
||||
if (current.progress && current.progress < 5000) return
|
||||
|
||||
const last_entry = await Song.query().where('item_id', current.id!).orderBy('date', 'desc').first()
|
||||
|
||||
if (last_entry && new Date().getTime() - last_entry.duration <= new Date(last_entry.date).getTime()) return
|
||||
|
||||
await Song.create({
|
||||
date: new Date(current.started_at!),
|
||||
duration: current.duration,
|
||||
|
||||
Reference in New Issue
Block a user