Fix: Songs weren't added to db

This commit is contained in:
2022-04-14 22:52:02 +02:00
parent a749f479da
commit 64474dd44d

View File

@@ -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,