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.

Add playlistItem and pictureUrl to playlist

Remove tracks array from playlist schema and update types, PKL, and
lexicon files accordingly

+91 -26
+4 -7
apps/api/lexicons/playlist/playlist.json
··· 34 34 ], 35 35 "maxSize": 2000000 36 36 }, 37 - "tracks": { 38 - "type": "array", 39 - "description": "The tracks in the playlist.", 40 - "items": { 41 - "type": "ref", 42 - "ref": "app.rocksky.song#record" 43 - } 37 + "pictureUrl": { 38 + "type": "string", 39 + "description": "The URL of the picture of the artist.", 40 + "format": "uri" 44 41 }, 45 42 "createdAt": { 46 43 "type": "string",
+39
apps/api/lexicons/playlist/playlistItem.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.rocksky.playlistItem", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A playlist item represents a single entry in a playlist, containing metadata and references to media content.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "name", 13 + "createdAt", 14 + "track" 15 + ], 16 + "properties": { 17 + "subject": { 18 + "type": "ref", 19 + "ref": "com.atproto.repo.strongRef" 20 + }, 21 + "createdAt": { 22 + "type": "string", 23 + "description": "The date the playlist was created.", 24 + "format": "datetime" 25 + }, 26 + "track": { 27 + "type": "ref", 28 + "ref": "app.rocksky.song.defs#songViewBasic" 29 + }, 30 + "order": { 31 + "type": "integer", 32 + "description": "The order of the item in the playlist.", 33 + "minimum": 0 34 + } 35 + } 36 + } 37 + } 38 + } 39 + }
+6 -9
apps/api/pkl/defs/playlist/playlist.pkl
··· 1 - amends "../../schema/lexicon.pkl" 1 + amends "../../schema/lexicon.pkl" 2 2 3 3 lexicon = 1 4 4 id = "app.rocksky.playlist" ··· 29 29 accept = List("image/png", "image/jpeg") 30 30 maxSize = 2000000 31 31 } 32 - ["tracks"] = new Array { 33 - type = "array" 34 - description = "The tracks in the playlist." 35 - items = new Ref { 36 - type = "ref" 37 - ref = "app.rocksky.song#record" 38 - } 32 + ["pictureUrl"] = new StringType { 33 + type = "string" 34 + description = "The URL of the picture of the artist." 35 + format = "uri" 39 36 } 40 37 ["createdAt"] = new StringType { 41 38 type = "string" ··· 61 58 } 62 59 } 63 60 } 64 - } 61 + }
+36
apps/api/pkl/defs/playlist/playlistItem.pkl
··· 1 + amends "../../schema/lexicon.pkl" 2 + 3 + lexicon = 1 4 + id = "app.rocksky.playlistItem" 5 + defs = new Mapping<String, Record> { 6 + ["main"] { 7 + type = "record" 8 + description = 9 + "A playlist item represents a single entry in a playlist, containing metadata and references to media content." 10 + key = "tid" 11 + `record` { 12 + type = "object" 13 + required = List("name", "createdAt", "track") 14 + properties { 15 + ["subject"] = new Ref { 16 + type = "ref" 17 + ref = "com.atproto.repo.strongRef" 18 + } 19 + ["createdAt"] = new StringType { 20 + type = "string" 21 + description = "The date the playlist was created." 22 + format = "datetime" 23 + } 24 + ["track"] = new Ref { 25 + type = "ref" 26 + ref = "app.rocksky.song.defs#songViewBasic" 27 + } 28 + ["order"] = new IntegerType { 29 + type = "integer" 30 + description = "The order of the item in the playlist." 31 + minimum = 0 32 + } 33 + } 34 + } 35 + } 36 + }
+4 -7
apps/api/src/lexicon/lexicons.ts
··· 4056 4056 accept: ["image/png", "image/jpeg"], 4057 4057 maxSize: 2000000, 4058 4058 }, 4059 - tracks: { 4060 - type: "array", 4061 - description: "The tracks in the playlist.", 4062 - items: { 4063 - type: "ref", 4064 - ref: "lex:app.rocksky.song#record", 4065 - }, 4059 + pictureUrl: { 4060 + type: "string", 4061 + description: "The URL of the picture of the artist.", 4062 + format: "uri", 4066 4063 }, 4067 4064 createdAt: { 4068 4065 type: "string",
+2 -3
apps/api/src/lexicon/types/app/rocksky/playlist.ts
··· 5 5 import { lexicons } from "../../../lexicons"; 6 6 import { isObj, hasProp } from "../../../util"; 7 7 import { CID } from "multiformats/cid"; 8 - import type * as AppRockskySong from "./song"; 9 8 10 9 export interface Record { 11 10 /** The name of the playlist. */ ··· 14 13 description?: string; 15 14 /** The picture of the playlist. */ 16 15 picture?: BlobRef; 17 - /** The tracks in the playlist. */ 18 - tracks?: AppRockskySong.Record[]; 16 + /** The URL of the picture of the artist. */ 17 + pictureUrl?: string; 19 18 /** The date the playlist was created. */ 20 19 createdAt: string; 21 20 /** The Spotify link of the playlist. */