tangled
alpha
login
or
join now
t1c.dev
/
rocksky
forked from
rocksky.app/rocksky
2
fork
atom
A decentralized music tracking and discovery platform built on AT Protocol 🎵
2
fork
atom
overview
issues
pulls
pipelines
Use xata_id for scrobble deduplication in feed
tsiry-sandratraina.com
2 months ago
e3ef8d6f
e7d8ec98
+3
-3
1 changed file
expand all
collapse all
unified
split
apps
api
src
xrpc
app
rocksky
feed
getNowPlayings.ts
+3
-3
apps/api/src/xrpc/app/rocksky/feed/getNowPlayings.ts
···
78
78
.leftJoin(tracks, eq(scrobbles.trackId, tracks.id))
79
79
.leftJoin(users, eq(scrobbles.userId, users.id))
80
80
.where(
81
81
-
sql`scrobbles.id IN (
82
82
-
SELECT DISTINCT ON (inner_s.user_id) inner_s.id
81
81
+
sql`scrobbles.xata_id IN (
82
82
+
SELECT DISTINCT ON (inner_s.user_id) inner_s.xata_id
83
83
FROM scrobbles inner_s
84
84
-
ORDER BY inner_s.user_id, inner_s.timestamp DESC, inner_s.id DESC
84
84
+
ORDER BY inner_s.user_id, inner_s.timestamp DESC, inner_s.xata_id DESC
85
85
)`,
86
86
)
87
87
.orderBy(desc(scrobbles.timestamp))