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

fix: improve error handling in artist, album, and song record functions

+3 -4
+3 -4
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"; 13 12 import { createHash } from "node:crypto"; 14 13 import type { Track } from "types/track"; 15 14 import albumTracks from "../schema/album-tracks"; ··· 40 39 name: track.albumArtist, 41 40 createdAt: new Date().toISOString(), 42 41 pictureUrl: track.artistPicture, 43 - tags: _.get(track, "genres", []), 42 + tags: [], 44 43 }; 45 44 46 45 if (!Artist.validateRecord(record).success) { ··· 134 133 : undefined, 135 134 createdAt: new Date().toISOString(), 136 135 spotifyLink: track.spotifyLink ? track.spotifyLink : undefined, 137 - tags: _.get(track, "genres", []), 136 + tags: [], 138 137 }; 139 138 140 139 if (!Song.validateRecord(record).success) { ··· 190 189 ? dayjs.unix(track.timestamp).toISOString() 191 190 : new Date().toISOString(), 192 191 spotifyLink: track.spotifyLink ? track.spotifyLink : undefined, 193 - tags: _.get(track, "genres", []), 192 + tags: [], 194 193 }; 195 194 196 195 if (!Scrobble.validateRecord(record).success) {