Add optional tags array to artist lexicon, pkl and TypeScript defs. Populate tags by querying artists.genres from the DB and merging them into the analytics response in getActorArtists.
···35 "type": "integer",
36 "description": "The number of unique listeners who have played the artist.",
37 "minimum": 0
00000038 }
39 }
40 },
···71 "type": "integer",
72 "description": "The number of unique listeners who have played the artist.",
73 "minimum": 0
00000074 }
75 }
76 },
···35 "type": "integer",
36 "description": "The number of unique listeners who have played the artist.",
37 "minimum": 0
38+ },
39+ "tags": {
40+ "type": "array",
41+ "items": {
42+ "type": "string"
43+ }
44 }
45 }
46 },
···77 "type": "integer",
78 "description": "The number of unique listeners who have played the artist.",
79 "minimum": 0
80+ },
81+ "tags": {
82+ "type": "array",
83+ "items": {
84+ "type": "string"
85+ }
86 }
87 }
88 },
+13-3
apps/api/pkl/defs/artist/defs.pkl
···1-amends "../../schema/lexicon.pkl"
23lexicon = 1
4id = "app.rocksky.artist.defs"
···44 minimum = 0
45 }
4600000047 }
48 }
49···88 minimum = 0
89 }
9000000091 }
92 }
93···110 description = "The number of times the song has been played."
111 minimum = 0
112 }
113-114 }
115 }
116···158 description = "The rank of the listener among all listeners of the artist."
159 minimum = 1
160 }
161-162 }
163 }
164
···1+amends "../../schema/lexicon.pkl"
23lexicon = 1
4id = "app.rocksky.artist.defs"
···44 minimum = 0
45 }
4647+ ["tags"] = new Array {
48+ type = "array"
49+ items = new StringType {
50+ type = "string"
51+ }
52+ }
53 }
54 }
55···94 minimum = 0
95 }
9697+ ["tags"] = new Array {
98+ type = "array"
99+ items = new StringType {
100+ type = "string"
101+ }
102+ }
103 }
104 }
105···122 description = "The number of times the song has been played."
123 minimum = 0
124 }
0125 }
126 }
127···169 description = "The rank of the listener among all listeners of the artist."
170 minimum = 1
171 }
0172 }
173 }
174
+12
apps/api/src/lexicon/lexicons.ts
···1835 "The number of unique listeners who have played the artist.",
1836 minimum: 0,
1837 },
0000001838 },
1839 },
1840 artistViewDetailed: {
···1871 description:
1872 "The number of unique listeners who have played the artist.",
1873 minimum: 0,
0000001874 },
1875 },
1876 },
···1835 "The number of unique listeners who have played the artist.",
1836 minimum: 0,
1837 },
1838+ tags: {
1839+ type: "array",
1840+ items: {
1841+ type: "string",
1842+ },
1843+ },
1844 },
1845 },
1846 artistViewDetailed: {
···1877 description:
1878 "The number of unique listeners who have played the artist.",
1879 minimum: 0,
1880+ },
1881+ tags: {
1882+ type: "array",
1883+ items: {
1884+ type: "string",
1885+ },
1886 },
1887 },
1888 },
···21 playCount?: number;
22 /** The number of unique listeners who have played the artist. */
23 uniqueListeners?: number;
024 [k: string]: unknown;
25}
26···51 playCount?: number;
52 /** The number of unique listeners who have played the artist. */
53 uniqueListeners?: number;
054 [k: string]: unknown;
55}
56
···21 playCount?: number;
22 /** The number of unique listeners who have played the artist. */
23 uniqueListeners?: number;
24+ tags?: string[];
25 [k: string]: unknown;
26}
27···52 playCount?: number;
53 /** The number of unique listeners who have played the artist. */
54 uniqueListeners?: number;
55+ tags?: string[];
56 [k: string]: unknown;
57}
58
···10import type { SelectScrobble } from "schema/scrobbles";
11import type { SelectTrack } from "schema/tracks";
12import type { SelectUser } from "schema/users";
13-import { SelectArtist } from "schema/artists";
1415export default function (server: Server, ctx: Context) {
16 const getScrobbles = (params: QueryParams) =>
···10import type { SelectScrobble } from "schema/scrobbles";
11import type { SelectTrack } from "schema/tracks";
12import type { SelectUser } from "schema/users";
13+import type { SelectArtist } from "schema/artists";
1415export default function (server: Server, ctx: Context) {
16 const getScrobbles = (params: QueryParams) =>