@behindthemusictree/app-kit 41.0.0 → 42.0.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-4E3YMYDH.js → chunk-QNBZQZEL.js} +119 -107
- package/dist/chunk-QNBZQZEL.js.map +1 -0
- package/dist/chunk-RGHDVBEY.js +26 -0
- package/dist/chunk-RGHDVBEY.js.map +1 -0
- package/dist/genre-tree/index.cjs +135 -109
- package/dist/genre-tree/index.cjs.map +1 -1
- package/dist/genre-tree/index.d.ts +38 -6
- package/dist/genre-tree/index.js +13 -3
- package/dist/genre-tree/testing.cjs +11 -0
- package/dist/genre-tree/testing.cjs.map +1 -1
- package/dist/genre-tree/testing.d.ts +1 -1
- package/dist/genre-tree/testing.js +1 -1
- package/dist/ids-FmUQ8DVM.d.ts +18 -0
- package/dist/index.cjs +133 -107
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -3
- package/package.json +1 -1
- package/dist/chunk-4E3YMYDH.js.map +0 -1
- package/dist/chunk-X2QEQR6H.js +0 -15
- package/dist/chunk-X2QEQR6H.js.map +0 -1
- package/dist/ids-D7EDBsbJ.d.ts +0 -10
package/dist/index.cjs
CHANGED
|
@@ -29,8 +29,10 @@ __export(src_exports, {
|
|
|
29
29
|
ArtistImageSchema: () => ArtistImageSchema,
|
|
30
30
|
ArtistMinimumSchema: () => ArtistMinimumSchema,
|
|
31
31
|
ArtistNames: () => ArtistNames,
|
|
32
|
+
ArtistOriginSchema: () => ArtistOriginSchema,
|
|
32
33
|
ArtistSearchResultSchema: () => ArtistSearchResultSchema,
|
|
33
34
|
ArtistSearchResultsSchema: () => ArtistSearchResultsSchema,
|
|
35
|
+
ArtistUuidSchema: () => ArtistUuidSchema,
|
|
34
36
|
AudioMediaController: () => AudioMediaController,
|
|
35
37
|
AuthRequired: () => AuthRequired,
|
|
36
38
|
BackendError: () => BackendError,
|
|
@@ -92,6 +94,7 @@ __export(src_exports, {
|
|
|
92
94
|
SongHistorySchema: () => SongHistorySchema,
|
|
93
95
|
SongSearchResultSchema: () => SongSearchResultSchema,
|
|
94
96
|
SongSearchResultsSchema: () => SongSearchResultsSchema,
|
|
97
|
+
SongUuidSchema: () => SongUuidSchema,
|
|
95
98
|
SubgenreCountsSchema: () => SubgenreCountsSchema,
|
|
96
99
|
SubgenreScopeSchema: () => SubgenreScopeSchema,
|
|
97
100
|
TrackBaseSchema: () => TrackBaseSchema,
|
|
@@ -168,8 +171,10 @@ __export(src_exports, {
|
|
|
168
171
|
setSpotifyRequiredCached: () => setSpotifyRequiredCached,
|
|
169
172
|
songUnplayableReason: () => songUnplayableReason,
|
|
170
173
|
storeRedirectUrl: () => storeRedirectUrl,
|
|
174
|
+
toArtistUuid: () => toArtistUuid,
|
|
171
175
|
toGenreUuid: () => toGenreUuid,
|
|
172
176
|
toResourceResult: () => toResourceResult,
|
|
177
|
+
toSongUuid: () => toSongUuid,
|
|
173
178
|
trigramSimilarity: () => trigramSimilarity,
|
|
174
179
|
useArtist: () => useArtist,
|
|
175
180
|
useArtistGenreCounts: () => useArtistGenreCounts,
|
|
@@ -2105,10 +2110,17 @@ var import_zod6 = require("zod");
|
|
|
2105
2110
|
var import_zod5 = require("zod");
|
|
2106
2111
|
var GenreUuidSchema = import_zod5.z.string().uuid().brand();
|
|
2107
2112
|
var GenrePlaylistUuidSchema = import_zod5.z.string().uuid().brand();
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2113
|
+
var ArtistUuidSchema = import_zod5.z.string().uuid().brand();
|
|
2114
|
+
var SongUuidSchema = import_zod5.z.string().uuid().brand();
|
|
2115
|
+
function toId(schema) {
|
|
2116
|
+
return (value) => {
|
|
2117
|
+
const parsed = schema.safeParse(value);
|
|
2118
|
+
return parsed.success ? parsed.data : null;
|
|
2119
|
+
};
|
|
2111
2120
|
}
|
|
2121
|
+
var toGenreUuid = toId(GenreUuidSchema);
|
|
2122
|
+
var toArtistUuid = toId(ArtistUuidSchema);
|
|
2123
|
+
var toSongUuid = toId(SongUuidSchema);
|
|
2112
2124
|
|
|
2113
2125
|
// src/genre-tree/schemas/criteria-playlist/minimum.ts
|
|
2114
2126
|
var CriteriaPlaylistMinimumSchema = import_zod6.z.object({
|
|
@@ -2730,9 +2742,6 @@ function useDeleteGenre(scope, getBackendBaseUrl) {
|
|
|
2730
2742
|
});
|
|
2731
2743
|
}
|
|
2732
2744
|
|
|
2733
|
-
// src/genre-tree/useArtist.ts
|
|
2734
|
-
var import_zod27 = require("zod");
|
|
2735
|
-
|
|
2736
2745
|
// src/genre-tree/schemas/artist-detailed.ts
|
|
2737
2746
|
var import_zod26 = require("zod");
|
|
2738
2747
|
var ArtistMembershipSchema = import_zod26.z.object({
|
|
@@ -2754,6 +2763,15 @@ var ARTIST_LINK_KINDS = [
|
|
|
2754
2763
|
"social"
|
|
2755
2764
|
];
|
|
2756
2765
|
var ArtistImageSchema = CommonsImageSchema;
|
|
2766
|
+
var ArtistOriginSchema = import_zod26.z.object({
|
|
2767
|
+
name: import_zod26.z.string(),
|
|
2768
|
+
kind: import_zod26.z.string(),
|
|
2769
|
+
source: import_zod26.z.enum(["begin_area", "area"]),
|
|
2770
|
+
wikidataId: import_zod26.z.string().nullable(),
|
|
2771
|
+
longitude: import_zod26.z.number().nullable(),
|
|
2772
|
+
latitude: import_zod26.z.number().nullable(),
|
|
2773
|
+
regionId: import_zod26.z.string().nullable()
|
|
2774
|
+
});
|
|
2757
2775
|
var ArtistDetailedSchema = import_zod26.z.object({
|
|
2758
2776
|
uuid: import_zod26.z.string().uuid(),
|
|
2759
2777
|
name: import_zod26.z.string(),
|
|
@@ -2777,7 +2795,8 @@ var ArtistDetailedSchema = import_zod26.z.object({
|
|
|
2777
2795
|
),
|
|
2778
2796
|
tracksCount: import_zod26.z.number().int(),
|
|
2779
2797
|
playableTracksCount: import_zod26.z.number().int(),
|
|
2780
|
-
image: ArtistImageSchema.nullable()
|
|
2798
|
+
image: ArtistImageSchema.nullable(),
|
|
2799
|
+
origin: ArtistOriginSchema.nullable()
|
|
2781
2800
|
});
|
|
2782
2801
|
|
|
2783
2802
|
// src/genre-tree/api/artists/queryKeys.ts
|
|
@@ -2798,10 +2817,11 @@ var artistEndpoints = {
|
|
|
2798
2817
|
// src/genre-tree/useArtist.ts
|
|
2799
2818
|
function useArtist(uuid, getBackendBaseUrl) {
|
|
2800
2819
|
const { fetch: fetch2 } = useFetchWrapper(getBackendBaseUrl);
|
|
2801
|
-
const
|
|
2820
|
+
const id = toArtistUuid(uuid);
|
|
2821
|
+
const isUuid = id !== null;
|
|
2802
2822
|
const { data, isPending, error } = useQueryWithParse({
|
|
2803
|
-
queryKey: artistQueryKeys.detail(
|
|
2804
|
-
queryFn: () => fetch2(artistEndpoints.detail(
|
|
2823
|
+
queryKey: artistQueryKeys.detail(id),
|
|
2824
|
+
queryFn: () => fetch2(artistEndpoints.detail(id), true, false),
|
|
2805
2825
|
schema: ArtistDetailedSchema,
|
|
2806
2826
|
enabled: isUuid,
|
|
2807
2827
|
retry: resourceRetry,
|
|
@@ -2812,19 +2832,19 @@ function useArtist(uuid, getBackendBaseUrl) {
|
|
|
2812
2832
|
}
|
|
2813
2833
|
|
|
2814
2834
|
// src/genre-tree/schemas/artist-search.ts
|
|
2815
|
-
var
|
|
2816
|
-
var ArtistSearchResultSchema =
|
|
2817
|
-
uuid:
|
|
2818
|
-
name:
|
|
2819
|
-
disambiguation:
|
|
2820
|
-
type:
|
|
2821
|
-
country:
|
|
2822
|
-
beginYear:
|
|
2823
|
-
endYear:
|
|
2824
|
-
matchedAlias:
|
|
2825
|
-
recordingCount:
|
|
2835
|
+
var import_zod27 = require("zod");
|
|
2836
|
+
var ArtistSearchResultSchema = import_zod27.z.object({
|
|
2837
|
+
uuid: import_zod27.z.string().uuid(),
|
|
2838
|
+
name: import_zod27.z.string(),
|
|
2839
|
+
disambiguation: import_zod27.z.string().nullable(),
|
|
2840
|
+
type: import_zod27.z.enum(["person", "group", "orchestra", "choir", "character", "other"]).nullable(),
|
|
2841
|
+
country: import_zod27.z.string().nullable(),
|
|
2842
|
+
beginYear: import_zod27.z.number().int().nullable(),
|
|
2843
|
+
endYear: import_zod27.z.number().int().nullable(),
|
|
2844
|
+
matchedAlias: import_zod27.z.string().nullable(),
|
|
2845
|
+
recordingCount: import_zod27.z.number().int()
|
|
2826
2846
|
});
|
|
2827
|
-
var ArtistSearchResultsSchema =
|
|
2847
|
+
var ArtistSearchResultsSchema = import_zod27.z.array(ArtistSearchResultSchema);
|
|
2828
2848
|
|
|
2829
2849
|
// src/genre-tree/useRemoteSearch.ts
|
|
2830
2850
|
var import_react_query6 = require("@tanstack/react-query");
|
|
@@ -2878,11 +2898,8 @@ function useArtistSearch(getBackendBaseUrl, text) {
|
|
|
2878
2898
|
return { artists: results, isError, settled, pending };
|
|
2879
2899
|
}
|
|
2880
2900
|
|
|
2881
|
-
// src/genre-tree/useSong.ts
|
|
2882
|
-
var import_zod30 = require("zod");
|
|
2883
|
-
|
|
2884
2901
|
// src/genre-tree/schemas/song/detailed.ts
|
|
2885
|
-
var
|
|
2902
|
+
var import_zod28 = require("zod");
|
|
2886
2903
|
var YOUTUBE_UNPLAYABLE_REASON_LABELS = {
|
|
2887
2904
|
not_found: "Video unavailable",
|
|
2888
2905
|
not_embeddable: "Embedding disabled",
|
|
@@ -2891,23 +2908,23 @@ var YOUTUBE_UNPLAYABLE_REASON_LABELS = {
|
|
|
2891
2908
|
region_whitelisted: "Region restricted"
|
|
2892
2909
|
};
|
|
2893
2910
|
var YOUTUBE_UNPLAYABLE_REASONS = Object.keys(YOUTUBE_UNPLAYABLE_REASON_LABELS);
|
|
2894
|
-
var YoutubeAvailabilitySchema =
|
|
2895
|
-
status:
|
|
2896
|
-
reason:
|
|
2897
|
-
country:
|
|
2911
|
+
var YoutubeAvailabilitySchema = import_zod28.z.object({
|
|
2912
|
+
status: import_zod28.z.enum(["eligible", "blocked", "unknown"]),
|
|
2913
|
+
reason: import_zod28.z.string().nullable(),
|
|
2914
|
+
country: import_zod28.z.string().nullable()
|
|
2898
2915
|
});
|
|
2899
2916
|
var SongDetailedSchema = TrackBaseSchema.extend({
|
|
2900
|
-
youtubeVideo:
|
|
2901
|
-
id:
|
|
2917
|
+
youtubeVideo: import_zod28.z.object({
|
|
2918
|
+
id: import_zod28.z.string(),
|
|
2902
2919
|
availability: YoutubeAvailabilitySchema.optional(),
|
|
2903
2920
|
// null = playable
|
|
2904
|
-
unplayableReason:
|
|
2905
|
-
viewCount:
|
|
2921
|
+
unplayableReason: import_zod28.z.enum(YOUTUBE_UNPLAYABLE_REASONS).nullable(),
|
|
2922
|
+
viewCount: import_zod28.z.number().int().nullable().optional()
|
|
2906
2923
|
}).nullable(),
|
|
2907
2924
|
// null for hand-made/admin songs
|
|
2908
|
-
musicbrainzRecordingId:
|
|
2909
|
-
firstReleaseYear:
|
|
2910
|
-
essentialGenres:
|
|
2925
|
+
musicbrainzRecordingId: import_zod28.z.string().uuid().nullable(),
|
|
2926
|
+
firstReleaseYear: import_zod28.z.number().int().nullable().optional(),
|
|
2927
|
+
essentialGenres: import_zod28.z.array(CriteriaMinimumSchema).optional()
|
|
2911
2928
|
});
|
|
2912
2929
|
var NO_VIDEO_LABEL = "No video available";
|
|
2913
2930
|
function isSong(track) {
|
|
@@ -2925,11 +2942,12 @@ function musicBrainzRecordingUrl(song) {
|
|
|
2925
2942
|
|
|
2926
2943
|
// src/genre-tree/useSong.ts
|
|
2927
2944
|
function useSong(uuid, getBackendBaseUrl) {
|
|
2928
|
-
const
|
|
2945
|
+
const id = toSongUuid(uuid);
|
|
2946
|
+
const isUuid = id !== null;
|
|
2929
2947
|
const { data, isPending, error } = usePlaybackQuery({
|
|
2930
2948
|
getBackendBaseUrl,
|
|
2931
|
-
queryKey: libraryQueryKeys.reference.songs.detail(
|
|
2932
|
-
queryFn: (fetchBound, { signal }) => fetchBound(libraryEndpoints.reference.songs.detail(
|
|
2949
|
+
queryKey: libraryQueryKeys.reference.songs.detail(id),
|
|
2950
|
+
queryFn: (fetchBound, { signal }) => fetchBound(libraryEndpoints.reference.songs.detail(id), true, false, { signal }),
|
|
2933
2951
|
schema: SongDetailedSchema,
|
|
2934
2952
|
enabled: isUuid,
|
|
2935
2953
|
retry: resourceRetry,
|
|
@@ -2940,24 +2958,25 @@ function useSong(uuid, getBackendBaseUrl) {
|
|
|
2940
2958
|
}
|
|
2941
2959
|
|
|
2942
2960
|
// src/genre-tree/schemas/song-history.ts
|
|
2943
|
-
var
|
|
2944
|
-
var SongHistoryEntrySchema =
|
|
2945
|
-
uuid:
|
|
2946
|
-
action:
|
|
2947
|
-
actorPseudo:
|
|
2948
|
-
oldValue:
|
|
2949
|
-
newValue:
|
|
2950
|
-
createdOn:
|
|
2961
|
+
var import_zod29 = require("zod");
|
|
2962
|
+
var SongHistoryEntrySchema = import_zod29.z.object({
|
|
2963
|
+
uuid: import_zod29.z.string().uuid(),
|
|
2964
|
+
action: import_zod29.z.string(),
|
|
2965
|
+
actorPseudo: import_zod29.z.string().nullable(),
|
|
2966
|
+
oldValue: import_zod29.z.string().nullable(),
|
|
2967
|
+
newValue: import_zod29.z.string().nullable(),
|
|
2968
|
+
createdOn: import_zod29.z.string()
|
|
2951
2969
|
});
|
|
2952
|
-
var SongHistorySchema =
|
|
2970
|
+
var SongHistorySchema = import_zod29.z.array(SongHistoryEntrySchema);
|
|
2953
2971
|
|
|
2954
2972
|
// src/genre-tree/useSongHistory.ts
|
|
2955
2973
|
function useSongHistory(uuid, getBackendBaseUrl, enabled) {
|
|
2956
|
-
const
|
|
2974
|
+
const id = toSongUuid(uuid);
|
|
2975
|
+
const active = enabled && id !== null;
|
|
2957
2976
|
const { data, isPending, error } = usePlaybackQuery({
|
|
2958
2977
|
getBackendBaseUrl,
|
|
2959
|
-
queryKey: libraryQueryKeys.reference.songs.history(
|
|
2960
|
-
queryFn: (fetchBound, { signal }) => fetchBound(libraryEndpoints.reference.songs.history(
|
|
2978
|
+
queryKey: libraryQueryKeys.reference.songs.history(id),
|
|
2979
|
+
queryFn: (fetchBound, { signal }) => fetchBound(libraryEndpoints.reference.songs.history(id), true, false, { signal }),
|
|
2961
2980
|
schema: SongHistorySchema,
|
|
2962
2981
|
enabled: active,
|
|
2963
2982
|
context: "useSongHistory"
|
|
@@ -2969,20 +2988,20 @@ function useSongHistory(uuid, getBackendBaseUrl, enabled) {
|
|
|
2969
2988
|
}
|
|
2970
2989
|
|
|
2971
2990
|
// src/genre-tree/schemas/song-search.ts
|
|
2972
|
-
var
|
|
2973
|
-
var SongSearchResultSchema =
|
|
2974
|
-
uuid:
|
|
2975
|
-
title:
|
|
2976
|
-
artists:
|
|
2991
|
+
var import_zod30 = require("zod");
|
|
2992
|
+
var SongSearchResultSchema = import_zod30.z.object({
|
|
2993
|
+
uuid: import_zod30.z.string().uuid(),
|
|
2994
|
+
title: import_zod30.z.string(),
|
|
2995
|
+
artists: import_zod30.z.array(ArtistMinimumSchema),
|
|
2977
2996
|
// null for songs not yet linked to a genre.
|
|
2978
2997
|
genre: CriteriaMinimumSchema.nullable(),
|
|
2979
|
-
youtubeVideo:
|
|
2980
|
-
id:
|
|
2981
|
-
unplayableReason:
|
|
2998
|
+
youtubeVideo: import_zod30.z.object({
|
|
2999
|
+
id: import_zod30.z.string(),
|
|
3000
|
+
unplayableReason: import_zod30.z.string().nullable()
|
|
2982
3001
|
}).nullable(),
|
|
2983
|
-
firstReleaseYear:
|
|
3002
|
+
firstReleaseYear: import_zod30.z.number().int().nullable()
|
|
2984
3003
|
});
|
|
2985
|
-
var SongSearchResultsSchema =
|
|
3004
|
+
var SongSearchResultsSchema = import_zod30.z.array(SongSearchResultSchema);
|
|
2986
3005
|
function isSongSearchResultPlayable(result) {
|
|
2987
3006
|
return result.youtubeVideo !== null && result.youtubeVideo.unplayableReason === null;
|
|
2988
3007
|
}
|
|
@@ -3010,18 +3029,18 @@ function useSongSearch(getBackendBaseUrl, text, options = {}) {
|
|
|
3010
3029
|
|
|
3011
3030
|
// src/genre-tree/useArtistGenreCounts.ts
|
|
3012
3031
|
var import_react_query7 = require("@tanstack/react-query");
|
|
3013
|
-
var
|
|
3032
|
+
var import_zod32 = require("zod");
|
|
3014
3033
|
|
|
3015
3034
|
// src/genre-tree/schemas/artist-genre-count.ts
|
|
3016
|
-
var
|
|
3017
|
-
var ArtistGenreCountSchema =
|
|
3035
|
+
var import_zod31 = require("zod");
|
|
3036
|
+
var ArtistGenreCountSchema = import_zod31.z.object({
|
|
3018
3037
|
...GenreCountsSchema.shape,
|
|
3019
3038
|
catalogue: GenreCatalogueCountsSchema,
|
|
3020
3039
|
genrePlaylist: GenrePlaylistUuidSchema,
|
|
3021
3040
|
/** Legacy catalogue count for the default selection. */
|
|
3022
|
-
songsCount:
|
|
3041
|
+
songsCount: import_zod31.z.number().int().nonnegative(),
|
|
3023
3042
|
/** Legacy playlist count for the default selection. */
|
|
3024
|
-
tracksCount:
|
|
3043
|
+
tracksCount: import_zod31.z.number().int().nonnegative()
|
|
3025
3044
|
}).superRefine((row, ctx) => {
|
|
3026
3045
|
const counts = GenreCatalogueCountsSchema.safeParse(row);
|
|
3027
3046
|
if (!counts.success) {
|
|
@@ -3034,11 +3053,12 @@ var ArtistGenreCountSchema = import_zod33.z.object({
|
|
|
3034
3053
|
// src/genre-tree/useArtistGenreCounts.ts
|
|
3035
3054
|
function useArtistGenreCounts(artistUuid, getBackendBaseUrl) {
|
|
3036
3055
|
const { fetch: fetch2 } = useFetchWrapper(getBackendBaseUrl);
|
|
3056
|
+
const id = toArtistUuid(artistUuid);
|
|
3037
3057
|
return useQueryWithParse({
|
|
3038
|
-
queryKey: [...artistQueryKeys.genreCounts(getBackendBaseUrl(),
|
|
3039
|
-
queryFn: () => fetch2(artistEndpoints.genreCounts(
|
|
3040
|
-
schema:
|
|
3041
|
-
enabled:
|
|
3058
|
+
queryKey: [...artistQueryKeys.genreCounts(getBackendBaseUrl(), id), "genreMusicV1"],
|
|
3059
|
+
queryFn: () => fetch2(artistEndpoints.genreCounts(id), true, false),
|
|
3060
|
+
schema: import_zod32.z.array(ArtistGenreCountSchema),
|
|
3061
|
+
enabled: id !== null,
|
|
3042
3062
|
placeholderData: import_react_query7.keepPreviousData,
|
|
3043
3063
|
retry: resourceRetry,
|
|
3044
3064
|
context: "useArtistGenreCounts"
|
|
@@ -3197,32 +3217,32 @@ function useGenreSearch({
|
|
|
3197
3217
|
}
|
|
3198
3218
|
|
|
3199
3219
|
// src/genre-tree/schemas/genre-search.ts
|
|
3200
|
-
var
|
|
3201
|
-
var GenreSearchTreeNameSchema =
|
|
3202
|
-
var GenreSearchResultSchema =
|
|
3220
|
+
var import_zod33 = require("zod");
|
|
3221
|
+
var GenreSearchTreeNameSchema = import_zod33.z.enum(["canonical", "regional"]);
|
|
3222
|
+
var GenreSearchResultSchema = import_zod33.z.object({
|
|
3203
3223
|
/** Criteria (genre) uuid. */
|
|
3204
3224
|
uuid: GenreUuidSchema,
|
|
3205
|
-
name:
|
|
3225
|
+
name: import_zod33.z.string(),
|
|
3206
3226
|
/** Null for app-created genres, which the Wikidata-keyed region index does not reference. */
|
|
3207
|
-
wikidataId:
|
|
3208
|
-
treeName:
|
|
3227
|
+
wikidataId: import_zod33.z.string().nullable(),
|
|
3228
|
+
treeName: import_zod33.z.string(),
|
|
3209
3229
|
/** Null when the genre has no playlist in the tree, so it cannot be opened there. */
|
|
3210
3230
|
genrePlaylistUuid: GenrePlaylistUuidSchema.nullable(),
|
|
3211
|
-
root:
|
|
3212
|
-
isUmbrella:
|
|
3213
|
-
viewsCount:
|
|
3231
|
+
root: import_zod33.z.object({ uuid: GenreUuidSchema, name: import_zod33.z.string() }),
|
|
3232
|
+
isUmbrella: import_zod33.z.boolean(),
|
|
3233
|
+
viewsCount: import_zod33.z.number().int()
|
|
3214
3234
|
});
|
|
3215
|
-
var GenreSearchResultsSchema =
|
|
3216
|
-
var RegionGenreLexiconEntrySchema =
|
|
3217
|
-
wikidataId:
|
|
3235
|
+
var GenreSearchResultsSchema = import_zod33.z.array(GenreSearchResultSchema);
|
|
3236
|
+
var RegionGenreLexiconEntrySchema = import_zod33.z.object({
|
|
3237
|
+
wikidataId: import_zod33.z.string(),
|
|
3218
3238
|
uuid: GenreUuidSchema,
|
|
3219
|
-
name:
|
|
3220
|
-
treeName:
|
|
3239
|
+
name: import_zod33.z.string(),
|
|
3240
|
+
treeName: import_zod33.z.string(),
|
|
3221
3241
|
genrePlaylistUuid: GenrePlaylistUuidSchema.nullable(),
|
|
3222
|
-
isUmbrella:
|
|
3223
|
-
viewsCount:
|
|
3242
|
+
isUmbrella: import_zod33.z.boolean(),
|
|
3243
|
+
viewsCount: import_zod33.z.number().int()
|
|
3224
3244
|
});
|
|
3225
|
-
var RegionGenreLexiconSchema =
|
|
3245
|
+
var RegionGenreLexiconSchema = import_zod33.z.array(RegionGenreLexiconEntrySchema);
|
|
3226
3246
|
|
|
3227
3247
|
// src/genre-tree/useGenreRemoteSearch.ts
|
|
3228
3248
|
var DEFAULT_RESULT_LIMIT2 = 8;
|
|
@@ -3302,9 +3322,10 @@ var projectGenrePlaylistsForArtist = (playlists, counts) => {
|
|
|
3302
3322
|
// src/genre-tree/useVisibleGenrePlaylists.ts
|
|
3303
3323
|
function useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid = null }) {
|
|
3304
3324
|
const { data: tree, isPending: isTreePending, isFetching: isTreeFetching, isError: isTreeError, refetch } = useListFullGenrePlaylists(scope, getBackendBaseUrl);
|
|
3305
|
-
const
|
|
3306
|
-
const
|
|
3307
|
-
const
|
|
3325
|
+
const validArtistUuid = toArtistUuid(artistUuid);
|
|
3326
|
+
const counts = useArtistGenreCounts(validArtistUuid, getBackendBaseUrl);
|
|
3327
|
+
const artistCounts = validArtistUuid !== null ? counts.data : void 0;
|
|
3328
|
+
const isCountsLoading = validArtistUuid !== null && (counts.isPending || counts.isPlaceholderData);
|
|
3308
3329
|
const projection = (0, import_react20.useMemo)(() => {
|
|
3309
3330
|
if (!tree) return { genrePlaylists: [], focusUuids: void 0 };
|
|
3310
3331
|
return artistCounts ? projectGenrePlaylistsForArtist(tree, artistCounts) : { genrePlaylists: tree, focusUuids: void 0 };
|
|
@@ -3444,10 +3465,10 @@ function useGenreTreeViewState({
|
|
|
3444
3465
|
var import_react23 = require("react");
|
|
3445
3466
|
|
|
3446
3467
|
// src/genre-tree/schemas/track-playlist-rel/without-playlist.ts
|
|
3447
|
-
var
|
|
3448
|
-
var makeTrackPlaylistRelSchema = (trackSchema) =>
|
|
3468
|
+
var import_zod34 = require("zod");
|
|
3469
|
+
var makeTrackPlaylistRelSchema = (trackSchema) => import_zod34.z.object({
|
|
3449
3470
|
track: trackSchema,
|
|
3450
|
-
position:
|
|
3471
|
+
position: import_zod34.z.number().min(0)
|
|
3451
3472
|
});
|
|
3452
3473
|
var makeTrackPlaylistRelPageSchema = (trackSchema) => PaginatedResponseSchema(makeTrackPlaylistRelSchema(trackSchema));
|
|
3453
3474
|
|
|
@@ -4086,24 +4107,24 @@ function ArtistNames({
|
|
|
4086
4107
|
}
|
|
4087
4108
|
|
|
4088
4109
|
// src/genre-tree/schemas/mb-artist.ts
|
|
4089
|
-
var
|
|
4090
|
-
var MbArtistDetailedSchema =
|
|
4091
|
-
musicbrainzId:
|
|
4092
|
-
name:
|
|
4110
|
+
var import_zod35 = require("zod");
|
|
4111
|
+
var MbArtistDetailedSchema = import_zod35.z.object({
|
|
4112
|
+
musicbrainzId: import_zod35.z.string().uuid(),
|
|
4113
|
+
name: import_zod35.z.string(),
|
|
4093
4114
|
musicbrainzLink: HttpUrlSchema
|
|
4094
4115
|
});
|
|
4095
4116
|
|
|
4096
4117
|
// src/genre-tree/schemas/mb-recording.ts
|
|
4097
|
-
var
|
|
4098
|
-
var MbRecordingDetailedSchema =
|
|
4099
|
-
musicbrainzId:
|
|
4100
|
-
title:
|
|
4101
|
-
score:
|
|
4102
|
-
musicbrainzArtists:
|
|
4118
|
+
var import_zod36 = require("zod");
|
|
4119
|
+
var MbRecordingDetailedSchema = import_zod36.z.object({
|
|
4120
|
+
musicbrainzId: import_zod36.z.string().uuid(),
|
|
4121
|
+
title: import_zod36.z.string(),
|
|
4122
|
+
score: import_zod36.z.number(),
|
|
4123
|
+
musicbrainzArtists: import_zod36.z.array(MbArtistDetailedSchema),
|
|
4103
4124
|
musicbrainzLink: HttpUrlSchema,
|
|
4104
|
-
durationInSec:
|
|
4105
|
-
durationStrInHourMinSec:
|
|
4106
|
-
releaseDate:
|
|
4125
|
+
durationInSec: import_zod36.z.number().min(0).nullable().optional(),
|
|
4126
|
+
durationStrInHourMinSec: import_zod36.z.string().nullable().optional(),
|
|
4127
|
+
releaseDate: import_zod36.z.union([import_zod36.z.string().datetime(), import_zod36.z.string()]).transform((val) => {
|
|
4107
4128
|
try {
|
|
4108
4129
|
const date = new Date(val);
|
|
4109
4130
|
if (isNaN(date.getTime())) {
|
|
@@ -4181,8 +4202,10 @@ function editGenreSongPages(data, edit) {
|
|
|
4181
4202
|
ArtistImageSchema,
|
|
4182
4203
|
ArtistMinimumSchema,
|
|
4183
4204
|
ArtistNames,
|
|
4205
|
+
ArtistOriginSchema,
|
|
4184
4206
|
ArtistSearchResultSchema,
|
|
4185
4207
|
ArtistSearchResultsSchema,
|
|
4208
|
+
ArtistUuidSchema,
|
|
4186
4209
|
AudioMediaController,
|
|
4187
4210
|
AuthRequired,
|
|
4188
4211
|
BackendError,
|
|
@@ -4244,6 +4267,7 @@ function editGenreSongPages(data, edit) {
|
|
|
4244
4267
|
SongHistorySchema,
|
|
4245
4268
|
SongSearchResultSchema,
|
|
4246
4269
|
SongSearchResultsSchema,
|
|
4270
|
+
SongUuidSchema,
|
|
4247
4271
|
SubgenreCountsSchema,
|
|
4248
4272
|
SubgenreScopeSchema,
|
|
4249
4273
|
TrackBaseSchema,
|
|
@@ -4320,8 +4344,10 @@ function editGenreSongPages(data, edit) {
|
|
|
4320
4344
|
setSpotifyRequiredCached,
|
|
4321
4345
|
songUnplayableReason,
|
|
4322
4346
|
storeRedirectUrl,
|
|
4347
|
+
toArtistUuid,
|
|
4323
4348
|
toGenreUuid,
|
|
4324
4349
|
toResourceResult,
|
|
4350
|
+
toSongUuid,
|
|
4325
4351
|
trigramSimilarity,
|
|
4326
4352
|
useArtist,
|
|
4327
4353
|
useArtistGenreCounts,
|