A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
98
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: replace direct genre access with lodash get for safer handling in artist, album, and scrobble records

+4 -3
+4 -3
apps/api/src/nowplaying/nowplaying.service.ts
··· 9 9 import * as Scrobble from "lexicon/types/app/rocksky/scrobble"; 10 10 import * as Song from "lexicon/types/app/rocksky/song"; 11 11 import { deepSnakeCaseKeys } from "lib"; 12 + import _ from "lodash"; 12 13 import { createHash } from "node:crypto"; 13 14 import type { Track } from "types/track"; 14 15 import albumTracks from "../schema/album-tracks"; ··· 39 40 name: track.albumArtist, 40 41 createdAt: new Date().toISOString(), 41 42 pictureUrl: track.artistPicture, 42 - tags: track.genres, 43 + tags: _.get(track, "genres", []), 43 44 }; 44 45 45 46 if (!Artist.validateRecord(record).success) { ··· 131 132 : undefined, 132 133 createdAt: new Date().toISOString(), 133 134 spotifyLink: track.spotifyLink ? track.spotifyLink : undefined, 134 - tags: track.genres, 135 + tags: _.get(track, "genres", []), 135 136 }; 136 137 137 138 if (!Song.validateRecord(record).success) { ··· 186 187 ? dayjs.unix(track.timestamp).toISOString() 187 188 : new Date().toISOString(), 188 189 spotifyLink: track.spotifyLink ? track.spotifyLink : undefined, 189 - tags: track.genres, 190 + tags: _.get(track, "genres", []), 190 191 }; 191 192 192 193 if (!Scrobble.validateRecord(record).success) {