@behindthemusictree/app-kit 38.0.0 → 40.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/auth/index.cjs.map +1 -1
- package/dist/auth/index.js +2 -2
- package/dist/{chunk-7S6EALIP.js → chunk-AYAKFCBP.js} +2 -2
- package/dist/{chunk-XIJPC7D5.js → chunk-D5UFJF4K.js} +46 -32
- package/dist/chunk-D5UFJF4K.js.map +1 -0
- package/dist/{chunk-5YLNSX34.js → chunk-MF7SJIEY.js} +2 -2
- package/dist/{chunk-T5D5T52J.js → chunk-WL2TKQVN.js} +7 -1
- package/dist/chunk-WL2TKQVN.js.map +1 -0
- package/dist/genre-tree/index.cjs +51 -30
- package/dist/genre-tree/index.cjs.map +1 -1
- package/dist/genre-tree/index.d.ts +32 -15
- package/dist/genre-tree/index.js +7 -5
- package/dist/index.cjs +51 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -6
- package/dist/transport/index.cjs +6 -0
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-T5D5T52J.js.map +0 -1
- package/dist/chunk-XIJPC7D5.js.map +0 -1
- /package/dist/{chunk-7S6EALIP.js.map → chunk-AYAKFCBP.js.map} +0 -0
- /package/dist/{chunk-5YLNSX34.js.map → chunk-MF7SJIEY.js.map} +0 -0
|
@@ -3408,6 +3408,7 @@ declare const ArtistDetailedSchema: z.ZodObject<{
|
|
|
3408
3408
|
secondaryTypes: z.ZodArray<z.ZodString>;
|
|
3409
3409
|
}, z.core.$strip>>;
|
|
3410
3410
|
tracksCount: z.ZodNumber;
|
|
3411
|
+
playableTracksCount: z.ZodNumber;
|
|
3411
3412
|
image: z.ZodNullable<z.ZodObject<{
|
|
3412
3413
|
url: z.ZodURL;
|
|
3413
3414
|
pageUrl: z.ZodURL;
|
|
@@ -3962,7 +3963,7 @@ interface UseGenreTreeViewStateOptions<O extends CriteriaOverview = CriteriaOver
|
|
|
3962
3963
|
getBackendBaseUrl: () => string;
|
|
3963
3964
|
/** Controlled view mode; when provided the hook never changes it. */
|
|
3964
3965
|
viewMode?: GenreViewMode;
|
|
3965
|
-
/**
|
|
3966
|
+
/** Projects this artist onto the tree (see `useVisibleGenrePlaylists`). */
|
|
3966
3967
|
artistUuid?: string | null;
|
|
3967
3968
|
/** Entity selection is independent of the visible renderer nodes. */
|
|
3968
3969
|
selectedGenreUuid?: GenreUuid | null;
|
|
@@ -3974,9 +3975,11 @@ interface UseGenreTreeViewStateResult {
|
|
|
3974
3975
|
/** The tree failed to load and nothing is cached. `genrePlaylists` is empty, which is not "no genres". */
|
|
3975
3976
|
isError: boolean;
|
|
3976
3977
|
refetch: () => void;
|
|
3977
|
-
/** True while the visible tree is being refreshed or re-
|
|
3978
|
+
/** True while the visible tree is being refreshed or re-projected; the previous tree stays in `genrePlaylists`. */
|
|
3978
3979
|
isFetching: boolean;
|
|
3979
3980
|
genrePlaylists: CriteriaPlaylistSimple[];
|
|
3981
|
+
/** The open artist's footprint; undefined without an artist. Nodes outside it are rendered muted. */
|
|
3982
|
+
focusUuids: ReadonlySet<string> | undefined;
|
|
3980
3983
|
genrePlaylistByNodeId: Map<string, CriteriaPlaylistSimple>;
|
|
3981
3984
|
/** Playlists the current view mode may show: unaccepted roots and, outside stacked/outline, criteria-less playlists are hidden. */
|
|
3982
3985
|
visibleGenrePlaylists: CriteriaPlaylistSimple[];
|
|
@@ -4008,16 +4011,16 @@ declare function useGenreTreeViewState<O extends CriteriaOverview = CriteriaOver
|
|
|
4008
4011
|
interface UseVisibleGenrePlaylistsOptions {
|
|
4009
4012
|
scope: Scope;
|
|
4010
4013
|
getBackendBaseUrl: () => string;
|
|
4011
|
-
/** When set, the tree
|
|
4014
|
+
/** When set, the tree carries this artist's counts and `focusUuids` marks their footprint. */
|
|
4012
4015
|
artistUuid?: string | null;
|
|
4013
4016
|
}
|
|
4014
4017
|
/**
|
|
4015
|
-
* The tree the user can navigate: the whole canonical tree
|
|
4016
|
-
*
|
|
4017
|
-
*
|
|
4018
|
-
* `isFetching` is true; `isLoading`
|
|
4019
|
-
*
|
|
4020
|
-
* is shown.
|
|
4018
|
+
* The tree the user can navigate: always the whole canonical tree. When `artistUuid` is set it
|
|
4019
|
+
* carries the artist's counts and `focusUuids` names their footprint (undefined otherwise); genres
|
|
4020
|
+
* outside it stay navigable and renderers draw them muted. While the artist's counts load the
|
|
4021
|
+
* current tree stays (with the previous artist's projection) and `isFetching` is true; `isLoading`
|
|
4022
|
+
* is true only until the first tree arrives. If the counts fail (unknown artist, backend error) the
|
|
4023
|
+
* plain tree is served, the artist panel being where that failure is shown.
|
|
4021
4024
|
*/
|
|
4022
4025
|
declare function useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid }: UseVisibleGenrePlaylistsOptions): {
|
|
4023
4026
|
isLoading: boolean;
|
|
@@ -4109,6 +4112,7 @@ declare function useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid
|
|
|
4109
4112
|
isUmbrella?: boolean | undefined;
|
|
4110
4113
|
scene?: "commercial" | "underground" | null | undefined;
|
|
4111
4114
|
}[];
|
|
4115
|
+
focusUuids: ReadonlySet<string> | undefined;
|
|
4112
4116
|
};
|
|
4113
4117
|
|
|
4114
4118
|
declare const SubgenreCountsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -4276,6 +4280,13 @@ declare class TrackListFromArtist<T extends TrackBase = TrackBase> extends Track
|
|
|
4276
4280
|
constructor(tracks: T[], origin: TrackListOriginFromArtist, total: number, nextPage: number | null);
|
|
4277
4281
|
}
|
|
4278
4282
|
|
|
4283
|
+
/**
|
|
4284
|
+
* The tracks request failed and the global connectivity popup (or a newer request replacing this one) already
|
|
4285
|
+
* accounts for it; callers must not show a second popup.
|
|
4286
|
+
*/
|
|
4287
|
+
declare class TracksFailureAlreadyReportedError extends Error {
|
|
4288
|
+
constructor();
|
|
4289
|
+
}
|
|
4279
4290
|
declare function useListTracks<T>(scope: Scope | null, getBackendBaseUrl: () => string, schema: z.ZodType<T, unknown>, listEndpoint: (page: number) => string, listQueryKey: (page: number) => readonly unknown[], page?: number, pageSize?: number | string): _tanstack_react_query.UseQueryResult<NoInfer<{
|
|
4280
4291
|
overallTotal: number;
|
|
4281
4292
|
next: string | null;
|
|
@@ -4782,13 +4793,19 @@ declare const hasMainstreamPopRoot: (nodes: {
|
|
|
4782
4793
|
name: string;
|
|
4783
4794
|
}[]) => boolean;
|
|
4784
4795
|
|
|
4796
|
+
interface ArtistGenreProjection {
|
|
4797
|
+
/** Every canonical playlist, carrying the artist's counts (zero outside the footprint). */
|
|
4798
|
+
genrePlaylists: CriteriaPlaylistSimple[];
|
|
4799
|
+
/** The artist's footprint: renderers draw every other node muted instead of dropping it. */
|
|
4800
|
+
focusUuids: ReadonlySet<string>;
|
|
4801
|
+
}
|
|
4785
4802
|
/**
|
|
4786
|
-
*
|
|
4787
|
-
*
|
|
4788
|
-
*
|
|
4789
|
-
*
|
|
4803
|
+
* Projects an artist onto the canonical tree. No node is dropped: every playlist carries the
|
|
4804
|
+
* artist's counts (zero outside the footprint). The footprint is the nodes with songs in their
|
|
4805
|
+
* subtree, which includes every ancestor of such a node; an artist without genres has an empty
|
|
4806
|
+
* footprint. Since nothing is pruned, no structural node needs to be kept in focus.
|
|
4790
4807
|
*/
|
|
4791
|
-
declare const
|
|
4808
|
+
declare const projectGenrePlaylistsForArtist: (playlists: CriteriaPlaylistSimple[], counts: ArtistGenreCount[]) => ArtistGenreProjection;
|
|
4792
4809
|
|
|
4793
4810
|
/** Ranked, accent-insensitive name match (exact, prefix, substring, fuzzy). An empty/whitespace query matches nothing. */
|
|
4794
4811
|
declare const searchGenrePlaylistsByName: <T extends CriteriaPlaylistSimple>(genrePlaylists: T[], query: string) => T[];
|
|
@@ -4986,4 +5003,4 @@ declare const ReferenceGenrePlaylistSchema: z.ZodObject<{
|
|
|
4986
5003
|
type ReferenceGenreDetailed = z.infer<typeof ReferenceGenreDetailedSchema>;
|
|
4987
5004
|
type ReferenceGenrePlaylist = z.infer<typeof ReferenceGenrePlaylistSchema>;
|
|
4988
5005
|
|
|
4989
|
-
export { ARTIST_LINK_KINDS, type AlbumMinimum, AlbumMinimumSchema, type ArtistAlbum, type ArtistDetailed, ArtistDetailedSchema, type ArtistGenreCount, ArtistGenreCountSchema, type ArtistImage, ArtistImageSchema, type ArtistLink, type ArtistMembership, type ArtistMinimum, ArtistMinimumSchema, ArtistNames, type ArtistSearchResult, ArtistSearchResultSchema, ArtistSearchResultsSchema, type ArtistSongsOrdering, type ArtistTrackListOriginInput, CriteriaCreationSchema, type CriteriaCreationValues, type CriteriaDetailed, CriteriaDetailedSchema, type CriteriaLineageRelWithoutAscendant, CriteriaLineageRelWithoutAscendantSchema, type CriteriaLineageRelWithoutDescendant, CriteriaLineageRelWithoutDescendantSchema, type CriteriaMinimum, CriteriaMinimumSchema, type CriteriaOverview, CriteriaOverviewSchema, type CriteriaPlaylistDetailed, CriteriaPlaylistDetailedSchema, type CriteriaPlaylistMinimum, CriteriaPlaylistMinimumSchema, type CriteriaPlaylistSimple, CriteriaPlaylistSimpleSchema, type CriteriaSimple, CriteriaSimpleSchema, CriteriaUpdateSchema, type CriteriaUpdateValues, FORM_RATING_NULL_VALUE, FUZZY_MIN_SIMILARITY, type GenreCatalogueCounts, GenreCatalogueCountsSchema, GenreCountsSchema, type GenreCoverage, GenreCoverageSchema, type GenreMusicCounts, type GenreMusicSelection, type GenrePlaylistSummary, GenrePlaylistSummarySchema, type GenrePlaylistTracksPage, GenrePlaylistUuid, type GenreSearchParams, type GenreSearchResult, GenreSearchResultSchema, GenreSearchResultsSchema, type GenreSearchTreeName, GenreSearchTreeNameSchema, GenreUuid, type GenreViewMode, MbArtistDetailedSchema, MbRecordingDetailedSchema, type MusicbrainzArtistDetailed, type MusicbrainzRecordingDetailed, NO_VIDEO_LABEL, type NameIndex, type PlayArtistOptions, type PlayGenrePlaylistOptions, type ReferenceGenreDetailed, ReferenceGenreDetailedSchema, type ReferenceGenrePlaylist, ReferenceGenrePlaylistSchema, type RegionGenreLexiconEntry, RegionGenreLexiconEntrySchema, RegionGenreLexiconSchema, type RenderArtistLink, type RenderSongLink, type ReparentCandidate, SEARCH_DEBOUNCE_MS, SEARCH_QUERY_MIN_LENGTH, type SongDetailed, SongDetailedSchema, type SongHistoryEntry, SongHistoryEntrySchema, SongHistorySchema, type SongSearchGenreFilter, type SongSearchParams, type SongSearchResult, SongSearchResultSchema, SongSearchResultsSchema, SubgenreCountsSchema, type SubgenreScope, SubgenreScopeSchema, type TrackBase, TrackBaseSchema, TrackList, TrackListFromArtist, TrackListFromCriteriaPlaylist, TrackListFromTrack, TrackListOrigin, TrackListOriginFromArtist, TrackListOriginFromCriteriaPlaylist, TrackListOriginFromGenreCatalogue, TrackListOriginFromTrack, TrackListOriginType, TrackListProvider, TrackListSidebarVisibilityProvider, type TrackMinimum, TrackMinimumSchema, type TrackPlaylistRel, type UseArtistResult, type UseArtistSearchResult, type UseGenreRemoteSearchOptions, type UseGenreRemoteSearchResult, type UseGenreSearchOptions, type UseGenreSearchResult, type UseGenreTreeViewStateOptions, type UseGenreTreeViewStateResult, type UseRemoteSearchOptions, type UseRemoteSearchResult, type UseSearchQueryStateOptions, type UseSearchQueryStateResult, type UseSongHistoryResult, type UseSongResult, type UseSongSearchResult, type UseVisibleGenrePlaylistsOptions, type UuidResource, UuidResourceSchema, YOUTUBE_UNPLAYABLE_REASON_LABELS, YoutubeAvailabilitySchema, type YoutubeUnplayableReason, artistEndpoints, artistQueryKeys, capitalizeFirstLetter, createNameIndex, defaultGenreMusicSelection, editGenreSongPages, foldSearchText, formatTime, genreEndpoints, genreMusicCount, genreMusicQueryParams, genreMusicSelectionKey, genrePlaylistEndpoints, genrePlaylistQueryKeys, genrePlaylistTrackCount, genreQueryKeys, genreSearchQueryKeys, genreUpdateMutationKey, getGenrePlaylistsGroupedByRoot, getReparentCandidates, hasMainstreamPopRoot, isSong, isSongSearchResultPlayable, libraryEndpoints, libraryQueryKeys, makeTrackPlaylistRelPageSchema, makeTrackPlaylistRelSchema, musicBrainzRecordingUrl,
|
|
5006
|
+
export { ARTIST_LINK_KINDS, type AlbumMinimum, AlbumMinimumSchema, type ArtistAlbum, type ArtistDetailed, ArtistDetailedSchema, type ArtistGenreCount, ArtistGenreCountSchema, type ArtistGenreProjection, type ArtistImage, ArtistImageSchema, type ArtistLink, type ArtistMembership, type ArtistMinimum, ArtistMinimumSchema, ArtistNames, type ArtistSearchResult, ArtistSearchResultSchema, ArtistSearchResultsSchema, type ArtistSongsOrdering, type ArtistTrackListOriginInput, CriteriaCreationSchema, type CriteriaCreationValues, type CriteriaDetailed, CriteriaDetailedSchema, type CriteriaLineageRelWithoutAscendant, CriteriaLineageRelWithoutAscendantSchema, type CriteriaLineageRelWithoutDescendant, CriteriaLineageRelWithoutDescendantSchema, type CriteriaMinimum, CriteriaMinimumSchema, type CriteriaOverview, CriteriaOverviewSchema, type CriteriaPlaylistDetailed, CriteriaPlaylistDetailedSchema, type CriteriaPlaylistMinimum, CriteriaPlaylistMinimumSchema, type CriteriaPlaylistSimple, CriteriaPlaylistSimpleSchema, type CriteriaSimple, CriteriaSimpleSchema, CriteriaUpdateSchema, type CriteriaUpdateValues, FORM_RATING_NULL_VALUE, FUZZY_MIN_SIMILARITY, type GenreCatalogueCounts, GenreCatalogueCountsSchema, GenreCountsSchema, type GenreCoverage, GenreCoverageSchema, type GenreMusicCounts, type GenreMusicSelection, type GenrePlaylistSummary, GenrePlaylistSummarySchema, type GenrePlaylistTracksPage, GenrePlaylistUuid, type GenreSearchParams, type GenreSearchResult, GenreSearchResultSchema, GenreSearchResultsSchema, type GenreSearchTreeName, GenreSearchTreeNameSchema, GenreUuid, type GenreViewMode, MbArtistDetailedSchema, MbRecordingDetailedSchema, type MusicbrainzArtistDetailed, type MusicbrainzRecordingDetailed, NO_VIDEO_LABEL, type NameIndex, type PlayArtistOptions, type PlayGenrePlaylistOptions, type ReferenceGenreDetailed, ReferenceGenreDetailedSchema, type ReferenceGenrePlaylist, ReferenceGenrePlaylistSchema, type RegionGenreLexiconEntry, RegionGenreLexiconEntrySchema, RegionGenreLexiconSchema, type RenderArtistLink, type RenderSongLink, type ReparentCandidate, SEARCH_DEBOUNCE_MS, SEARCH_QUERY_MIN_LENGTH, type SongDetailed, SongDetailedSchema, type SongHistoryEntry, SongHistoryEntrySchema, SongHistorySchema, type SongSearchGenreFilter, type SongSearchParams, type SongSearchResult, SongSearchResultSchema, SongSearchResultsSchema, SubgenreCountsSchema, type SubgenreScope, SubgenreScopeSchema, type TrackBase, TrackBaseSchema, TrackList, TrackListFromArtist, TrackListFromCriteriaPlaylist, TrackListFromTrack, TrackListOrigin, TrackListOriginFromArtist, TrackListOriginFromCriteriaPlaylist, TrackListOriginFromGenreCatalogue, TrackListOriginFromTrack, TrackListOriginType, TrackListProvider, TrackListSidebarVisibilityProvider, type TrackMinimum, TrackMinimumSchema, type TrackPlaylistRel, TracksFailureAlreadyReportedError, type UseArtistResult, type UseArtistSearchResult, type UseGenreRemoteSearchOptions, type UseGenreRemoteSearchResult, type UseGenreSearchOptions, type UseGenreSearchResult, type UseGenreTreeViewStateOptions, type UseGenreTreeViewStateResult, type UseRemoteSearchOptions, type UseRemoteSearchResult, type UseSearchQueryStateOptions, type UseSearchQueryStateResult, type UseSongHistoryResult, type UseSongResult, type UseSongSearchResult, type UseVisibleGenrePlaylistsOptions, type UuidResource, UuidResourceSchema, YOUTUBE_UNPLAYABLE_REASON_LABELS, YoutubeAvailabilitySchema, type YoutubeUnplayableReason, artistEndpoints, artistQueryKeys, capitalizeFirstLetter, createNameIndex, defaultGenreMusicSelection, editGenreSongPages, foldSearchText, formatTime, genreEndpoints, genreMusicCount, genreMusicQueryParams, genreMusicSelectionKey, genrePlaylistEndpoints, genrePlaylistQueryKeys, genrePlaylistTrackCount, genreQueryKeys, genreSearchQueryKeys, genreUpdateMutationKey, getGenrePlaylistsGroupedByRoot, getReparentCandidates, hasMainstreamPopRoot, isSong, isSongSearchResultPlayable, libraryEndpoints, libraryQueryKeys, makeTrackPlaylistRelPageSchema, makeTrackPlaylistRelSchema, musicBrainzRecordingUrl, projectGenrePlaylistsForArtist, rankByName, rankNameIndex, searchGenrePlaylistsByName, songUnplayableReason, trigramSimilarity, useArtist, useArtistGenreCounts, useArtistSearch, useCreateGenre, useDeleteGenre, useFetchGenre, useFetchGenreDetail, useFetchGenreOverview, useFetchGenrePlaylist, useGenreByWikidataId, useGenreRemoteSearch, useGenreSearch, useGenreTreeViewState, useInvalidateAllGenrePlaylistQueries, useListFullGenrePlaylists, useListGenrePlaylists, useListGenres, useListTracks, usePrefetchGenreOverview, useRegionGenreLexicon, useRemoteSearch, useSearchQueryState, useSong, useSongHistory, useSongSearch, useTrackList, useTrackListSidebarVisibility, useUpdateGenre, useVisibleGenrePlaylists };
|
package/dist/genre-tree/index.js
CHANGED
|
@@ -58,6 +58,7 @@ import {
|
|
|
58
58
|
TrackListProvider,
|
|
59
59
|
TrackListSidebarVisibilityProvider,
|
|
60
60
|
TrackMinimumSchema,
|
|
61
|
+
TracksFailureAlreadyReportedError,
|
|
61
62
|
UuidResourceSchema,
|
|
62
63
|
YOUTUBE_UNPLAYABLE_REASON_LABELS,
|
|
63
64
|
YoutubeAvailabilitySchema,
|
|
@@ -89,7 +90,7 @@ import {
|
|
|
89
90
|
makeTrackPlaylistRelPageSchema,
|
|
90
91
|
makeTrackPlaylistRelSchema,
|
|
91
92
|
musicBrainzRecordingUrl,
|
|
92
|
-
|
|
93
|
+
projectGenrePlaylistsForArtist,
|
|
93
94
|
rankByName,
|
|
94
95
|
rankNameIndex,
|
|
95
96
|
searchGenrePlaylistsByName,
|
|
@@ -124,9 +125,9 @@ import {
|
|
|
124
125
|
useTrackListSidebarVisibility,
|
|
125
126
|
useUpdateGenre,
|
|
126
127
|
useVisibleGenrePlaylists
|
|
127
|
-
} from "../chunk-
|
|
128
|
-
import "../chunk-
|
|
129
|
-
import "../chunk-
|
|
128
|
+
} from "../chunk-D5UFJF4K.js";
|
|
129
|
+
import "../chunk-AYAKFCBP.js";
|
|
130
|
+
import "../chunk-WL2TKQVN.js";
|
|
130
131
|
import "../chunk-4MEK3CNF.js";
|
|
131
132
|
import "../chunk-MAKY4YBN.js";
|
|
132
133
|
import "../chunk-W4QTTNNA.js";
|
|
@@ -196,6 +197,7 @@ export {
|
|
|
196
197
|
TrackListProvider,
|
|
197
198
|
TrackListSidebarVisibilityProvider,
|
|
198
199
|
TrackMinimumSchema,
|
|
200
|
+
TracksFailureAlreadyReportedError,
|
|
199
201
|
UuidResourceSchema,
|
|
200
202
|
YOUTUBE_UNPLAYABLE_REASON_LABELS,
|
|
201
203
|
YoutubeAvailabilitySchema,
|
|
@@ -227,7 +229,7 @@ export {
|
|
|
227
229
|
makeTrackPlaylistRelPageSchema,
|
|
228
230
|
makeTrackPlaylistRelSchema,
|
|
229
231
|
musicBrainzRecordingUrl,
|
|
230
|
-
|
|
232
|
+
projectGenrePlaylistsForArtist,
|
|
231
233
|
rankByName,
|
|
232
234
|
rankNameIndex,
|
|
233
235
|
searchGenrePlaylistsByName,
|
package/dist/index.cjs
CHANGED
|
@@ -108,6 +108,7 @@ __export(src_exports, {
|
|
|
108
108
|
TrackListSidebarVisibilityProvider: () => TrackListSidebarVisibilityProvider,
|
|
109
109
|
TrackMinimumSchema: () => TrackMinimumSchema,
|
|
110
110
|
TrackNounProvider: () => TrackNounProvider,
|
|
111
|
+
TracksFailureAlreadyReportedError: () => TracksFailureAlreadyReportedError,
|
|
111
112
|
UuidResourceSchema: () => UuidResourceSchema,
|
|
112
113
|
YOUTUBE_UNPLAYABLE_REASON_LABELS: () => YOUTUBE_UNPLAYABLE_REASON_LABELS,
|
|
113
114
|
YoutubeAvailabilitySchema: () => YoutubeAvailabilitySchema,
|
|
@@ -155,7 +156,7 @@ __export(src_exports, {
|
|
|
155
156
|
makeTrackPlaylistRelSchema: () => makeTrackPlaylistRelSchema,
|
|
156
157
|
musicBrainzRecordingUrl: () => musicBrainzRecordingUrl,
|
|
157
158
|
parseWithLog: () => parseWithLog,
|
|
158
|
-
|
|
159
|
+
projectGenrePlaylistsForArtist: () => projectGenrePlaylistsForArtist,
|
|
159
160
|
queryClient: () => queryClient,
|
|
160
161
|
rankByName: () => rankByName,
|
|
161
162
|
rankNameIndex: () => rankNameIndex,
|
|
@@ -547,6 +548,12 @@ async function createAppErrorFromResult(result, backendBaseUrl) {
|
|
|
547
548
|
} else {
|
|
548
549
|
return createAppErrorFromErrorCode("SER5000" /* SERVICE_INTERNAL_ERROR */);
|
|
549
550
|
}
|
|
551
|
+
} else if (result.status === 502 || result.status === 503 || result.status === 504) {
|
|
552
|
+
if (isBackendError) {
|
|
553
|
+
return createAppErrorFromErrorCode("BAC2000" /* BACKEND_UNAVAILABLE */);
|
|
554
|
+
} else {
|
|
555
|
+
return createAppErrorFromErrorCode("SER5000" /* SERVICE_INTERNAL_ERROR */);
|
|
556
|
+
}
|
|
550
557
|
}
|
|
551
558
|
return createAppErrorFromErrorCode("CLI5001" /* CLIENT_UNKNOWN */);
|
|
552
559
|
}
|
|
@@ -2731,6 +2738,7 @@ var ArtistDetailedSchema = import_zod25.z.object({
|
|
|
2731
2738
|
})
|
|
2732
2739
|
),
|
|
2733
2740
|
tracksCount: import_zod25.z.number().int(),
|
|
2741
|
+
playableTracksCount: import_zod25.z.number().int(),
|
|
2734
2742
|
image: ArtistImageSchema.nullable()
|
|
2735
2743
|
});
|
|
2736
2744
|
|
|
@@ -3228,38 +3236,41 @@ var import_react21 = require("react");
|
|
|
3228
3236
|
// src/genre-tree/useVisibleGenrePlaylists.ts
|
|
3229
3237
|
var import_react20 = require("react");
|
|
3230
3238
|
|
|
3231
|
-
// src/genre-tree/lib/
|
|
3232
|
-
var
|
|
3233
|
-
var
|
|
3234
|
-
var
|
|
3239
|
+
// src/genre-tree/lib/project-genre-playlists-for-artist.ts
|
|
3240
|
+
var ZERO_SCOPED = { genreOnlyTracksCount: 0, genreAndSubgenresTracksCount: { canonical: 0, regional: 0, all: 0 } };
|
|
3241
|
+
var ZERO_ALL = { genreOnlyTracksCount: 0, genreAndSubgenresTracksCount: { all: 0 } };
|
|
3242
|
+
var ZERO_SCOPED_CATALOGUE = GenreCatalogueCountsSchema.parse(ZERO_SCOPED);
|
|
3243
|
+
var ZERO_ALL_CATALOGUE = GenreCatalogueCountsSchema.parse(ZERO_ALL);
|
|
3244
|
+
var projectGenrePlaylistsForArtist = (playlists, counts) => {
|
|
3235
3245
|
const countByPlaylist = new Map(counts.map((count) => [count.genrePlaylist, count]));
|
|
3236
|
-
const
|
|
3237
|
-
|
|
3238
|
-
const isPopRoot = playlist.parent === null && playlist.name === POP_ROOT_NAME;
|
|
3239
|
-
if (isPopRoot || (countByPlaylist.get(playlist.uuid)?.catalogue.genreAndSubgenresTracksCount.all ?? 0) > 0) kept.add(playlist.uuid);
|
|
3240
|
-
}
|
|
3241
|
-
const coreElectronicUuids = new Set(
|
|
3242
|
-
playlists.filter((playlist) => playlist.name === CORE_ELECTRONIC_NAME && kept.has(playlist.uuid)).map((p) => p.uuid)
|
|
3246
|
+
const focusUuids = new Set(
|
|
3247
|
+
counts.filter((count) => count.catalogue.genreAndSubgenresTracksCount.all > 0).map((count) => count.genrePlaylist)
|
|
3243
3248
|
);
|
|
3244
|
-
|
|
3245
|
-
if (playlist.parent && coreElectronicUuids.has(playlist.parent.uuid)) kept.add(playlist.uuid);
|
|
3246
|
-
}
|
|
3247
|
-
return playlists.filter((playlist) => kept.has(playlist.uuid)).map((playlist) => {
|
|
3249
|
+
const genrePlaylists = playlists.map((playlist) => {
|
|
3248
3250
|
const count = countByPlaylist.get(playlist.uuid);
|
|
3249
|
-
|
|
3251
|
+
if (count) {
|
|
3252
|
+
return {
|
|
3253
|
+
...playlist,
|
|
3254
|
+
genreOnlyTracksCount: count.genreOnlyTracksCount,
|
|
3255
|
+
genreAndSubgenresTracksCount: count.genreAndSubgenresTracksCount,
|
|
3256
|
+
catalogue: count.catalogue,
|
|
3257
|
+
tracksCount: genreMusicCount(count),
|
|
3258
|
+
// Artist view totals are not served.
|
|
3259
|
+
viewsCount: void 0
|
|
3260
|
+
};
|
|
3261
|
+
}
|
|
3250
3262
|
const scopes = playlist.genreAndSubgenresTracksCount;
|
|
3251
|
-
if (!scopes) throw new Error(
|
|
3252
|
-
const
|
|
3263
|
+
if (!scopes) throw new Error(`Artist projections require a reference genre summary (genre playlist ${playlist.uuid})`);
|
|
3264
|
+
const isScoped = "canonical" in scopes;
|
|
3253
3265
|
return {
|
|
3254
3266
|
...playlist,
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
tracksCount: count ? genreMusicCount(count) : 0,
|
|
3259
|
-
// Artist view totals are not served.
|
|
3267
|
+
...isScoped ? ZERO_SCOPED : ZERO_ALL,
|
|
3268
|
+
catalogue: isScoped ? ZERO_SCOPED_CATALOGUE : ZERO_ALL_CATALOGUE,
|
|
3269
|
+
tracksCount: 0,
|
|
3260
3270
|
viewsCount: void 0
|
|
3261
3271
|
};
|
|
3262
3272
|
});
|
|
3273
|
+
return { genrePlaylists, focusUuids };
|
|
3263
3274
|
};
|
|
3264
3275
|
|
|
3265
3276
|
// src/genre-tree/useVisibleGenrePlaylists.ts
|
|
@@ -3268,9 +3279,9 @@ function useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid = null
|
|
|
3268
3279
|
const counts = useArtistGenreCounts(artistUuid, getBackendBaseUrl);
|
|
3269
3280
|
const artistCounts = artistUuid !== null ? counts.data : void 0;
|
|
3270
3281
|
const isCountsLoading = artistUuid !== null && (counts.isPending || counts.isPlaceholderData);
|
|
3271
|
-
const
|
|
3272
|
-
if (!tree) return [];
|
|
3273
|
-
return artistCounts ?
|
|
3282
|
+
const projection = (0, import_react20.useMemo)(() => {
|
|
3283
|
+
if (!tree) return { genrePlaylists: [], focusUuids: void 0 };
|
|
3284
|
+
return artistCounts ? projectGenrePlaylistsForArtist(tree, artistCounts) : { genrePlaylists: tree, focusUuids: void 0 };
|
|
3274
3285
|
}, [tree, artistCounts]);
|
|
3275
3286
|
return {
|
|
3276
3287
|
isLoading: isTreePending,
|
|
@@ -3278,7 +3289,8 @@ function useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid = null
|
|
|
3278
3289
|
isError: isTreeError && !tree,
|
|
3279
3290
|
refetch,
|
|
3280
3291
|
isFetching: isCountsLoading || !isTreePending && isTreeFetching,
|
|
3281
|
-
genrePlaylists
|
|
3292
|
+
genrePlaylists: projection.genrePlaylists,
|
|
3293
|
+
focusUuids: projection.focusUuids
|
|
3282
3294
|
};
|
|
3283
3295
|
}
|
|
3284
3296
|
|
|
@@ -3315,7 +3327,7 @@ function useGenreTreeViewState({
|
|
|
3315
3327
|
},
|
|
3316
3328
|
[isSelectionControlled, onSelectedGenreUuidChange]
|
|
3317
3329
|
);
|
|
3318
|
-
const { isLoading, isError, refetch, isFetching, genrePlaylists } = useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid });
|
|
3330
|
+
const { isLoading, isError, refetch, isFetching, genrePlaylists, focusUuids } = useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid });
|
|
3319
3331
|
const genrePlaylistByNodeId = (0, import_react21.useMemo)(() => new Map(genrePlaylists.map((gp) => [gp.uuid, gp])), [genrePlaylists]);
|
|
3320
3332
|
const selectedGenrePlaylist = (0, import_react21.useMemo)(
|
|
3321
3333
|
() => genrePlaylists.find((gp) => gp.criteria?.uuid === selectedGenreUuid),
|
|
@@ -3381,6 +3393,7 @@ function useGenreTreeViewState({
|
|
|
3381
3393
|
refetch: () => void refetch(),
|
|
3382
3394
|
isFetching,
|
|
3383
3395
|
genrePlaylists,
|
|
3396
|
+
focusUuids,
|
|
3384
3397
|
genrePlaylistByNodeId,
|
|
3385
3398
|
visibleGenrePlaylists,
|
|
3386
3399
|
groupedGenrePlaylistsByRoot,
|
|
@@ -3575,6 +3588,12 @@ var AUTO_SKIP_DELAY_MS = 1e3;
|
|
|
3575
3588
|
function isTrackPlayable(track, runtimeUnplayableTrackIds, hasPlaybackFailure) {
|
|
3576
3589
|
return !runtimeUnplayableTrackIds.has(track.uuid) && (!isSong(track) || songUnplayableReason(track) === null && (!track.youtubeVideo || !hasPlaybackFailure(track.youtubeVideo.id)));
|
|
3577
3590
|
}
|
|
3591
|
+
var TracksFailureAlreadyReportedError = class extends Error {
|
|
3592
|
+
constructor() {
|
|
3593
|
+
super("Genre playlist tracks request failed; the failure was already reported globally");
|
|
3594
|
+
this.name = "TracksFailureAlreadyReportedError";
|
|
3595
|
+
}
|
|
3596
|
+
};
|
|
3578
3597
|
function useListTracks(scope, getBackendBaseUrl, schema, listEndpoint, listQueryKey, page = 1, pageSize = 50) {
|
|
3579
3598
|
const { session, sessionRestored } = useSession();
|
|
3580
3599
|
return usePlaybackQuery({
|
|
@@ -3643,6 +3662,7 @@ function TrackListProvider({
|
|
|
3643
3662
|
if (scope === "me" && (selection || artistUuid)) throw new Error("Genre selections require reference scope");
|
|
3644
3663
|
const params = { page, pageSize: TRACKS_PAGE_SIZE, ...from && { from }, ...genreMusicQueryParams(selection), ...artistUuid && { artist: artistUuid } };
|
|
3645
3664
|
const response = await (page === 1 ? fetchLatest : fetchBound)(endpoint, true, scope === "me", {}, params, false, !!from);
|
|
3665
|
+
if (response === null && !from) throw new TracksFailureAlreadyReportedError();
|
|
3646
3666
|
const parsed = parseWithLog(pageSchema, response, "fetchGenrePlaylistTracksPage");
|
|
3647
3667
|
return {
|
|
3648
3668
|
tracks: parsed.results.map((rel) => rel.track),
|
|
@@ -4214,6 +4234,7 @@ function editGenreSongPages(data, edit) {
|
|
|
4214
4234
|
TrackListSidebarVisibilityProvider,
|
|
4215
4235
|
TrackMinimumSchema,
|
|
4216
4236
|
TrackNounProvider,
|
|
4237
|
+
TracksFailureAlreadyReportedError,
|
|
4217
4238
|
UuidResourceSchema,
|
|
4218
4239
|
YOUTUBE_UNPLAYABLE_REASON_LABELS,
|
|
4219
4240
|
YoutubeAvailabilitySchema,
|
|
@@ -4261,7 +4282,7 @@ function editGenreSongPages(data, edit) {
|
|
|
4261
4282
|
makeTrackPlaylistRelSchema,
|
|
4262
4283
|
musicBrainzRecordingUrl,
|
|
4263
4284
|
parseWithLog,
|
|
4264
|
-
|
|
4285
|
+
projectGenrePlaylistsForArtist,
|
|
4265
4286
|
queryClient,
|
|
4266
4287
|
rankByName,
|
|
4267
4288
|
rankNameIndex,
|