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
[api] fix album uri issue
tsiry-sandratraina.com
10 months ago
98ed4e2f
2e525749
+28
-3
2 changed files
expand all
collapse all
unified
split
rockskyapi
rocksky-auth
src
nowplaying
nowplaying.service.ts
rockskyweb
src
components
Handle
NowPlaying
NowPlaying.tsx
+26
-1
rockskyapi/rocksky-auth/src/nowplaying/nowplaying.service.ts
···
482
482
)
483
483
)
484
484
.getFirst();
485
485
-
while (!existingTrack?.artist_uri && tries < 30) {
485
485
+
486
486
+
while (
487
487
+
!existingTrack?.artist_uri &&
488
488
+
!existingTrack?.album_uri &&
489
489
+
tries < 30
490
490
+
) {
486
491
console.log(
487
492
`Artist uri not ready, trying again: ${chalk.magenta(tries + 1)}`
488
493
);
···
518
523
}
519
524
}
520
525
// end update artist uri
526
526
+
527
527
+
// start update album uri if it is not set
528
528
+
if (existingTrack && !existingTrack.album_uri) {
529
529
+
const album = await ctx.client.db.albums
530
530
+
.filter(
531
531
+
"sha256",
532
532
+
equals(
533
533
+
createHash("sha256")
534
534
+
.update(`${track.album} - ${track.albumArtist}`.toLowerCase())
535
535
+
.digest("hex")
536
536
+
)
537
537
+
)
538
538
+
.getFirst();
539
539
+
if (album) {
540
540
+
await ctx.client.db.tracks.update(existingTrack.xata_id, {
541
541
+
album_uri: album.uri,
542
542
+
});
543
543
+
}
544
544
+
}
545
545
+
// end update album uri
521
546
522
547
await new Promise((resolve) => setTimeout(resolve, 1000));
523
548
tries += 1;
+2
-2
rockskyweb/src/components/Handle/NowPlaying/NowPlaying.tsx
···
214
214
{!!nowPlaying[did]?.artistUri?.split("at://")[1] && (
215
215
<Link
216
216
to={`/${nowPlaying[did]?.artistUri?.split("at://")[1]}`}
217
217
-
className="font-rockford-light text-[rgba(36, 49, 61, 0.65)] font-semibold truncate whitespace-nowrap text-sm"
217
217
+
className="text-[rgba(36, 49, 61, 0.65)] font-semibold truncate whitespace-nowrap text-sm"
218
218
style={{ color: "rgba(36, 49, 61, 0.65)" }}
219
219
>
220
220
{nowPlaying[did]?.artist}
···
222
222
)}
223
223
{!nowPlaying[did]?.artistUri?.split("at://")[1] && (
224
224
<div
225
225
-
className="font-rockford-light text-[rgba(36, 49, 61, 0.65)] font-semibold truncate whitespace-nowrap text-sm"
225
225
+
className="text-[rgba(36, 49, 61, 0.65)] font-semibold truncate whitespace-nowrap text-sm"
226
226
style={{
227
227
color: "rgba(36, 49, 61, 0.65)",
228
228
}}