···74 }
75 }
76 },
77+ "songViewBasic": {
78+ "type": "object",
79+ "properties": {
80+ "uri": {
81+ "type": "string",
82+ "description": "The URI of the song.",
83+ "format": "at-uri"
84+ },
85+ "title": {
86+ "type": "string",
87+ "description": "The title of the song."
88+ },
89+ "playCount": {
90+ "type": "integer",
91+ "description": "The number of times the song has been played.",
92+ "minimum": 0
93+ }
94+ }
95+ },
96 "listenerViewBasic": {
97 "type": "object",
98 "properties": {
···119 },
120 "mostListenedSong": {
121 "type": "ref",
122+ "ref": "app.rocksky.artist.defs#songViewBasic"
123+ },
124+ "totalPlays": {
125+ "type": "integer",
126+ "description": "The total number of plays by the listener.",
127+ "minimum": 0
128+ },
129+ "rank": {
130+ "type": "integer",
131+ "description": "The rank of the listener among all listeners of the artist.",
132+ "minimum": 1
133 }
134 }
135 }
···91 }
92 }
9394+ ["songViewBasic"] {
95+ type = "object"
96+ properties {
97+ ["uri"] = new StringType {
98+ type = "string"
99+ format = "at-uri"
100+ description = "The URI of the song."
101+ }
102+103+ ["title"] = new StringType {
104+ type = "string"
105+ description = "The title of the song."
106+ }
107+108+ ["playCount"] = new IntegerType {
109+ type = "integer"
110+ description = "The number of times the song has been played."
111+ minimum = 0
112+ }
113+114+ }
115+ }
116+117 ["listenerViewBasic"] {
118 type = "object"
119 properties {
···144 }
145146 ["mostListenedSong"] = new Ref {
147+ ref = "app.rocksky.artist.defs#songViewBasic"
148+ }
149+150+ ["totalPlays"] = new IntegerType {
151+ type = "integer"
152+ description = "The total number of plays by the listener."
153+ minimum = 0
154+ }
155+156+ ["rank"] = new IntegerType {
157+ type = "integer"
158+ description = "The rank of the listener among all listeners of the artist."
159+ minimum = 1
160 }
161162 }
···1066 },
1067 },
1068 },
1069+ songViewBasic: {
1070+ type: 'object',
1071+ properties: {
1072+ uri: {
1073+ type: 'string',
1074+ description: 'The URI of the song.',
1075+ format: 'at-uri',
1076+ },
1077+ title: {
1078+ type: 'string',
1079+ description: 'The title of the song.',
1080+ },
1081+ playCount: {
1082+ type: 'integer',
1083+ description: 'The number of times the song has been played.',
1084+ minimum: 0,
1085+ },
1086+ },
1087+ },
1088 listenerViewBasic: {
1089 type: 'object',
1090 properties: {
···1111 },
1112 mostListenedSong: {
1113 type: 'ref',
1114+ ref: 'lex:app.rocksky.artist.defs#songViewBasic',
1115+ },
1116+ totalPlays: {
1117+ type: 'integer',
1118+ description: 'The total number of plays by the listener.',
1119+ minimum: 0,
1120+ },
1121+ rank: {
1122+ type: 'integer',
1123+ description:
1124+ 'The rank of the listener among all listeners of the artist.',
1125+ minimum: 1,
1126 },
1127 },
1128 },
···5import { lexicons } from '../../../../lexicons'
6import { isObj, hasProp } from '../../../../util'
7import { CID } from 'multiformats/cid'
8-import type * as AppRockskySongDefs from '../song/defs'
910export interface ArtistViewBasic {
11 /** The unique identifier of the artist. */
···67 return lexicons.validate('app.rocksky.artist.defs#artistViewDetailed', v)
68}
69000000000000000000000070export interface ListenerViewBasic {
71 /** The unique identifier of the actor. */
72 id?: string
···78 displayName?: string
79 /** The URL of the listener's avatar image. */
80 avatar?: string
81- mostListenedSong?: AppRockskySongDefs.SongViewBasic
000082 [k: string]: unknown
83}
84
···5import { lexicons } from '../../../../lexicons'
6import { isObj, hasProp } from '../../../../util'
7import { CID } from 'multiformats/cid'
089export interface ArtistViewBasic {
10 /** The unique identifier of the artist. */
···66 return lexicons.validate('app.rocksky.artist.defs#artistViewDetailed', v)
67}
6869+export interface SongViewBasic {
70+ /** The URI of the song. */
71+ uri?: string
72+ /** The title of the song. */
73+ title?: string
74+ /** The number of times the song has been played. */
75+ playCount?: number
76+ [k: string]: unknown
77+}
78+79+export function isSongViewBasic(v: unknown): v is SongViewBasic {
80+ return (
81+ isObj(v) &&
82+ hasProp(v, '$type') &&
83+ v.$type === 'app.rocksky.artist.defs#songViewBasic'
84+ )
85+}
86+87+export function validateSongViewBasic(v: unknown): ValidationResult {
88+ return lexicons.validate('app.rocksky.artist.defs#songViewBasic', v)
89+}
90+91export interface ListenerViewBasic {
92 /** The unique identifier of the actor. */
93 id?: string
···99 displayName?: string
100 /** The URL of the listener's avatar image. */
101 avatar?: string
102+ mostListenedSong?: SongViewBasic
103+ /** The total number of plays by the listener. */
104+ totalPlays?: number
105+ /** The rank of the listener among all listeners of the artist. */
106+ rank?: number
107 [k: string]: unknown
108}
109