@behindthemusictree/app-kit 33.3.0 → 34.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-HHE6VK67.js → chunk-QZXZHP4R.js} +538 -330
- package/dist/chunk-QZXZHP4R.js.map +1 -0
- package/dist/genre-tree/index.cjs +652 -426
- package/dist/genre-tree/index.cjs.map +1 -1
- package/dist/genre-tree/index.d.ts +1356 -223
- package/dist/genre-tree/index.js +33 -1
- package/dist/index.cjs +597 -371
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -1
- package/package.json +1 -1
- package/dist/chunk-HHE6VK67.js.map +0 -1
|
@@ -24,51 +24,152 @@ import {
|
|
|
24
24
|
} from "./chunk-JMFEWI53.js";
|
|
25
25
|
|
|
26
26
|
// src/genre-tree/useGenre.ts
|
|
27
|
-
import { z as
|
|
28
|
-
import { useQuery, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
29
|
-
import { useCallback } from "react";
|
|
27
|
+
import { z as z19 } from "zod";
|
|
30
28
|
|
|
31
|
-
// src/genre-tree/
|
|
32
|
-
import { z as
|
|
33
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
29
|
+
// src/genre-tree/schemas/criteria/detailed.ts
|
|
30
|
+
import { z as z10 } from "zod";
|
|
34
31
|
|
|
35
|
-
// src/genre-tree/schemas/
|
|
36
|
-
import { z as
|
|
32
|
+
// src/genre-tree/schemas/genre-music.ts
|
|
33
|
+
import { z as z2 } from "zod";
|
|
37
34
|
|
|
38
|
-
// src/genre-tree/schemas/criteria-playlist/
|
|
39
|
-
import { z
|
|
35
|
+
// src/genre-tree/schemas/criteria-playlist/minimum.ts
|
|
36
|
+
import { z } from "zod";
|
|
37
|
+
var CriteriaPlaylistMinimumSchema = z.object({
|
|
38
|
+
uuid: GenrePlaylistUuidSchema,
|
|
39
|
+
name: z.string()
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// src/genre-tree/schemas/genre-music.ts
|
|
43
|
+
var CountSchema = z2.number().int().nonnegative();
|
|
44
|
+
var SubgenreCountsSchema = z2.union([
|
|
45
|
+
z2.object({ canonical: CountSchema, regional: CountSchema, all: CountSchema }).strict(),
|
|
46
|
+
z2.object({ all: CountSchema }).strict()
|
|
47
|
+
]).refine(
|
|
48
|
+
(counts) => !("canonical" in counts) || counts.all >= counts.canonical && counts.all >= counts.regional,
|
|
49
|
+
"The combined count must include both scoped selections"
|
|
50
|
+
);
|
|
51
|
+
var GenreCountsSchema = z2.object({
|
|
52
|
+
genreOnlyTracksCount: CountSchema,
|
|
53
|
+
genreAndSubgenresTracksCount: SubgenreCountsSchema
|
|
54
|
+
});
|
|
55
|
+
var includesDirectSongs = (counts) => Object.values(counts.genreAndSubgenresTracksCount).every((count) => count >= counts.genreOnlyTracksCount);
|
|
56
|
+
var GenreCatalogueCountsSchema = GenreCountsSchema.refine(includesDirectSongs, "Every inclusive count must include the genre itself").brand();
|
|
57
|
+
var GenrePlaylistSummarySchema = CriteriaPlaylistMinimumSchema.extend(GenreCountsSchema.shape).refine(includesDirectSongs, "Every inclusive count must include the genre itself").brand();
|
|
58
|
+
var GenreCoverageSchema = z2.enum(["genreOnly", "genreAndSubgenres"]);
|
|
59
|
+
var SubgenreScopeSchema = z2.enum(["canonical", "regional", "all"]);
|
|
40
60
|
|
|
41
61
|
// src/genre-tree/schemas/criteria/minimum.ts
|
|
42
|
-
import { z } from "zod";
|
|
43
|
-
var CriteriaMinimumSchema =
|
|
62
|
+
import { z as z3 } from "zod";
|
|
63
|
+
var CriteriaMinimumSchema = z3.object({
|
|
44
64
|
uuid: GenreUuidSchema,
|
|
45
|
-
name:
|
|
46
|
-
side:
|
|
47
|
-
wikidataId:
|
|
65
|
+
name: z3.string(),
|
|
66
|
+
side: z3.enum(["core", "pop"]).nullable().optional(),
|
|
67
|
+
wikidataId: z3.string().nullable().optional()
|
|
48
68
|
});
|
|
49
69
|
|
|
50
|
-
// src/genre-tree/schemas/
|
|
51
|
-
import { z as
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
70
|
+
// src/genre-tree/schemas/track/base.ts
|
|
71
|
+
import { z as z7 } from "zod";
|
|
72
|
+
|
|
73
|
+
// src/genre-tree/schemas/artist-minimum.ts
|
|
74
|
+
import { z as z4 } from "zod";
|
|
75
|
+
var ArtistMinimumSchema = z4.object({
|
|
76
|
+
uuid: z4.string().uuid(),
|
|
77
|
+
name: z4.string(),
|
|
78
|
+
isSpecialPurpose: z4.boolean().optional()
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// src/genre-tree/schemas/album-minimum.ts
|
|
82
|
+
import { z as z5 } from "zod";
|
|
83
|
+
var AlbumMinimumSchema = z5.object({
|
|
84
|
+
uuid: z5.string().uuid(),
|
|
85
|
+
name: z5.string(),
|
|
86
|
+
albumArtists: z5.array(ArtistMinimumSchema).nullable().optional()
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// src/genre-tree/schemas/uuid-resource.ts
|
|
90
|
+
import { z as z6 } from "zod";
|
|
91
|
+
var UuidResourceSchema = z6.object({
|
|
92
|
+
uuid: z6.string().uuid()
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// src/genre-tree/schemas/track/base.ts
|
|
96
|
+
var TrackBaseSchema = UuidResourceSchema.extend({
|
|
97
|
+
title: z7.string(),
|
|
98
|
+
artists: z7.array(ArtistMinimumSchema).nullable().optional(),
|
|
99
|
+
album: AlbumMinimumSchema.nullable().optional(),
|
|
100
|
+
trackNumber: z7.number().nullable().optional(),
|
|
101
|
+
// null for a song not yet linked to a genre.
|
|
102
|
+
genre: CriteriaMinimumSchema.nullable(),
|
|
103
|
+
rating: z7.number().min(0).max(10).nullable().optional(),
|
|
104
|
+
language: z7.string().nullable().optional(),
|
|
105
|
+
playCount: z7.number().min(0),
|
|
106
|
+
createdOn: z7.string().datetime(),
|
|
107
|
+
updatedOn: z7.string().datetime().nullable().optional()
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// src/genre-tree/schemas/track/minimum.ts
|
|
111
|
+
var TrackMinimumSchema = TrackBaseSchema.pick({
|
|
112
|
+
uuid: true,
|
|
113
|
+
title: true,
|
|
114
|
+
artists: true
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// src/genre-tree/schemas/criteria/lineage-rel/without-ascendant.ts
|
|
118
|
+
import { z as z8 } from "zod";
|
|
119
|
+
var CriteriaLineageRelWithoutAscendantSchema = z8.object({
|
|
120
|
+
descendant: CriteriaMinimumSchema,
|
|
121
|
+
degree: z8.number()
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// src/genre-tree/schemas/criteria/lineage-rel/without-descendant.ts
|
|
125
|
+
import { z as z9 } from "zod";
|
|
126
|
+
var CriteriaLineageRelWithoutDescendantSchema = z9.object({
|
|
127
|
+
ascendant: CriteriaMinimumSchema,
|
|
128
|
+
degree: z9.number()
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// src/genre-tree/schemas/criteria/detailed.ts
|
|
132
|
+
var CriteriaDetailedSchema = z10.object({
|
|
133
|
+
uuid: GenreUuidSchema,
|
|
134
|
+
name: z10.string(),
|
|
135
|
+
summary: z10.string().nullable(),
|
|
136
|
+
// Optional until every deployed API serves it.
|
|
137
|
+
wikidataId: z10.string().nullable().optional(),
|
|
138
|
+
parent: CriteriaMinimumSchema.nullable(),
|
|
139
|
+
ascendants: z10.array(CriteriaLineageRelWithoutDescendantSchema),
|
|
140
|
+
descendants: z10.array(CriteriaLineageRelWithoutAscendantSchema),
|
|
141
|
+
root: CriteriaMinimumSchema,
|
|
142
|
+
children: z10.array(CriteriaMinimumSchema),
|
|
143
|
+
catalogue: GenreCatalogueCountsSchema.optional(),
|
|
144
|
+
criteriaPlaylist: z10.union([GenrePlaylistSummarySchema, CriteriaPlaylistMinimumSchema]),
|
|
145
|
+
tracks: z10.array(TrackMinimumSchema),
|
|
146
|
+
essentialSongs: z10.array(TrackMinimumSchema),
|
|
147
|
+
tracksCount: z10.number(),
|
|
148
|
+
updatedOn: z10.string().datetime().nullable()
|
|
55
149
|
});
|
|
56
150
|
|
|
151
|
+
// src/genre-tree/schemas/criteria-playlist/simple.ts
|
|
152
|
+
import { z as z12 } from "zod";
|
|
153
|
+
|
|
57
154
|
// src/genre-tree/schemas/criteria-playlist/detailed.ts
|
|
58
|
-
|
|
155
|
+
import { z as z11 } from "zod";
|
|
156
|
+
var CriteriaPlaylistDetailedSchema = z11.object({
|
|
59
157
|
uuid: GenrePlaylistUuidSchema,
|
|
60
|
-
name:
|
|
61
|
-
tracksCount:
|
|
158
|
+
name: z11.string(),
|
|
159
|
+
tracksCount: z11.number(),
|
|
160
|
+
genreOnlyTracksCount: GenreCountsSchema.shape.genreOnlyTracksCount.optional(),
|
|
161
|
+
genreAndSubgenresTracksCount: GenreCountsSchema.shape.genreAndSubgenresTracksCount.optional(),
|
|
162
|
+
catalogue: GenreCatalogueCountsSchema.optional(),
|
|
62
163
|
// Summed YouTube views of the same songs as `tracksCount`. Optional: hear-api has no view counts.
|
|
63
|
-
viewsCount:
|
|
64
|
-
durationInSec:
|
|
65
|
-
durationStrInHourMinSec:
|
|
164
|
+
viewsCount: z11.number().optional(),
|
|
165
|
+
durationInSec: z11.number().min(0).nullable().optional(),
|
|
166
|
+
durationStrInHourMinSec: z11.string().nullable().optional(),
|
|
66
167
|
// Nullable: the "Genreless" root playlist has no criteria attached and is never updated.
|
|
67
168
|
criteria: CriteriaMinimumSchema.nullable(),
|
|
68
169
|
parent: CriteriaPlaylistMinimumSchema.nullable(),
|
|
69
170
|
root: CriteriaPlaylistMinimumSchema,
|
|
70
|
-
createdOn:
|
|
71
|
-
updatedOn:
|
|
171
|
+
createdOn: z11.string(),
|
|
172
|
+
updatedOn: z11.string().nullable()
|
|
72
173
|
});
|
|
73
174
|
|
|
74
175
|
// src/genre-tree/schemas/criteria-playlist/simple.ts
|
|
@@ -79,18 +180,42 @@ var CriteriaPlaylistSimpleSchema = CriteriaPlaylistDetailedSchema.pick({
|
|
|
79
180
|
parent: true,
|
|
80
181
|
root: true,
|
|
81
182
|
tracksCount: true,
|
|
183
|
+
genreOnlyTracksCount: true,
|
|
184
|
+
genreAndSubgenresTracksCount: true,
|
|
185
|
+
catalogue: true,
|
|
82
186
|
viewsCount: true,
|
|
83
187
|
createdOn: true,
|
|
84
188
|
updatedOn: true
|
|
85
189
|
}).extend({
|
|
86
190
|
// Only on the tree/list payloads, not the detail endpoint — hence not on the detailed schema.
|
|
87
|
-
isUnacceptedRoot:
|
|
191
|
+
isUnacceptedRoot: z12.boolean(),
|
|
88
192
|
// Optional: a backend that does not curate umbrella genres omits it.
|
|
89
|
-
isUmbrella:
|
|
193
|
+
isUmbrella: z12.boolean().optional(),
|
|
90
194
|
// Optional: only the grow tree payload carries it; null when the genre has no scene.
|
|
91
|
-
scene:
|
|
195
|
+
scene: z12.enum(["commercial", "underground"]).nullable().optional()
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// src/genre-tree/schemas/reference-genre.ts
|
|
199
|
+
var ReferenceGenreDetailedSchema = CriteriaDetailedSchema.extend({
|
|
200
|
+
catalogue: GenreCatalogueCountsSchema,
|
|
201
|
+
criteriaPlaylist: GenrePlaylistSummarySchema
|
|
202
|
+
});
|
|
203
|
+
var ReferenceGenrePlaylistSchema = CriteriaPlaylistSimpleSchema.extend({
|
|
204
|
+
...GenreCountsSchema.shape,
|
|
205
|
+
catalogue: GenreCatalogueCountsSchema
|
|
206
|
+
}).superRefine((playlist, ctx) => {
|
|
207
|
+
const counts = GenreCatalogueCountsSchema.safeParse(playlist);
|
|
208
|
+
if (!counts.success) for (const issue of counts.error.issues) ctx.addIssue({ code: "custom", path: issue.path, message: issue.message });
|
|
92
209
|
});
|
|
93
210
|
|
|
211
|
+
// src/genre-tree/useGenre.ts
|
|
212
|
+
import { useQuery, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
213
|
+
import { useCallback } from "react";
|
|
214
|
+
|
|
215
|
+
// src/genre-tree/useGenrePlaylist.ts
|
|
216
|
+
import { z as z13 } from "zod";
|
|
217
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
218
|
+
|
|
94
219
|
// src/genre-tree/api/genre-playlists/queryKeys.ts
|
|
95
220
|
var genrePlaylistQueryKeys = {
|
|
96
221
|
me: {
|
|
@@ -126,6 +251,30 @@ var genrePlaylistEndpoints = {
|
|
|
126
251
|
reference: { ...makeGenrePlaylistEndpoints(""), tree: () => "genre-playlists/tree/" }
|
|
127
252
|
};
|
|
128
253
|
|
|
254
|
+
// src/genre-tree/lib/genre-music-selection.ts
|
|
255
|
+
function defaultGenreMusicSelection(counts) {
|
|
256
|
+
return { coverage: "genreAndSubgenres", subgenres: "canonical" in counts.genreAndSubgenresTracksCount ? "canonical" : "all" };
|
|
257
|
+
}
|
|
258
|
+
function genreMusicCount(counts, selection = defaultGenreMusicSelection(counts)) {
|
|
259
|
+
if (selection.coverage === "genreOnly") return counts.genreOnlyTracksCount;
|
|
260
|
+
const scopes = counts.genreAndSubgenresTracksCount;
|
|
261
|
+
if (selection.subgenres === "all") return scopes.all;
|
|
262
|
+
if (!("canonical" in scopes)) throw new Error("Regional genres only support all subgenres");
|
|
263
|
+
return scopes[selection.subgenres];
|
|
264
|
+
}
|
|
265
|
+
function genreMusicQueryParams(selection) {
|
|
266
|
+
if (!selection) return {};
|
|
267
|
+
return selection.coverage === "genreOnly" ? { coverage: "genre_only" } : { coverage: "genre_and_subgenres", subgenres: selection.subgenres };
|
|
268
|
+
}
|
|
269
|
+
function genreMusicSelectionKey(selection) {
|
|
270
|
+
return selection ? [selection.coverage, ...selection.coverage === "genreAndSubgenres" ? [selection.subgenres] : []] : [];
|
|
271
|
+
}
|
|
272
|
+
function genrePlaylistTrackCount(playlist) {
|
|
273
|
+
if (playlist.genreOnlyTracksCount === void 0 && playlist.genreAndSubgenresTracksCount === void 0) return playlist.tracksCount;
|
|
274
|
+
if (playlist.genreOnlyTracksCount === void 0 || playlist.genreAndSubgenresTracksCount === void 0) throw new Error("Incomplete genre playlist counts");
|
|
275
|
+
return genreMusicCount({ genreOnlyTracksCount: playlist.genreOnlyTracksCount, genreAndSubgenresTracksCount: playlist.genreAndSubgenresTracksCount });
|
|
276
|
+
}
|
|
277
|
+
|
|
129
278
|
// src/genre-tree/api/library/songs/queryKeys.ts
|
|
130
279
|
var makeSongQueryKeys = (prefix) => ({
|
|
131
280
|
all: [`${prefix}Songs`],
|
|
@@ -134,7 +283,7 @@ var makeSongQueryKeys = (prefix) => ({
|
|
|
134
283
|
history: (uuid) => [`${prefix}Songs`, "history", uuid],
|
|
135
284
|
search: (params) => [`${prefix}Songs`, "search", params],
|
|
136
285
|
// baseUrl keeps distinct backends sharing a scope (e.g. grow and its prototype proxy) apart.
|
|
137
|
-
byGenre: (baseUrl, genreUuid) => [`${prefix}Songs`, baseUrl, "genre", genreUuid]
|
|
286
|
+
byGenre: (baseUrl, genreUuid, selection) => [`${prefix}Songs`, baseUrl, "genre", genreUuid, ...genreMusicSelectionKey(selection)]
|
|
138
287
|
});
|
|
139
288
|
|
|
140
289
|
// src/genre-tree/api/library/songs/endpoints.ts
|
|
@@ -204,7 +353,7 @@ var useListFullGenrePlaylists = (scope, getBackendBaseUrl) => {
|
|
|
204
353
|
const queryClient = useQueryClient();
|
|
205
354
|
const { fetch } = useFetchWrapper(getBackendBaseUrl);
|
|
206
355
|
const { session, sessionRestored } = useSession();
|
|
207
|
-
const queryKey = scope === "reference" ? genrePlaylistQueryKeys.reference.full(getBackendBaseUrl()) : genrePlaylistQueryKeys.me.full;
|
|
356
|
+
const queryKey = scope === "reference" ? [...genrePlaylistQueryKeys.reference.full(getBackendBaseUrl()), "genreMusicV1"] : genrePlaylistQueryKeys.me.full;
|
|
208
357
|
const query = useQueryWithParse({
|
|
209
358
|
queryKey,
|
|
210
359
|
queryFn: () => scope === "reference" ? fetch(genrePlaylistEndpoints.reference.tree(), true, false, {}, { treeName: "canonical" }) : fetchAllPages(
|
|
@@ -216,7 +365,7 @@ var useListFullGenrePlaylists = (scope, getBackendBaseUrl) => {
|
|
|
216
365
|
{ page, pageSize: FULL_LIST_PAGE_SIZE, treeName: "canonical" }
|
|
217
366
|
)
|
|
218
367
|
),
|
|
219
|
-
schema:
|
|
368
|
+
schema: scope === "reference" ? z13.array(ReferenceGenrePlaylistSchema) : z13.array(CriteriaPlaylistSimpleSchema),
|
|
220
369
|
context: "useListFullGenrePlaylists",
|
|
221
370
|
enabled: scope === "reference" || sessionRestored && !!session?.accessToken
|
|
222
371
|
});
|
|
@@ -249,131 +398,48 @@ var useInvalidateAllGenrePlaylistQueries = () => {
|
|
|
249
398
|
]);
|
|
250
399
|
};
|
|
251
400
|
|
|
252
|
-
// src/genre-tree/schemas/criteria/detailed.ts
|
|
253
|
-
import { z as z12 } from "zod";
|
|
254
|
-
|
|
255
|
-
// src/genre-tree/schemas/track/base.ts
|
|
256
|
-
import { z as z9 } from "zod";
|
|
257
|
-
|
|
258
|
-
// src/genre-tree/schemas/artist-minimum.ts
|
|
259
|
-
import { z as z6 } from "zod";
|
|
260
|
-
var ArtistMinimumSchema = z6.object({
|
|
261
|
-
uuid: z6.string().uuid(),
|
|
262
|
-
name: z6.string(),
|
|
263
|
-
isSpecialPurpose: z6.boolean().optional()
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
// src/genre-tree/schemas/album-minimum.ts
|
|
267
|
-
import { z as z7 } from "zod";
|
|
268
|
-
var AlbumMinimumSchema = z7.object({
|
|
269
|
-
uuid: z7.string().uuid(),
|
|
270
|
-
name: z7.string(),
|
|
271
|
-
albumArtists: z7.array(ArtistMinimumSchema).nullable().optional()
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
// src/genre-tree/schemas/uuid-resource.ts
|
|
275
|
-
import { z as z8 } from "zod";
|
|
276
|
-
var UuidResourceSchema = z8.object({
|
|
277
|
-
uuid: z8.string().uuid()
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
// src/genre-tree/schemas/track/base.ts
|
|
281
|
-
var TrackBaseSchema = UuidResourceSchema.extend({
|
|
282
|
-
title: z9.string(),
|
|
283
|
-
artists: z9.array(ArtistMinimumSchema).nullable().optional(),
|
|
284
|
-
album: AlbumMinimumSchema.nullable().optional(),
|
|
285
|
-
trackNumber: z9.number().nullable().optional(),
|
|
286
|
-
// null for a song not yet linked to a genre.
|
|
287
|
-
genre: CriteriaMinimumSchema.nullable(),
|
|
288
|
-
rating: z9.number().min(0).max(10).nullable().optional(),
|
|
289
|
-
language: z9.string().nullable().optional(),
|
|
290
|
-
playCount: z9.number().min(0),
|
|
291
|
-
createdOn: z9.string().datetime(),
|
|
292
|
-
updatedOn: z9.string().datetime().nullable().optional()
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
// src/genre-tree/schemas/track/minimum.ts
|
|
296
|
-
var TrackMinimumSchema = TrackBaseSchema.pick({
|
|
297
|
-
uuid: true,
|
|
298
|
-
title: true,
|
|
299
|
-
artists: true
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
// src/genre-tree/schemas/criteria/lineage-rel/without-ascendant.ts
|
|
303
|
-
import { z as z10 } from "zod";
|
|
304
|
-
var CriteriaLineageRelWithoutAscendantSchema = z10.object({
|
|
305
|
-
descendant: CriteriaMinimumSchema,
|
|
306
|
-
degree: z10.number()
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
// src/genre-tree/schemas/criteria/lineage-rel/without-descendant.ts
|
|
310
|
-
import { z as z11 } from "zod";
|
|
311
|
-
var CriteriaLineageRelWithoutDescendantSchema = z11.object({
|
|
312
|
-
ascendant: CriteriaMinimumSchema,
|
|
313
|
-
degree: z11.number()
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
// src/genre-tree/schemas/criteria/detailed.ts
|
|
317
|
-
var CriteriaDetailedSchema = z12.object({
|
|
318
|
-
uuid: GenreUuidSchema,
|
|
319
|
-
name: z12.string(),
|
|
320
|
-
summary: z12.string().nullable(),
|
|
321
|
-
// Optional until every deployed API serves it.
|
|
322
|
-
wikidataId: z12.string().nullable().optional(),
|
|
323
|
-
parent: CriteriaMinimumSchema.nullable(),
|
|
324
|
-
ascendants: z12.array(CriteriaLineageRelWithoutDescendantSchema),
|
|
325
|
-
descendants: z12.array(CriteriaLineageRelWithoutAscendantSchema),
|
|
326
|
-
root: CriteriaMinimumSchema,
|
|
327
|
-
children: z12.array(CriteriaMinimumSchema),
|
|
328
|
-
criteriaPlaylist: CriteriaPlaylistMinimumSchema,
|
|
329
|
-
tracks: z12.array(TrackMinimumSchema),
|
|
330
|
-
essentialSongs: z12.array(TrackMinimumSchema),
|
|
331
|
-
tracksCount: z12.number(),
|
|
332
|
-
updatedOn: z12.string().datetime().nullable()
|
|
333
|
-
});
|
|
334
|
-
|
|
335
401
|
// src/genre-tree/schemas/criteria/overview.ts
|
|
336
|
-
import { z as
|
|
402
|
+
import { z as z15 } from "zod";
|
|
337
403
|
|
|
338
404
|
// src/genre-tree/schemas/http-url.ts
|
|
339
|
-
import { z as
|
|
340
|
-
var HttpUrlSchema =
|
|
405
|
+
import { z as z14 } from "zod";
|
|
406
|
+
var HttpUrlSchema = z14.url({ protocol: /^https?$/ });
|
|
341
407
|
|
|
342
408
|
// src/genre-tree/schemas/criteria/overview.ts
|
|
343
|
-
var CriteriaOverviewSchema =
|
|
409
|
+
var CriteriaOverviewSchema = z15.object({
|
|
344
410
|
uuid: GenreUuidSchema,
|
|
345
|
-
name:
|
|
346
|
-
summary:
|
|
347
|
-
description:
|
|
411
|
+
name: z15.string(),
|
|
412
|
+
summary: z15.string().nullable(),
|
|
413
|
+
description: z15.string().nullable(),
|
|
348
414
|
summarySourceUrl: HttpUrlSchema.nullable(),
|
|
349
|
-
essentialSongs:
|
|
415
|
+
essentialSongs: z15.array(TrackMinimumSchema).optional()
|
|
350
416
|
});
|
|
351
417
|
|
|
352
418
|
// src/genre-tree/schemas/criteria/simple.ts
|
|
353
|
-
import { z as
|
|
354
|
-
var CriteriaSimpleSchema =
|
|
419
|
+
import { z as z16 } from "zod";
|
|
420
|
+
var CriteriaSimpleSchema = z16.object({
|
|
355
421
|
uuid: GenreUuidSchema,
|
|
356
|
-
name:
|
|
422
|
+
name: z16.string(),
|
|
357
423
|
parent: CriteriaMinimumSchema.nullable(),
|
|
358
|
-
createdOn:
|
|
359
|
-
summary:
|
|
424
|
+
createdOn: z16.string().datetime(),
|
|
425
|
+
summary: z16.string().nullable()
|
|
360
426
|
});
|
|
361
427
|
|
|
362
428
|
// src/genre-tree/schemas/criteria/creation.ts
|
|
363
|
-
import { z as
|
|
364
|
-
var CriteriaCreationSchema =
|
|
365
|
-
name:
|
|
429
|
+
import { z as z17 } from "zod";
|
|
430
|
+
var CriteriaCreationSchema = z17.object({
|
|
431
|
+
name: z17.string().min(1, "Name is required"),
|
|
366
432
|
parent: GenreUuidSchema.optional(),
|
|
367
|
-
essentialSongs:
|
|
433
|
+
essentialSongs: z17.array(z17.string().uuid()).optional()
|
|
368
434
|
});
|
|
369
435
|
|
|
370
436
|
// src/genre-tree/schemas/criteria/update.ts
|
|
371
|
-
import { z as
|
|
372
|
-
var CriteriaUpdateSchema =
|
|
373
|
-
name:
|
|
437
|
+
import { z as z18 } from "zod";
|
|
438
|
+
var CriteriaUpdateSchema = z18.object({
|
|
439
|
+
name: z18.string().optional(),
|
|
374
440
|
parent: GenreUuidSchema.nullable().optional(),
|
|
375
|
-
essentialSongs:
|
|
376
|
-
side:
|
|
441
|
+
essentialSongs: z18.array(z18.string().uuid()).optional(),
|
|
442
|
+
side: z18.enum(["core", "pop"]).optional()
|
|
377
443
|
});
|
|
378
444
|
|
|
379
445
|
// src/genre-tree/api/genres/queryKeys.ts
|
|
@@ -434,18 +500,18 @@ function useFetchGenre(scope, getBackendBaseUrl) {
|
|
|
434
500
|
async (id) => {
|
|
435
501
|
const endpoint = scope === "reference" ? genreEndpoints.reference.detail(id) : genreEndpoints.me.detail(id);
|
|
436
502
|
const response = await fetch(endpoint, true, scope === "me");
|
|
437
|
-
return parseWithLog(CriteriaDetailedSchema, response, "useFetchGenre");
|
|
503
|
+
return parseWithLog(scope === "reference" ? ReferenceGenreDetailedSchema : CriteriaDetailedSchema, response, "useFetchGenre");
|
|
438
504
|
},
|
|
439
505
|
[fetch, scope]
|
|
440
506
|
);
|
|
441
507
|
}
|
|
442
|
-
function useFetchGenreDetail(id, scope, getBackendBaseUrl, schema = CriteriaDetailedSchema) {
|
|
508
|
+
function useFetchGenreDetail(id, scope, getBackendBaseUrl, schema = scope === "reference" ? ReferenceGenreDetailedSchema : CriteriaDetailedSchema) {
|
|
443
509
|
const { fetch } = useFetchWrapper(getBackendBaseUrl);
|
|
444
510
|
const queryKeys = scope === "reference" ? genreQueryKeys.reference : genreQueryKeys.me;
|
|
445
511
|
const endpoints = scope === "reference" ? genreEndpoints.reference : genreEndpoints.me;
|
|
446
512
|
const genreUuid = id ?? "";
|
|
447
513
|
return useQueryWithParse({
|
|
448
|
-
queryKey: queryKeys.detail(genreUuid),
|
|
514
|
+
queryKey: scope === "reference" ? [...queryKeys.detail(genreUuid), getBackendBaseUrl(), "genreMusicV1"] : queryKeys.detail(genreUuid),
|
|
449
515
|
queryFn: () => fetch(endpoints.detail(genreUuid), true, scope === "me"),
|
|
450
516
|
schema,
|
|
451
517
|
context: "useFetchGenreDetail",
|
|
@@ -528,7 +594,7 @@ function useUpdateGenre(scope, getBackendBaseUrl) {
|
|
|
528
594
|
const refreshGenreTree = useRefreshGenreTree(scope);
|
|
529
595
|
const { fetch } = useFetchWrapper(getBackendBaseUrl);
|
|
530
596
|
const { mutate, mutateAsync, isPending, formErrors } = useValidatedMutation({
|
|
531
|
-
inputSchema:
|
|
597
|
+
inputSchema: z19.object({
|
|
532
598
|
uuid: GenreUuidSchema,
|
|
533
599
|
data: CriteriaUpdateSchema
|
|
534
600
|
}),
|
|
@@ -558,8 +624,8 @@ function useDeleteGenre(scope, getBackendBaseUrl) {
|
|
|
558
624
|
const refreshGenreTree = useRefreshGenreTree(scope);
|
|
559
625
|
const { fetch } = useFetchWrapper(getBackendBaseUrl);
|
|
560
626
|
return useValidatedMutation({
|
|
561
|
-
inputSchema:
|
|
562
|
-
outputSchema:
|
|
627
|
+
inputSchema: z19.object({ uuid: GenreUuidSchema }),
|
|
628
|
+
outputSchema: z19.null(),
|
|
563
629
|
mutationFn: async ({ uuid }) => {
|
|
564
630
|
const endpoint = scope === "reference" ? genreEndpoints.reference.delete(uuid) : genreEndpoints.me.delete(uuid);
|
|
565
631
|
return fetch(endpoint, true, scope === "me", { method: "DELETE" }, void 0, false, true);
|
|
@@ -569,16 +635,16 @@ function useDeleteGenre(scope, getBackendBaseUrl) {
|
|
|
569
635
|
}
|
|
570
636
|
|
|
571
637
|
// src/genre-tree/useArtist.ts
|
|
572
|
-
import { z as
|
|
638
|
+
import { z as z21 } from "zod";
|
|
573
639
|
|
|
574
640
|
// src/genre-tree/schemas/artist-detailed.ts
|
|
575
|
-
import { z as
|
|
576
|
-
var ArtistMembershipSchema =
|
|
641
|
+
import { z as z20 } from "zod";
|
|
642
|
+
var ArtistMembershipSchema = z20.object({
|
|
577
643
|
artist: ArtistMinimumSchema,
|
|
578
|
-
beginYear:
|
|
579
|
-
endYear:
|
|
580
|
-
ended:
|
|
581
|
-
roles:
|
|
644
|
+
beginYear: z20.number().int().nullable(),
|
|
645
|
+
endYear: z20.number().int().nullable(),
|
|
646
|
+
ended: z20.boolean(),
|
|
647
|
+
roles: z20.array(z20.string())
|
|
582
648
|
});
|
|
583
649
|
var ARTIST_LINK_KINDS = [
|
|
584
650
|
"official",
|
|
@@ -591,35 +657,35 @@ var ARTIST_LINK_KINDS = [
|
|
|
591
657
|
"discogs",
|
|
592
658
|
"social"
|
|
593
659
|
];
|
|
594
|
-
var ArtistImageSchema =
|
|
660
|
+
var ArtistImageSchema = z20.object({
|
|
595
661
|
url: HttpUrlSchema,
|
|
596
662
|
pageUrl: HttpUrlSchema,
|
|
597
|
-
author:
|
|
598
|
-
license:
|
|
663
|
+
author: z20.string().nullable(),
|
|
664
|
+
license: z20.string(),
|
|
599
665
|
licenseUrl: HttpUrlSchema.nullable()
|
|
600
666
|
});
|
|
601
|
-
var ArtistDetailedSchema =
|
|
602
|
-
uuid:
|
|
603
|
-
name:
|
|
604
|
-
musicbrainzArtistId:
|
|
605
|
-
type:
|
|
606
|
-
country:
|
|
607
|
-
beginYear:
|
|
608
|
-
endYear:
|
|
609
|
-
ended:
|
|
610
|
-
links:
|
|
611
|
-
members:
|
|
612
|
-
memberOf:
|
|
613
|
-
albums:
|
|
614
|
-
|
|
615
|
-
uuid:
|
|
616
|
-
name:
|
|
617
|
-
year:
|
|
618
|
-
primaryType:
|
|
619
|
-
secondaryTypes:
|
|
667
|
+
var ArtistDetailedSchema = z20.object({
|
|
668
|
+
uuid: z20.string().uuid(),
|
|
669
|
+
name: z20.string(),
|
|
670
|
+
musicbrainzArtistId: z20.string().uuid().nullable(),
|
|
671
|
+
type: z20.enum(["person", "group", "orchestra", "choir", "character", "other"]).nullable(),
|
|
672
|
+
country: z20.string().nullable(),
|
|
673
|
+
beginYear: z20.number().int().nullable(),
|
|
674
|
+
endYear: z20.number().int().nullable(),
|
|
675
|
+
ended: z20.boolean(),
|
|
676
|
+
links: z20.array(z20.object({ kind: z20.enum(ARTIST_LINK_KINDS), url: HttpUrlSchema })),
|
|
677
|
+
members: z20.array(ArtistMembershipSchema),
|
|
678
|
+
memberOf: z20.array(ArtistMembershipSchema),
|
|
679
|
+
albums: z20.array(
|
|
680
|
+
z20.object({
|
|
681
|
+
uuid: z20.string().uuid(),
|
|
682
|
+
name: z20.string(),
|
|
683
|
+
year: z20.string().nullable(),
|
|
684
|
+
primaryType: z20.string().nullable(),
|
|
685
|
+
secondaryTypes: z20.array(z20.string())
|
|
620
686
|
})
|
|
621
687
|
),
|
|
622
|
-
tracksCount:
|
|
688
|
+
tracksCount: z20.number().int(),
|
|
623
689
|
image: ArtistImageSchema.nullable()
|
|
624
690
|
});
|
|
625
691
|
|
|
@@ -642,7 +708,7 @@ var artistEndpoints = {
|
|
|
642
708
|
var isNotFound = (error) => error instanceof AppError && error.code === "BAC4040" /* BACKEND_NOT_FOUND */;
|
|
643
709
|
function useArtist(uuid, getBackendBaseUrl) {
|
|
644
710
|
const { fetch } = useFetchWrapper(getBackendBaseUrl);
|
|
645
|
-
const isUuid = uuid !== null &&
|
|
711
|
+
const isUuid = uuid !== null && z21.string().uuid().safeParse(uuid).success;
|
|
646
712
|
const { data, isPending, error } = useQueryWithParse({
|
|
647
713
|
queryKey: artistQueryKeys.detail(uuid),
|
|
648
714
|
// A missing artist is shown in the panel, not raised as an app-wide connectivity error.
|
|
@@ -660,19 +726,19 @@ function useArtist(uuid, getBackendBaseUrl) {
|
|
|
660
726
|
}
|
|
661
727
|
|
|
662
728
|
// src/genre-tree/schemas/artist-search.ts
|
|
663
|
-
import { z as
|
|
664
|
-
var ArtistSearchResultSchema =
|
|
665
|
-
uuid:
|
|
666
|
-
name:
|
|
667
|
-
disambiguation:
|
|
668
|
-
type:
|
|
669
|
-
country:
|
|
670
|
-
beginYear:
|
|
671
|
-
endYear:
|
|
672
|
-
matchedAlias:
|
|
673
|
-
recordingCount:
|
|
729
|
+
import { z as z22 } from "zod";
|
|
730
|
+
var ArtistSearchResultSchema = z22.object({
|
|
731
|
+
uuid: z22.string().uuid(),
|
|
732
|
+
name: z22.string(),
|
|
733
|
+
disambiguation: z22.string().nullable(),
|
|
734
|
+
type: z22.enum(["person", "group", "orchestra", "choir", "character", "other"]).nullable(),
|
|
735
|
+
country: z22.string().nullable(),
|
|
736
|
+
beginYear: z22.number().int().nullable(),
|
|
737
|
+
endYear: z22.number().int().nullable(),
|
|
738
|
+
matchedAlias: z22.string().nullable(),
|
|
739
|
+
recordingCount: z22.number().int()
|
|
674
740
|
});
|
|
675
|
-
var ArtistSearchResultsSchema =
|
|
741
|
+
var ArtistSearchResultsSchema = z22.array(ArtistSearchResultSchema);
|
|
676
742
|
|
|
677
743
|
// src/genre-tree/useRemoteSearch.ts
|
|
678
744
|
import { keepPreviousData } from "@tanstack/react-query";
|
|
@@ -726,10 +792,10 @@ function useArtistSearch(getBackendBaseUrl, text) {
|
|
|
726
792
|
}
|
|
727
793
|
|
|
728
794
|
// src/genre-tree/useSong.ts
|
|
729
|
-
import { z as
|
|
795
|
+
import { z as z24 } from "zod";
|
|
730
796
|
|
|
731
797
|
// src/genre-tree/schemas/song/detailed.ts
|
|
732
|
-
import { z as
|
|
798
|
+
import { z as z23 } from "zod";
|
|
733
799
|
var YOUTUBE_UNPLAYABLE_REASON_LABELS = {
|
|
734
800
|
not_found: "Video unavailable",
|
|
735
801
|
not_embeddable: "Embedding disabled",
|
|
@@ -738,23 +804,23 @@ var YOUTUBE_UNPLAYABLE_REASON_LABELS = {
|
|
|
738
804
|
region_whitelisted: "Region restricted"
|
|
739
805
|
};
|
|
740
806
|
var YOUTUBE_UNPLAYABLE_REASONS = Object.keys(YOUTUBE_UNPLAYABLE_REASON_LABELS);
|
|
741
|
-
var YoutubeAvailabilitySchema =
|
|
742
|
-
status:
|
|
743
|
-
reason:
|
|
744
|
-
country:
|
|
807
|
+
var YoutubeAvailabilitySchema = z23.object({
|
|
808
|
+
status: z23.enum(["eligible", "blocked", "unknown"]),
|
|
809
|
+
reason: z23.string().nullable(),
|
|
810
|
+
country: z23.string().nullable()
|
|
745
811
|
});
|
|
746
812
|
var SongDetailedSchema = TrackBaseSchema.extend({
|
|
747
|
-
youtubeVideo:
|
|
748
|
-
id:
|
|
813
|
+
youtubeVideo: z23.object({
|
|
814
|
+
id: z23.string(),
|
|
749
815
|
availability: YoutubeAvailabilitySchema.optional(),
|
|
750
816
|
// null = playable
|
|
751
|
-
unplayableReason:
|
|
752
|
-
viewCount:
|
|
817
|
+
unplayableReason: z23.enum(YOUTUBE_UNPLAYABLE_REASONS).nullable(),
|
|
818
|
+
viewCount: z23.number().int().nullable().optional()
|
|
753
819
|
}).nullable(),
|
|
754
820
|
// null for hand-made/admin songs
|
|
755
|
-
musicbrainzRecordingId:
|
|
756
|
-
firstReleaseYear:
|
|
757
|
-
essentialGenres:
|
|
821
|
+
musicbrainzRecordingId: z23.string().uuid().nullable(),
|
|
822
|
+
firstReleaseYear: z23.number().int().nullable().optional(),
|
|
823
|
+
essentialGenres: z23.array(CriteriaMinimumSchema).optional()
|
|
758
824
|
});
|
|
759
825
|
var NO_VIDEO_LABEL = "No video available";
|
|
760
826
|
function isSong(track) {
|
|
@@ -775,7 +841,7 @@ var isNotFound2 = (error) => error instanceof AppError && error.code === "BAC404
|
|
|
775
841
|
function useSong(uuid, getBackendBaseUrl) {
|
|
776
842
|
const playback = usePlaybackContext();
|
|
777
843
|
const { fetch } = useFetchWrapper(getBackendBaseUrl);
|
|
778
|
-
const isUuid = uuid !== null &&
|
|
844
|
+
const isUuid = uuid !== null && z24.string().uuid().safeParse(uuid).success;
|
|
779
845
|
const { data, isPending, error } = useQueryWithParse({
|
|
780
846
|
queryKey: [...libraryQueryKeys.reference.songs.detail(uuid), ...playback.key ? [playback.key] : []],
|
|
781
847
|
// A missing song is shown in the panel, not raised as an app-wide connectivity error.
|
|
@@ -793,16 +859,16 @@ function useSong(uuid, getBackendBaseUrl) {
|
|
|
793
859
|
}
|
|
794
860
|
|
|
795
861
|
// src/genre-tree/schemas/song-history.ts
|
|
796
|
-
import { z as
|
|
797
|
-
var SongHistoryEntrySchema =
|
|
798
|
-
uuid:
|
|
799
|
-
action:
|
|
800
|
-
actorPseudo:
|
|
801
|
-
oldValue:
|
|
802
|
-
newValue:
|
|
803
|
-
createdOn:
|
|
862
|
+
import { z as z25 } from "zod";
|
|
863
|
+
var SongHistoryEntrySchema = z25.object({
|
|
864
|
+
uuid: z25.string().uuid(),
|
|
865
|
+
action: z25.string(),
|
|
866
|
+
actorPseudo: z25.string().nullable(),
|
|
867
|
+
oldValue: z25.string().nullable(),
|
|
868
|
+
newValue: z25.string().nullable(),
|
|
869
|
+
createdOn: z25.string()
|
|
804
870
|
});
|
|
805
|
-
var SongHistorySchema =
|
|
871
|
+
var SongHistorySchema = z25.array(SongHistoryEntrySchema);
|
|
806
872
|
|
|
807
873
|
// src/genre-tree/useSongHistory.ts
|
|
808
874
|
function useSongHistory(uuid, getBackendBaseUrl, enabled) {
|
|
@@ -822,20 +888,20 @@ function useSongHistory(uuid, getBackendBaseUrl, enabled) {
|
|
|
822
888
|
}
|
|
823
889
|
|
|
824
890
|
// src/genre-tree/schemas/song-search.ts
|
|
825
|
-
import { z as
|
|
826
|
-
var SongSearchResultSchema =
|
|
827
|
-
uuid:
|
|
828
|
-
title:
|
|
829
|
-
artists:
|
|
891
|
+
import { z as z26 } from "zod";
|
|
892
|
+
var SongSearchResultSchema = z26.object({
|
|
893
|
+
uuid: z26.string().uuid(),
|
|
894
|
+
title: z26.string(),
|
|
895
|
+
artists: z26.array(ArtistMinimumSchema),
|
|
830
896
|
// null for songs not yet linked to a genre.
|
|
831
897
|
genre: CriteriaMinimumSchema.nullable(),
|
|
832
|
-
youtubeVideo:
|
|
833
|
-
id:
|
|
834
|
-
unplayableReason:
|
|
898
|
+
youtubeVideo: z26.object({
|
|
899
|
+
id: z26.string(),
|
|
900
|
+
unplayableReason: z26.string().nullable()
|
|
835
901
|
}).nullable(),
|
|
836
|
-
firstReleaseYear:
|
|
902
|
+
firstReleaseYear: z26.number().int().nullable()
|
|
837
903
|
});
|
|
838
|
-
var SongSearchResultsSchema =
|
|
904
|
+
var SongSearchResultsSchema = z26.array(SongSearchResultSchema);
|
|
839
905
|
function isSongSearchResultPlayable(result) {
|
|
840
906
|
return result.youtubeVideo !== null && result.youtubeVideo.unplayableReason === null;
|
|
841
907
|
}
|
|
@@ -861,16 +927,25 @@ function useSongSearch(getBackendBaseUrl, text, options = {}) {
|
|
|
861
927
|
|
|
862
928
|
// src/genre-tree/useArtistGenreCounts.ts
|
|
863
929
|
import { keepPreviousData as keepPreviousData2 } from "@tanstack/react-query";
|
|
864
|
-
import { z as
|
|
930
|
+
import { z as z28 } from "zod";
|
|
865
931
|
|
|
866
932
|
// src/genre-tree/schemas/artist-genre-count.ts
|
|
867
|
-
import { z as
|
|
868
|
-
var ArtistGenreCountSchema =
|
|
933
|
+
import { z as z27 } from "zod";
|
|
934
|
+
var ArtistGenreCountSchema = z27.object({
|
|
935
|
+
...GenreCountsSchema.shape,
|
|
936
|
+
catalogue: GenreCatalogueCountsSchema,
|
|
869
937
|
genrePlaylist: GenrePlaylistUuidSchema,
|
|
870
|
-
/**
|
|
871
|
-
songsCount:
|
|
872
|
-
/**
|
|
873
|
-
tracksCount:
|
|
938
|
+
/** Legacy catalogue count for the default selection. */
|
|
939
|
+
songsCount: z27.number().int().nonnegative(),
|
|
940
|
+
/** Legacy playlist count for the default selection. */
|
|
941
|
+
tracksCount: z27.number().int().nonnegative()
|
|
942
|
+
}).superRefine((row, ctx) => {
|
|
943
|
+
const counts = GenreCatalogueCountsSchema.safeParse(row);
|
|
944
|
+
if (!counts.success) {
|
|
945
|
+
for (const issue of counts.error.issues) {
|
|
946
|
+
ctx.addIssue({ code: "custom", path: issue.path, message: issue.message });
|
|
947
|
+
}
|
|
948
|
+
}
|
|
874
949
|
});
|
|
875
950
|
|
|
876
951
|
// src/genre-tree/useArtistGenreCounts.ts
|
|
@@ -878,10 +953,10 @@ var isNotFound3 = (error) => error instanceof AppError && error.code === "BAC404
|
|
|
878
953
|
function useArtistGenreCounts(artistUuid, getBackendBaseUrl) {
|
|
879
954
|
const { fetch } = useFetchWrapper(getBackendBaseUrl);
|
|
880
955
|
return useQueryWithParse({
|
|
881
|
-
queryKey: artistQueryKeys.genreCounts(getBackendBaseUrl(), artistUuid),
|
|
956
|
+
queryKey: [...artistQueryKeys.genreCounts(getBackendBaseUrl(), artistUuid), "genreMusicV1"],
|
|
882
957
|
// A missing artist is shown in the artist panel, not raised as an app-wide connectivity error.
|
|
883
958
|
queryFn: () => fetch(artistEndpoints.genreCounts(artistUuid), true, false, void 0, void 0, false, true),
|
|
884
|
-
schema:
|
|
959
|
+
schema: z28.array(ArtistGenreCountSchema),
|
|
885
960
|
enabled: artistUuid !== null,
|
|
886
961
|
placeholderData: keepPreviousData2,
|
|
887
962
|
retry: (failureCount, error) => !isNotFound3(error) && failureCount < 3,
|
|
@@ -889,6 +964,9 @@ function useArtistGenreCounts(artistUuid, getBackendBaseUrl) {
|
|
|
889
964
|
});
|
|
890
965
|
}
|
|
891
966
|
|
|
967
|
+
// src/genre-tree/useGenreSearch.ts
|
|
968
|
+
import { useDeferredValue, useMemo } from "react";
|
|
969
|
+
|
|
892
970
|
// src/genre-tree/lib/search-text.ts
|
|
893
971
|
var foldSearchText = (text) => text.normalize("NFD").replace(/\p{M}+/gu, "").toLowerCase().replace(/\s+/g, " ").trim();
|
|
894
972
|
var trigrams = (folded) => {
|
|
@@ -934,9 +1012,54 @@ function rankByName(items, query, getName, getViews) {
|
|
|
934
1012
|
);
|
|
935
1013
|
return scored.map((entry) => entry.item);
|
|
936
1014
|
}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
1015
|
+
function createNameIndex(items, getName, getViews) {
|
|
1016
|
+
return items.map((item) => {
|
|
1017
|
+
const name = foldSearchText(getName(item));
|
|
1018
|
+
return { item, name, grams: trigrams(name), views: getViews?.(item) ?? 0 };
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
function rankNameIndex(index, query, limit = Infinity) {
|
|
1022
|
+
if (limit !== Infinity && (!Number.isInteger(limit) || limit < 0)) {
|
|
1023
|
+
throw new RangeError("Search limit must be a nonnegative integer or Infinity");
|
|
1024
|
+
}
|
|
1025
|
+
const folded = foldSearchText(query);
|
|
1026
|
+
if (!folded || limit === 0) return [];
|
|
1027
|
+
const queryGrams = trigrams(folded);
|
|
1028
|
+
const scored = [];
|
|
1029
|
+
const compare = (a, b) => a.tier - b.tier || b.similarity - a.similarity || b.views - a.views || a.name.localeCompare(b.name);
|
|
1030
|
+
for (const entry of index) {
|
|
1031
|
+
let tier;
|
|
1032
|
+
let similarity = 0;
|
|
1033
|
+
if (entry.name === folded) tier = TIER_EXACT;
|
|
1034
|
+
else if (entry.name.startsWith(folded)) tier = TIER_PREFIX;
|
|
1035
|
+
else if (entry.name.includes(folded)) tier = TIER_SUBSTRING;
|
|
1036
|
+
else {
|
|
1037
|
+
let shared = 0;
|
|
1038
|
+
for (const gram of queryGrams) if (entry.grams.has(gram)) shared++;
|
|
1039
|
+
const union = entry.grams.size + queryGrams.size - shared;
|
|
1040
|
+
similarity = union === 0 ? 0 : shared / union;
|
|
1041
|
+
if (similarity < FUZZY_MIN_SIMILARITY) continue;
|
|
1042
|
+
tier = TIER_FUZZY;
|
|
1043
|
+
}
|
|
1044
|
+
const candidate = { ...entry, tier, similarity };
|
|
1045
|
+
if (limit === Infinity) scored.push(candidate);
|
|
1046
|
+
else {
|
|
1047
|
+
let low = 0;
|
|
1048
|
+
let high = scored.length;
|
|
1049
|
+
while (low < high) {
|
|
1050
|
+
const mid = low + high >>> 1;
|
|
1051
|
+
if (compare(candidate, scored[mid]) < 0) high = mid;
|
|
1052
|
+
else low = mid + 1;
|
|
1053
|
+
}
|
|
1054
|
+
if (low < limit) {
|
|
1055
|
+
scored.splice(low, 0, candidate);
|
|
1056
|
+
if (scored.length > limit) scored.pop();
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
if (limit === Infinity) scored.sort(compare);
|
|
1061
|
+
return scored.map((entry) => entry.item);
|
|
1062
|
+
}
|
|
940
1063
|
|
|
941
1064
|
// src/genre-tree/useSearchQueryState.ts
|
|
942
1065
|
import { useState as useState2 } from "react";
|
|
@@ -970,7 +1093,15 @@ function useGenreSearch({
|
|
|
970
1093
|
onClear
|
|
971
1094
|
}) {
|
|
972
1095
|
const { query, setQuery, isTyping, canClear, clear, notifyPick } = useSearchQueryState({ selectedName, onClear });
|
|
973
|
-
const
|
|
1096
|
+
const index = useMemo(
|
|
1097
|
+
() => createNameIndex(genrePlaylists, (playlist) => playlist.name, (playlist) => playlist.viewsCount ?? 0),
|
|
1098
|
+
[genrePlaylists]
|
|
1099
|
+
);
|
|
1100
|
+
const deferredQuery = useDeferredValue(query);
|
|
1101
|
+
const results = useMemo(
|
|
1102
|
+
() => isTyping ? rankNameIndex(index, deferredQuery) : [],
|
|
1103
|
+
[index, deferredQuery, isTyping]
|
|
1104
|
+
);
|
|
974
1105
|
return {
|
|
975
1106
|
query,
|
|
976
1107
|
setQuery,
|
|
@@ -985,32 +1116,32 @@ function useGenreSearch({
|
|
|
985
1116
|
}
|
|
986
1117
|
|
|
987
1118
|
// src/genre-tree/schemas/genre-search.ts
|
|
988
|
-
import { z as
|
|
989
|
-
var GenreSearchTreeNameSchema =
|
|
990
|
-
var GenreSearchResultSchema =
|
|
1119
|
+
import { z as z29 } from "zod";
|
|
1120
|
+
var GenreSearchTreeNameSchema = z29.enum(["canonical", "regional"]);
|
|
1121
|
+
var GenreSearchResultSchema = z29.object({
|
|
991
1122
|
/** Criteria (genre) uuid. */
|
|
992
1123
|
uuid: GenreUuidSchema,
|
|
993
|
-
name:
|
|
1124
|
+
name: z29.string(),
|
|
994
1125
|
/** Null for app-created genres, which the Wikidata-keyed region index does not reference. */
|
|
995
|
-
wikidataId:
|
|
996
|
-
treeName:
|
|
1126
|
+
wikidataId: z29.string().nullable(),
|
|
1127
|
+
treeName: z29.string(),
|
|
997
1128
|
/** Null when the genre has no playlist in the tree, so it cannot be opened there. */
|
|
998
1129
|
genrePlaylistUuid: GenrePlaylistUuidSchema.nullable(),
|
|
999
|
-
root:
|
|
1000
|
-
isUmbrella:
|
|
1001
|
-
viewsCount:
|
|
1130
|
+
root: z29.object({ uuid: GenreUuidSchema, name: z29.string() }),
|
|
1131
|
+
isUmbrella: z29.boolean(),
|
|
1132
|
+
viewsCount: z29.number().int()
|
|
1002
1133
|
});
|
|
1003
|
-
var GenreSearchResultsSchema =
|
|
1004
|
-
var RegionGenreLexiconEntrySchema =
|
|
1005
|
-
wikidataId:
|
|
1134
|
+
var GenreSearchResultsSchema = z29.array(GenreSearchResultSchema);
|
|
1135
|
+
var RegionGenreLexiconEntrySchema = z29.object({
|
|
1136
|
+
wikidataId: z29.string(),
|
|
1006
1137
|
uuid: GenreUuidSchema,
|
|
1007
|
-
name:
|
|
1008
|
-
treeName:
|
|
1138
|
+
name: z29.string(),
|
|
1139
|
+
treeName: z29.string(),
|
|
1009
1140
|
genrePlaylistUuid: GenrePlaylistUuidSchema.nullable(),
|
|
1010
|
-
isUmbrella:
|
|
1011
|
-
viewsCount:
|
|
1141
|
+
isUmbrella: z29.boolean(),
|
|
1142
|
+
viewsCount: z29.number().int()
|
|
1012
1143
|
});
|
|
1013
|
-
var RegionGenreLexiconSchema =
|
|
1144
|
+
var RegionGenreLexiconSchema = z29.array(RegionGenreLexiconEntrySchema);
|
|
1014
1145
|
|
|
1015
1146
|
// src/genre-tree/useGenreRemoteSearch.ts
|
|
1016
1147
|
var DEFAULT_RESULT_LIMIT2 = 8;
|
|
@@ -1029,6 +1160,7 @@ function useGenreRemoteSearch(getBackendBaseUrl, text, { treeName, limit = DEFAU
|
|
|
1029
1160
|
}
|
|
1030
1161
|
|
|
1031
1162
|
// src/genre-tree/useRegionGenreLexicon.ts
|
|
1163
|
+
var EMPTY_ENTRIES = [];
|
|
1032
1164
|
function useRegionGenreLexicon(getBackendBaseUrl, enabled) {
|
|
1033
1165
|
const { fetch } = useFetchWrapper(getBackendBaseUrl);
|
|
1034
1166
|
const { data, isError, isPending } = useQueryWithParse({
|
|
@@ -1039,15 +1171,15 @@ function useRegionGenreLexicon(getBackendBaseUrl, enabled) {
|
|
|
1039
1171
|
enabled,
|
|
1040
1172
|
staleTime: Infinity
|
|
1041
1173
|
});
|
|
1042
|
-
const entries = data ??
|
|
1174
|
+
const entries = data ?? EMPTY_ENTRIES;
|
|
1043
1175
|
return { entries, isError, isPending: enabled && isPending };
|
|
1044
1176
|
}
|
|
1045
1177
|
|
|
1046
1178
|
// src/genre-tree/useGenreTreeViewState.ts
|
|
1047
|
-
import { useCallback as useCallback2, useEffect as useEffect2, useMemo as
|
|
1179
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useMemo as useMemo3, useRef as useRef2, useState as useState3 } from "react";
|
|
1048
1180
|
|
|
1049
1181
|
// src/genre-tree/useVisibleGenrePlaylists.ts
|
|
1050
|
-
import { useMemo } from "react";
|
|
1182
|
+
import { useMemo as useMemo2 } from "react";
|
|
1051
1183
|
|
|
1052
1184
|
// src/genre-tree/lib/prune-genre-playlists-for-artist.ts
|
|
1053
1185
|
var POP_ROOT_NAME = "Mainstream Pop";
|
|
@@ -1057,7 +1189,7 @@ var pruneGenrePlaylistsForArtist = (playlists, counts) => {
|
|
|
1057
1189
|
const kept = /* @__PURE__ */ new Set();
|
|
1058
1190
|
for (const playlist of playlists) {
|
|
1059
1191
|
const isPopRoot = playlist.parent === null && playlist.name === POP_ROOT_NAME;
|
|
1060
|
-
if (isPopRoot || (countByPlaylist.get(playlist.uuid)?.
|
|
1192
|
+
if (isPopRoot || (countByPlaylist.get(playlist.uuid)?.catalogue.genreAndSubgenresTracksCount.all ?? 0) > 0) kept.add(playlist.uuid);
|
|
1061
1193
|
}
|
|
1062
1194
|
const coreElectronicUuids = new Set(
|
|
1063
1195
|
playlists.filter((playlist) => playlist.name === CORE_ELECTRONIC_NAME && kept.has(playlist.uuid)).map((p) => p.uuid)
|
|
@@ -1065,12 +1197,22 @@ var pruneGenrePlaylistsForArtist = (playlists, counts) => {
|
|
|
1065
1197
|
for (const playlist of playlists) {
|
|
1066
1198
|
if (playlist.parent && coreElectronicUuids.has(playlist.parent.uuid)) kept.add(playlist.uuid);
|
|
1067
1199
|
}
|
|
1068
|
-
return playlists.filter((playlist) => kept.has(playlist.uuid)).map((playlist) =>
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1200
|
+
return playlists.filter((playlist) => kept.has(playlist.uuid)).map((playlist) => {
|
|
1201
|
+
const count = countByPlaylist.get(playlist.uuid);
|
|
1202
|
+
const catalogue = GenreCatalogueCountsSchema.parse(playlist.catalogue);
|
|
1203
|
+
const scopes = playlist.genreAndSubgenresTracksCount;
|
|
1204
|
+
if (!scopes) throw new Error("Artist projections require a reference genre summary");
|
|
1205
|
+
const zero = { genreOnlyTracksCount: 0, genreAndSubgenresTracksCount: "canonical" in scopes ? { canonical: 0, regional: 0, all: 0 } : { all: 0 } };
|
|
1206
|
+
return {
|
|
1207
|
+
...playlist,
|
|
1208
|
+
genreOnlyTracksCount: count?.genreOnlyTracksCount ?? 0,
|
|
1209
|
+
genreAndSubgenresTracksCount: count?.genreAndSubgenresTracksCount ?? zero.genreAndSubgenresTracksCount,
|
|
1210
|
+
catalogue: count?.catalogue ?? { ...catalogue, ...zero },
|
|
1211
|
+
tracksCount: count ? genreMusicCount(count) : 0,
|
|
1212
|
+
// Artist view totals are not served.
|
|
1213
|
+
viewsCount: void 0
|
|
1214
|
+
};
|
|
1215
|
+
});
|
|
1074
1216
|
};
|
|
1075
1217
|
|
|
1076
1218
|
// src/genre-tree/useVisibleGenrePlaylists.ts
|
|
@@ -1079,7 +1221,7 @@ function useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid = null
|
|
|
1079
1221
|
const counts = useArtistGenreCounts(artistUuid, getBackendBaseUrl);
|
|
1080
1222
|
const artistCounts = artistUuid !== null ? counts.data : void 0;
|
|
1081
1223
|
const isCountsLoading = artistUuid !== null && (counts.isPending || counts.isPlaceholderData);
|
|
1082
|
-
const genrePlaylists =
|
|
1224
|
+
const genrePlaylists = useMemo2(() => {
|
|
1083
1225
|
if (!tree) return [];
|
|
1084
1226
|
return artistCounts ? pruneGenrePlaylistsForArtist(tree, artistCounts) : tree;
|
|
1085
1227
|
}, [tree, artistCounts]);
|
|
@@ -1120,8 +1262,8 @@ function useGenreTreeViewState({
|
|
|
1120
1262
|
[isSelectionControlled, onSelectedNodeIdChange]
|
|
1121
1263
|
);
|
|
1122
1264
|
const { isLoading, isFetching, genrePlaylists } = useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid });
|
|
1123
|
-
const genrePlaylistByNodeId =
|
|
1124
|
-
const selectedGenrePlaylist =
|
|
1265
|
+
const genrePlaylistByNodeId = useMemo3(() => new Map(genrePlaylists.map((gp) => [gp.uuid, gp])), [genrePlaylists]);
|
|
1266
|
+
const selectedGenrePlaylist = useMemo3(
|
|
1125
1267
|
() => genrePlaylists.find((gp) => gp.uuid === requestedSelectedNodeId) ?? // Older shared links stored the criteria UUID in `genre`; resolve that alias while preserving
|
|
1126
1268
|
// the playlist UUID as the canonical tree selection identity.
|
|
1127
1269
|
genrePlaylists.find((gp) => gp.criteria?.uuid === requestedSelectedNodeId),
|
|
@@ -1159,8 +1301,8 @@ function useGenreTreeViewState({
|
|
|
1159
1301
|
},
|
|
1160
1302
|
[genrePlaylistByNodeId, prefetchGenreOverview]
|
|
1161
1303
|
);
|
|
1162
|
-
const groupedGenrePlaylistsByRoot =
|
|
1163
|
-
const canShowPopCore =
|
|
1304
|
+
const groupedGenrePlaylistsByRoot = useMemo3(() => getGenrePlaylistsGroupedByRoot(genrePlaylists), [genrePlaylists]);
|
|
1305
|
+
const canShowPopCore = useMemo3(
|
|
1164
1306
|
() => hasMainstreamPopRoot(
|
|
1165
1307
|
genrePlaylists.map((genrePlaylist) => ({
|
|
1166
1308
|
parentId: genrePlaylist.parent?.uuid ?? null,
|
|
@@ -1176,7 +1318,7 @@ function useGenreTreeViewState({
|
|
|
1176
1318
|
}, [isLoading, canShowPopCore, internalViewMode]);
|
|
1177
1319
|
const selectedViewMode = controlledViewMode ?? internalViewMode;
|
|
1178
1320
|
const viewMode = needsPopCore(selectedViewMode) && !canShowPopCore ? "wheel" : selectedViewMode;
|
|
1179
|
-
const visibleGenrePlaylists =
|
|
1321
|
+
const visibleGenrePlaylists = useMemo3(() => {
|
|
1180
1322
|
if (viewMode === "stacked") return genrePlaylists;
|
|
1181
1323
|
const unacceptedRootUuids = new Set(genrePlaylists.filter((gp) => gp.isUnacceptedRoot).map((gp) => gp.uuid));
|
|
1182
1324
|
const accepted = genrePlaylists.filter((gp) => !gp.isUnacceptedRoot && !unacceptedRootUuids.has(gp.root.uuid));
|
|
@@ -1205,13 +1347,13 @@ function useGenreTreeViewState({
|
|
|
1205
1347
|
}
|
|
1206
1348
|
|
|
1207
1349
|
// src/genre-tree/TrackListContext.tsx
|
|
1208
|
-
import { createContext as createContext2, useState as useState5, useContext as useContext2, useCallback as useCallback4, useEffect as useEffect3, useMemo as
|
|
1350
|
+
import { createContext as createContext2, useState as useState5, useContext as useContext2, useCallback as useCallback4, useEffect as useEffect3, useMemo as useMemo5, useRef as useRef3 } from "react";
|
|
1209
1351
|
|
|
1210
1352
|
// src/genre-tree/schemas/track-playlist-rel/without-playlist.ts
|
|
1211
|
-
import { z as
|
|
1212
|
-
var makeTrackPlaylistRelSchema = (trackSchema) =>
|
|
1353
|
+
import { z as z30 } from "zod";
|
|
1354
|
+
var makeTrackPlaylistRelSchema = (trackSchema) => z30.object({
|
|
1213
1355
|
track: trackSchema,
|
|
1214
|
-
position:
|
|
1356
|
+
position: z30.number().min(0)
|
|
1215
1357
|
});
|
|
1216
1358
|
var makeTrackPlaylistRelPageSchema = (trackSchema) => PaginatedResponseSchema(makeTrackPlaylistRelSchema(trackSchema));
|
|
1217
1359
|
|
|
@@ -1260,6 +1402,7 @@ var TrackListFromArtist = class extends TrackList {
|
|
|
1260
1402
|
var TrackListOriginType = /* @__PURE__ */ ((TrackListOriginType2) => {
|
|
1261
1403
|
TrackListOriginType2["TRACK"] = "TRACK";
|
|
1262
1404
|
TrackListOriginType2["GENRE_PLAYLIST"] = "GENRE_PLAYLIST";
|
|
1405
|
+
TrackListOriginType2["GENRE_CATALOGUE"] = "GENRE_CATALOGUE";
|
|
1263
1406
|
TrackListOriginType2["ARTIST"] = "ARTIST";
|
|
1264
1407
|
return TrackListOriginType2;
|
|
1265
1408
|
})(TrackListOriginType || {});
|
|
@@ -1291,31 +1434,52 @@ var TrackListOriginFromTrack = class extends TrackListOrigin {
|
|
|
1291
1434
|
};
|
|
1292
1435
|
var TrackListOriginFromCriteriaPlaylist = class extends TrackListOrigin {
|
|
1293
1436
|
/** `from`: the track the list starts at (server-side `?from=`), kept so later pages use it too. */
|
|
1294
|
-
constructor(criteriaPlaylist, scope, from) {
|
|
1437
|
+
constructor(criteriaPlaylist, scope, from, selection, artistUuid) {
|
|
1295
1438
|
super("GENRE_PLAYLIST" /* GENRE_PLAYLIST */, criteriaPlaylist.name, criteriaPlaylist.uuid, scope);
|
|
1296
1439
|
this.criteriaPlaylist = criteriaPlaylist;
|
|
1297
1440
|
this.from = from;
|
|
1441
|
+
this.selection = selection;
|
|
1442
|
+
this.artistUuid = artistUuid;
|
|
1298
1443
|
}
|
|
1299
1444
|
criteriaPlaylist;
|
|
1300
1445
|
from;
|
|
1446
|
+
selection;
|
|
1447
|
+
artistUuid;
|
|
1301
1448
|
};
|
|
1302
1449
|
var TrackListOriginFromArtist = class extends TrackListOrigin {
|
|
1303
1450
|
/** `ordering`/`from`: kept so later pages use the same order and start track. */
|
|
1304
|
-
constructor(artist, scope, ordering, from, genreUuid) {
|
|
1451
|
+
constructor(artist, scope, ordering, from, genreUuid, selection) {
|
|
1305
1452
|
super("ARTIST" /* ARTIST */, artist.name, artist.uuid, scope);
|
|
1306
1453
|
this.artist = artist;
|
|
1307
1454
|
this.ordering = ordering;
|
|
1308
1455
|
this.from = from;
|
|
1309
1456
|
this.genreUuid = genreUuid;
|
|
1457
|
+
this.selection = selection;
|
|
1310
1458
|
}
|
|
1311
1459
|
artist;
|
|
1312
1460
|
ordering;
|
|
1313
1461
|
from;
|
|
1314
1462
|
genreUuid;
|
|
1463
|
+
selection;
|
|
1464
|
+
};
|
|
1465
|
+
var TrackListOriginFromGenreCatalogue = class extends TrackListOrigin {
|
|
1466
|
+
constructor(genre, scope, from, selection) {
|
|
1467
|
+
super("GENRE_CATALOGUE" /* GENRE_CATALOGUE */, genre.name, genre.uuid, scope);
|
|
1468
|
+
this.genre = genre;
|
|
1469
|
+
this.from = from;
|
|
1470
|
+
this.selection = selection;
|
|
1471
|
+
}
|
|
1472
|
+
genre;
|
|
1473
|
+
from;
|
|
1474
|
+
selection;
|
|
1475
|
+
ordering = "title";
|
|
1476
|
+
get genreUuid() {
|
|
1477
|
+
return this.genre.uuid;
|
|
1478
|
+
}
|
|
1315
1479
|
};
|
|
1316
1480
|
|
|
1317
1481
|
// src/genre-tree/TrackListSidebarVisibilityContext.tsx
|
|
1318
|
-
import { createContext, useContext, useState as useState4, useCallback as useCallback3, useMemo as
|
|
1482
|
+
import { createContext, useContext, useState as useState4, useCallback as useCallback3, useMemo as useMemo4 } from "react";
|
|
1319
1483
|
import { jsx } from "react/jsx-runtime";
|
|
1320
1484
|
var TrackListSidebarVisibilityContext = createContext(void 0);
|
|
1321
1485
|
function TrackListSidebarVisibilityProvider({ children }) {
|
|
@@ -1329,7 +1493,7 @@ function TrackListSidebarVisibilityProvider({ children }) {
|
|
|
1329
1493
|
const hideTrackListSidebar = useCallback3(() => {
|
|
1330
1494
|
setIsTrackListSidebarVisible(false);
|
|
1331
1495
|
}, []);
|
|
1332
|
-
const value =
|
|
1496
|
+
const value = useMemo4(
|
|
1333
1497
|
() => ({
|
|
1334
1498
|
isTrackListSidebarVisible,
|
|
1335
1499
|
toggleTrackListSidebar,
|
|
@@ -1386,13 +1550,13 @@ function TrackListProvider({
|
|
|
1386
1550
|
const timer = setInterval(() => setFailureClock((tick) => tick + 1), 3e4);
|
|
1387
1551
|
return () => clearInterval(timer);
|
|
1388
1552
|
}, []);
|
|
1389
|
-
const runtimeUnplayableTrackIds =
|
|
1553
|
+
const runtimeUnplayableTrackIds = useMemo5(() => new Set(
|
|
1390
1554
|
(trackList?.tracks ?? []).filter((track) => isSong(track) && track.youtubeVideo && hasPlaybackFailure(track.youtubeVideo.id)).map((track) => track.uuid)
|
|
1391
1555
|
), [trackList, hasPlaybackFailure, playerTrackObject, failureClock]);
|
|
1392
1556
|
const { showTrackListSidebar } = useTrackListSidebarVisibility();
|
|
1393
1557
|
const playback = usePlaybackContext();
|
|
1394
1558
|
const { fetch } = useFetchWrapper(getBackendBaseUrl);
|
|
1395
|
-
const pageSchema =
|
|
1559
|
+
const pageSchema = useMemo5(() => makeTrackPlaylistRelPageSchema(schema), [schema]);
|
|
1396
1560
|
const latestPlayRequestRef = useRef3(0);
|
|
1397
1561
|
const startingPlaybackRef = useRef3(false);
|
|
1398
1562
|
const loadedContextRef = useRef3(playback.key);
|
|
@@ -1420,9 +1584,10 @@ function TrackListProvider({
|
|
|
1420
1584
|
[clearDelayedTrackLoad, loadTrackForPlayer]
|
|
1421
1585
|
);
|
|
1422
1586
|
const fetchTracksPage = useCallback4(
|
|
1423
|
-
async (uuid, scope, page, from) => {
|
|
1587
|
+
async (uuid, scope, page, from, selection, artistUuid) => {
|
|
1424
1588
|
const endpoint = genrePlaylistEndpoints[scope].tracks(uuid);
|
|
1425
|
-
|
|
1589
|
+
if (scope === "me" && (selection || artistUuid)) throw new Error("Genre selections require reference scope");
|
|
1590
|
+
const params = { page, pageSize: TRACKS_PAGE_SIZE, ...from && { from }, ...genreMusicQueryParams(selection), ...artistUuid && { artist: artistUuid } };
|
|
1426
1591
|
const response = await fetch(endpoint, true, scope === "me", {}, params, false, !!from, page === 1);
|
|
1427
1592
|
const parsed = parseWithLog(pageSchema, response, "fetchGenrePlaylistTracksPage");
|
|
1428
1593
|
return {
|
|
@@ -1433,17 +1598,18 @@ function TrackListProvider({
|
|
|
1433
1598
|
},
|
|
1434
1599
|
[fetch, pageSchema]
|
|
1435
1600
|
);
|
|
1436
|
-
const
|
|
1437
|
-
const
|
|
1601
|
+
const cataloguePageSchema = useMemo5(() => PaginatedResponseSchema(schema), [schema]);
|
|
1602
|
+
const fetchCatalogueTracksPage = useCallback4(
|
|
1438
1603
|
async (origin, page) => {
|
|
1439
1604
|
const params = {
|
|
1440
|
-
artist: origin.uuid,
|
|
1605
|
+
...origin instanceof TrackListOriginFromArtist && { artist: origin.uuid },
|
|
1441
1606
|
playable: true,
|
|
1442
1607
|
ordering: origin.ordering,
|
|
1443
1608
|
page,
|
|
1444
1609
|
pageSize: TRACKS_PAGE_SIZE,
|
|
1445
1610
|
...origin.from && { from: origin.from },
|
|
1446
|
-
...origin.genreUuid && { genre: origin.genreUuid }
|
|
1611
|
+
...origin.genreUuid && { genre: origin.genreUuid },
|
|
1612
|
+
...genreMusicQueryParams(origin.selection)
|
|
1447
1613
|
};
|
|
1448
1614
|
const response = await fetch(
|
|
1449
1615
|
libraryEndpoints.reference.songs.list(),
|
|
@@ -1456,10 +1622,10 @@ function TrackListProvider({
|
|
|
1456
1622
|
page === 1 && !!origin.from,
|
|
1457
1623
|
page === 1
|
|
1458
1624
|
);
|
|
1459
|
-
const parsed = parseWithLog(
|
|
1625
|
+
const parsed = parseWithLog(cataloguePageSchema, response, "fetchCatalogueTracksPage");
|
|
1460
1626
|
return { tracks: parsed.results, total: parsed.overallTotal, nextPage: parsed.next ? parsed.page + 1 : null };
|
|
1461
1627
|
},
|
|
1462
|
-
[fetch,
|
|
1628
|
+
[fetch, cataloguePageSchema]
|
|
1463
1629
|
);
|
|
1464
1630
|
const advanceAfterTrackEnd = useCallback4(
|
|
1465
1631
|
(event) => {
|
|
@@ -1531,7 +1697,7 @@ function TrackListProvider({
|
|
|
1531
1697
|
const from = options?.startSongUuid;
|
|
1532
1698
|
let page;
|
|
1533
1699
|
try {
|
|
1534
|
-
page = await fetchTracksPage(genrePlaylist.uuid, scope, 1, from);
|
|
1700
|
+
page = await fetchTracksPage(genrePlaylist.uuid, scope, 1, from, options?.selection, options?.artistUuid);
|
|
1535
1701
|
} catch (error) {
|
|
1536
1702
|
if (request !== latestPlayRequestRef.current) return;
|
|
1537
1703
|
startingPlaybackRef.current = false;
|
|
@@ -1548,7 +1714,7 @@ function TrackListProvider({
|
|
|
1548
1714
|
console.warn("No playable tracks found in genre playlist");
|
|
1549
1715
|
return;
|
|
1550
1716
|
}
|
|
1551
|
-
const origin = new TrackListOriginFromCriteriaPlaylist(genrePlaylist, scope, from);
|
|
1717
|
+
const origin = new TrackListOriginFromCriteriaPlaylist(genrePlaylist, scope, from, options?.selection, options?.artistUuid);
|
|
1552
1718
|
setAutoAdvanceScrollRequest(null);
|
|
1553
1719
|
setTrackList(new TrackListFromCriteriaPlaylist(page.tracks, origin, page.total, page.nextPage));
|
|
1554
1720
|
setSelectedTrack(startTrack);
|
|
@@ -1557,17 +1723,15 @@ function TrackListProvider({
|
|
|
1557
1723
|
},
|
|
1558
1724
|
[clearDelayedTrackLoad, fetchTracksPage, showTrackListSidebar, loadTrackForPlayer]
|
|
1559
1725
|
);
|
|
1560
|
-
const
|
|
1561
|
-
async (
|
|
1562
|
-
if (scope !== "reference") throw new Error("Artist track lists only support the reference scope");
|
|
1726
|
+
const playCatalogue = useCallback4(
|
|
1727
|
+
async (origin) => {
|
|
1563
1728
|
clearDelayedTrackLoad();
|
|
1564
1729
|
const request = ++latestPlayRequestRef.current;
|
|
1565
1730
|
startingPlaybackRef.current = true;
|
|
1566
|
-
const from =
|
|
1567
|
-
const origin = new TrackListOriginFromArtist(artist, scope, options.ordering, from, options.genreUuid);
|
|
1731
|
+
const from = origin.from;
|
|
1568
1732
|
let page;
|
|
1569
1733
|
try {
|
|
1570
|
-
page = await
|
|
1734
|
+
page = await fetchCatalogueTracksPage(origin, 1);
|
|
1571
1735
|
} catch (error) {
|
|
1572
1736
|
if (request !== latestPlayRequestRef.current) return;
|
|
1573
1737
|
startingPlaybackRef.current = false;
|
|
@@ -1578,19 +1742,34 @@ function TrackListProvider({
|
|
|
1578
1742
|
loadedContextRef.current = playback.snapshot().key;
|
|
1579
1743
|
const startTrack = page.tracks[0];
|
|
1580
1744
|
if (from && startTrack?.uuid !== from) {
|
|
1581
|
-
throw new Error(
|
|
1745
|
+
throw new Error(`${origin instanceof TrackListOriginFromArtist ? "Artist" : "Catalogue"} ${origin.uuid} did not start at song ${from}`);
|
|
1582
1746
|
}
|
|
1583
1747
|
if (!startTrack) {
|
|
1584
|
-
console.warn("No playable songs found
|
|
1748
|
+
console.warn("No playable songs found in catalogue");
|
|
1585
1749
|
return;
|
|
1586
1750
|
}
|
|
1587
|
-
setTrackList(new TrackListFromArtist(page.tracks, origin, page.total, page.nextPage));
|
|
1751
|
+
setTrackList(origin instanceof TrackListOriginFromArtist ? new TrackListFromArtist(page.tracks, origin, page.total, page.nextPage) : new TrackList(page.tracks, origin, page.total, page.nextPage));
|
|
1588
1752
|
setAutoAdvanceScrollRequest(null);
|
|
1589
1753
|
setSelectedTrack(startTrack);
|
|
1590
1754
|
showTrackListSidebar();
|
|
1591
1755
|
loadTrackForPlayer(startTrack.uuid);
|
|
1592
1756
|
},
|
|
1593
|
-
[clearDelayedTrackLoad,
|
|
1757
|
+
[clearDelayedTrackLoad, fetchCatalogueTracksPage, showTrackListSidebar, loadTrackForPlayer]
|
|
1758
|
+
);
|
|
1759
|
+
const playNewTrackListFromArtist = useCallback4(
|
|
1760
|
+
async (artist, scope, options) => {
|
|
1761
|
+
if (scope !== "reference") throw new Error("Artist track lists only support the reference scope");
|
|
1762
|
+
if (options.selection && !options.genreUuid) throw new Error("A genre selection requires a genre");
|
|
1763
|
+
return playCatalogue(new TrackListOriginFromArtist(artist, scope, options.ordering, options.startSongUuid, options.genreUuid, options.selection));
|
|
1764
|
+
},
|
|
1765
|
+
[playCatalogue]
|
|
1766
|
+
);
|
|
1767
|
+
const playNewTrackListFromGenreCatalogue = useCallback4(
|
|
1768
|
+
async (genre, scope, options) => {
|
|
1769
|
+
if (scope !== "reference") throw new Error("Genre catalogues only support the reference scope");
|
|
1770
|
+
return playCatalogue(new TrackListOriginFromGenreCatalogue(genre, scope, options?.startSongUuid, options?.selection));
|
|
1771
|
+
},
|
|
1772
|
+
[playCatalogue]
|
|
1594
1773
|
);
|
|
1595
1774
|
const contextKeyRef = useRef3(playback.key);
|
|
1596
1775
|
useEffect3(() => {
|
|
@@ -1612,20 +1791,28 @@ function TrackListProvider({
|
|
|
1612
1791
|
setTrackList(null);
|
|
1613
1792
|
setSelectedTrack(null);
|
|
1614
1793
|
if (origin instanceof TrackListOriginFromCriteriaPlaylist) {
|
|
1615
|
-
void playNewTrackListFromGenrePlaylist(origin.criteriaPlaylist, origin.scope, { startSongUuid: selected?.uuid }).catch((error) => {
|
|
1794
|
+
void playNewTrackListFromGenrePlaylist(origin.criteriaPlaylist, origin.scope, { startSongUuid: selected?.uuid, selection: origin.selection, artistUuid: origin.artistUuid }).catch((error) => {
|
|
1616
1795
|
if (error instanceof BackendError && error.code === "BAC4040" /* BACKEND_NOT_FOUND */) {
|
|
1617
|
-
return playNewTrackListFromGenrePlaylist(origin.criteriaPlaylist, origin.scope).catch(() => {
|
|
1796
|
+
return playNewTrackListFromGenrePlaylist(origin.criteriaPlaylist, origin.scope, { selection: origin.selection, artistUuid: origin.artistUuid }).catch(() => {
|
|
1618
1797
|
});
|
|
1619
1798
|
}
|
|
1620
1799
|
});
|
|
1621
1800
|
} else if (origin instanceof TrackListOriginFromArtist) {
|
|
1622
|
-
const options = { ordering: origin.ordering, genreUuid: origin.genreUuid };
|
|
1801
|
+
const options = { ordering: origin.ordering, genreUuid: origin.genreUuid, selection: origin.selection };
|
|
1623
1802
|
void playNewTrackListFromArtist(origin.artist, origin.scope, { ...options, startSongUuid: selected?.uuid }).catch((error) => {
|
|
1624
1803
|
if (error instanceof BackendError && error.code === "BAC4040" /* BACKEND_NOT_FOUND */) {
|
|
1625
1804
|
return playNewTrackListFromArtist(origin.artist, origin.scope, options).catch(() => {
|
|
1626
1805
|
});
|
|
1627
1806
|
}
|
|
1628
1807
|
});
|
|
1808
|
+
} else if (origin instanceof TrackListOriginFromGenreCatalogue) {
|
|
1809
|
+
const options = { selection: origin.selection };
|
|
1810
|
+
void playNewTrackListFromGenreCatalogue(origin.genre, origin.scope, { ...options, startSongUuid: selected?.uuid }).catch((error) => {
|
|
1811
|
+
if (error instanceof BackendError && error.code === "BAC4040" /* BACKEND_NOT_FOUND */) {
|
|
1812
|
+
return playNewTrackListFromGenreCatalogue(origin.genre, origin.scope, options).catch(() => {
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
});
|
|
1629
1816
|
} else if (origin instanceof TrackListOriginFromTrack && selected) {
|
|
1630
1817
|
const request = latestPlayRequestRef.current;
|
|
1631
1818
|
void (async () => {
|
|
@@ -1636,7 +1823,7 @@ function TrackListProvider({
|
|
|
1636
1823
|
})().catch(() => {
|
|
1637
1824
|
});
|
|
1638
1825
|
}
|
|
1639
|
-
}, [playback.key, trackList, selectedTrack, clearDelayedTrackLoad, playNewTrackListFromGenrePlaylist, playNewTrackListFromArtist, schema, fetch]);
|
|
1826
|
+
}, [playback.key, trackList, selectedTrack, clearDelayedTrackLoad, playNewTrackListFromGenrePlaylist, playNewTrackListFromArtist, playNewTrackListFromGenreCatalogue, schema, fetch]);
|
|
1640
1827
|
const updateTrack = useCallback4((track) => {
|
|
1641
1828
|
setTrackList((prev) => {
|
|
1642
1829
|
if (!prev || !prev.tracks.some((listed) => listed.uuid === track.uuid)) return prev;
|
|
@@ -1648,22 +1835,22 @@ function TrackListProvider({
|
|
|
1648
1835
|
const loadMore = useCallback4(async () => {
|
|
1649
1836
|
if (!trackList || trackList.nextPage === null) return;
|
|
1650
1837
|
const origin = trackList.origin;
|
|
1651
|
-
if (!(origin instanceof TrackListOriginFromCriteriaPlaylist || origin instanceof TrackListOriginFromArtist)) return;
|
|
1838
|
+
if (!(origin instanceof TrackListOriginFromCriteriaPlaylist || origin instanceof TrackListOriginFromArtist || origin instanceof TrackListOriginFromGenreCatalogue)) return;
|
|
1652
1839
|
if (loadingOriginRef.current === origin) return;
|
|
1653
1840
|
const requestedPage = trackList.nextPage;
|
|
1654
1841
|
loadingOriginRef.current = origin;
|
|
1655
1842
|
try {
|
|
1656
|
-
const page = origin instanceof TrackListOriginFromArtist ? await
|
|
1843
|
+
const page = origin instanceof TrackListOriginFromArtist || origin instanceof TrackListOriginFromGenreCatalogue ? await fetchCatalogueTracksPage(origin, requestedPage) : await fetchTracksPage(origin.criteriaPlaylist.uuid, origin.scope, requestedPage, origin.from, origin.selection, origin.artistUuid);
|
|
1657
1844
|
setTrackList((prev) => {
|
|
1658
1845
|
if (prev?.origin !== origin || prev.nextPage !== requestedPage) return prev;
|
|
1659
1846
|
const loaded = new Set(prev.tracks.map((track) => track.uuid));
|
|
1660
1847
|
const tracks = [...prev.tracks, ...page.tracks.filter((track) => !loaded.has(track.uuid))];
|
|
1661
|
-
return origin instanceof TrackListOriginFromArtist ? new TrackListFromArtist(tracks, origin, page.total, page.nextPage) : new TrackListFromCriteriaPlaylist(tracks, origin, page.total, page.nextPage);
|
|
1848
|
+
return origin instanceof TrackListOriginFromArtist ? new TrackListFromArtist(tracks, origin, page.total, page.nextPage) : origin instanceof TrackListOriginFromGenreCatalogue ? new TrackList(tracks, origin, page.total, page.nextPage) : new TrackListFromCriteriaPlaylist(tracks, origin, page.total, page.nextPage);
|
|
1662
1849
|
});
|
|
1663
1850
|
} finally {
|
|
1664
1851
|
if (loadingOriginRef.current === origin) loadingOriginRef.current = null;
|
|
1665
1852
|
}
|
|
1666
|
-
}, [trackList, fetchTracksPage,
|
|
1853
|
+
}, [trackList, fetchTracksPage, fetchCatalogueTracksPage]);
|
|
1667
1854
|
const selectedTrackIndex = trackList?.tracks.findIndex((track) => track.uuid === selectedTrack?.uuid) ?? -1;
|
|
1668
1855
|
const nextTrack = trackList && selectedTrackIndex >= 0 ? trackList.tracks.slice(selectedTrackIndex + 1).find((track) => isTrackPlayable(track, runtimeUnplayableTrackIds, hasPlaybackFailure)) ?? null : null;
|
|
1669
1856
|
const previousTrack = trackList && selectedTrackIndex > 0 ? trackList.tracks.slice(0, selectedTrackIndex).reverse().find((track) => isTrackPlayable(track, runtimeUnplayableTrackIds, hasPlaybackFailure)) ?? null : null;
|
|
@@ -1736,7 +1923,7 @@ function TrackListProvider({
|
|
|
1736
1923
|
loadMore().catch((error) => console.error("Failed to load more tracks:", error));
|
|
1737
1924
|
}
|
|
1738
1925
|
}, [trackList, selectedTrack, loadMore]);
|
|
1739
|
-
const value =
|
|
1926
|
+
const value = useMemo5(
|
|
1740
1927
|
() => ({
|
|
1741
1928
|
trackList,
|
|
1742
1929
|
selectedTrack,
|
|
@@ -1751,6 +1938,7 @@ function TrackListProvider({
|
|
|
1751
1938
|
playNewTrackListFromTrackUuid,
|
|
1752
1939
|
playNewTrackListFromGenrePlaylist,
|
|
1753
1940
|
playNewTrackListFromArtist,
|
|
1941
|
+
playNewTrackListFromGenreCatalogue,
|
|
1754
1942
|
fetchGenrePlaylistTracksPage: fetchTracksPage,
|
|
1755
1943
|
loadMore,
|
|
1756
1944
|
updateTrack
|
|
@@ -1768,6 +1956,7 @@ function TrackListProvider({
|
|
|
1768
1956
|
playNewTrackListFromTrackUuid,
|
|
1769
1957
|
playNewTrackListFromGenrePlaylist,
|
|
1770
1958
|
playNewTrackListFromArtist,
|
|
1959
|
+
playNewTrackListFromGenreCatalogue,
|
|
1771
1960
|
fetchTracksPage,
|
|
1772
1961
|
loadMore,
|
|
1773
1962
|
updateTrack
|
|
@@ -1798,24 +1987,24 @@ function ArtistNames({
|
|
|
1798
1987
|
}
|
|
1799
1988
|
|
|
1800
1989
|
// src/genre-tree/schemas/mb-artist.ts
|
|
1801
|
-
import { z as
|
|
1802
|
-
var MbArtistDetailedSchema =
|
|
1803
|
-
musicbrainzId:
|
|
1804
|
-
name:
|
|
1990
|
+
import { z as z31 } from "zod";
|
|
1991
|
+
var MbArtistDetailedSchema = z31.object({
|
|
1992
|
+
musicbrainzId: z31.string().uuid(),
|
|
1993
|
+
name: z31.string(),
|
|
1805
1994
|
musicbrainzLink: HttpUrlSchema
|
|
1806
1995
|
});
|
|
1807
1996
|
|
|
1808
1997
|
// src/genre-tree/schemas/mb-recording.ts
|
|
1809
|
-
import { z as
|
|
1810
|
-
var MbRecordingDetailedSchema =
|
|
1811
|
-
musicbrainzId:
|
|
1812
|
-
title:
|
|
1813
|
-
score:
|
|
1814
|
-
musicbrainzArtists:
|
|
1998
|
+
import { z as z32 } from "zod";
|
|
1999
|
+
var MbRecordingDetailedSchema = z32.object({
|
|
2000
|
+
musicbrainzId: z32.string().uuid(),
|
|
2001
|
+
title: z32.string(),
|
|
2002
|
+
score: z32.number(),
|
|
2003
|
+
musicbrainzArtists: z32.array(MbArtistDetailedSchema),
|
|
1815
2004
|
musicbrainzLink: HttpUrlSchema,
|
|
1816
|
-
durationInSec:
|
|
1817
|
-
durationStrInHourMinSec:
|
|
1818
|
-
releaseDate:
|
|
2005
|
+
durationInSec: z32.number().min(0).nullable().optional(),
|
|
2006
|
+
durationStrInHourMinSec: z32.string().nullable().optional(),
|
|
2007
|
+
releaseDate: z32.union([z32.string().datetime(), z32.string()]).transform((val) => {
|
|
1819
2008
|
try {
|
|
1820
2009
|
const date = new Date(val);
|
|
1821
2010
|
if (isNaN(date.getTime())) {
|
|
@@ -1845,6 +2034,9 @@ var capitalizeFirstLetter = (string) => {
|
|
|
1845
2034
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
1846
2035
|
};
|
|
1847
2036
|
|
|
2037
|
+
// src/genre-tree/lib/genre-search.ts
|
|
2038
|
+
var searchGenrePlaylistsByName = (genrePlaylists, query) => rankByName(genrePlaylists, query, (genrePlaylist) => genrePlaylist.name, (genrePlaylist) => genrePlaylist.viewsCount ?? 0);
|
|
2039
|
+
|
|
1848
2040
|
// src/genre-tree/lib/reparent-candidates.ts
|
|
1849
2041
|
var hasCriteria = (genrePlaylist) => genrePlaylist.criteria !== null;
|
|
1850
2042
|
var getReparentCandidates = (genrePlaylists, genrePlaylistUuid) => {
|
|
@@ -1881,26 +2073,39 @@ function editGenreSongPages(data, edit) {
|
|
|
1881
2073
|
}
|
|
1882
2074
|
|
|
1883
2075
|
export {
|
|
1884
|
-
CriteriaMinimumSchema,
|
|
1885
2076
|
CriteriaPlaylistMinimumSchema,
|
|
2077
|
+
SubgenreCountsSchema,
|
|
2078
|
+
GenreCountsSchema,
|
|
2079
|
+
GenreCatalogueCountsSchema,
|
|
2080
|
+
GenrePlaylistSummarySchema,
|
|
2081
|
+
GenreCoverageSchema,
|
|
2082
|
+
SubgenreScopeSchema,
|
|
2083
|
+
CriteriaMinimumSchema,
|
|
2084
|
+
ArtistMinimumSchema,
|
|
2085
|
+
AlbumMinimumSchema,
|
|
2086
|
+
UuidResourceSchema,
|
|
2087
|
+
TrackBaseSchema,
|
|
2088
|
+
TrackMinimumSchema,
|
|
2089
|
+
CriteriaLineageRelWithoutAscendantSchema,
|
|
2090
|
+
CriteriaLineageRelWithoutDescendantSchema,
|
|
2091
|
+
CriteriaDetailedSchema,
|
|
1886
2092
|
CriteriaPlaylistDetailedSchema,
|
|
1887
2093
|
CriteriaPlaylistSimpleSchema,
|
|
2094
|
+
ReferenceGenreDetailedSchema,
|
|
2095
|
+
ReferenceGenrePlaylistSchema,
|
|
1888
2096
|
genrePlaylistQueryKeys,
|
|
1889
2097
|
genrePlaylistEndpoints,
|
|
2098
|
+
defaultGenreMusicSelection,
|
|
2099
|
+
genreMusicCount,
|
|
2100
|
+
genreMusicQueryParams,
|
|
2101
|
+
genreMusicSelectionKey,
|
|
2102
|
+
genrePlaylistTrackCount,
|
|
1890
2103
|
libraryQueryKeys,
|
|
1891
2104
|
libraryEndpoints,
|
|
1892
2105
|
useListGenrePlaylists,
|
|
1893
2106
|
useListFullGenrePlaylists,
|
|
1894
2107
|
useFetchGenrePlaylist,
|
|
1895
2108
|
useInvalidateAllGenrePlaylistQueries,
|
|
1896
|
-
ArtistMinimumSchema,
|
|
1897
|
-
AlbumMinimumSchema,
|
|
1898
|
-
UuidResourceSchema,
|
|
1899
|
-
TrackBaseSchema,
|
|
1900
|
-
TrackMinimumSchema,
|
|
1901
|
-
CriteriaLineageRelWithoutAscendantSchema,
|
|
1902
|
-
CriteriaLineageRelWithoutDescendantSchema,
|
|
1903
|
-
CriteriaDetailedSchema,
|
|
1904
2109
|
CriteriaOverviewSchema,
|
|
1905
2110
|
CriteriaSimpleSchema,
|
|
1906
2111
|
CriteriaCreationSchema,
|
|
@@ -1951,7 +2156,8 @@ export {
|
|
|
1951
2156
|
trigramSimilarity,
|
|
1952
2157
|
FUZZY_MIN_SIMILARITY,
|
|
1953
2158
|
rankByName,
|
|
1954
|
-
|
|
2159
|
+
createNameIndex,
|
|
2160
|
+
rankNameIndex,
|
|
1955
2161
|
useSearchQueryState,
|
|
1956
2162
|
useGenreSearch,
|
|
1957
2163
|
GenreSearchTreeNameSchema,
|
|
@@ -1977,6 +2183,7 @@ export {
|
|
|
1977
2183
|
TrackListOriginFromTrack,
|
|
1978
2184
|
TrackListOriginFromCriteriaPlaylist,
|
|
1979
2185
|
TrackListOriginFromArtist,
|
|
2186
|
+
TrackListOriginFromGenreCatalogue,
|
|
1980
2187
|
TrackListSidebarVisibilityProvider,
|
|
1981
2188
|
useTrackListSidebarVisibility,
|
|
1982
2189
|
useListTracks,
|
|
@@ -1988,7 +2195,8 @@ export {
|
|
|
1988
2195
|
FORM_RATING_NULL_VALUE,
|
|
1989
2196
|
formatTime,
|
|
1990
2197
|
capitalizeFirstLetter,
|
|
2198
|
+
searchGenrePlaylistsByName,
|
|
1991
2199
|
getReparentCandidates,
|
|
1992
2200
|
editGenreSongPages
|
|
1993
2201
|
};
|
|
1994
|
-
//# sourceMappingURL=chunk-
|
|
2202
|
+
//# sourceMappingURL=chunk-QZXZHP4R.js.map
|