Skip to content

Commit

Permalink
storage/mariadb: update lastplayed subquery to use hash_link
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed May 25, 2024
1 parent 4393c55 commit d1f4006
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/mariadb/track.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const maybeSongColumns = `
`

const lastplayedSelect = `
IFNULL((SELECT dt FROM eplay WHERE eplay.isong = esong.id ORDER BY dt DESC LIMIT 1), TIMESTAMP('0000-00-00 00:00:00')) AS lastplayed
IFNULL((SELECT dt FROM eplay JOIN esong AS esong2 ON esong2.id = eplay.isong WHERE esong2.hash_link=esong.hash_link ORDER BY dt DESC LIMIT 1), TIMESTAMP('0000-00-00 00:00:00')) AS lastplayed
`

// SongStorage implements radio.SongStorage
Expand Down

0 comments on commit d1f4006

Please sign in to comment.