@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
|
@@ -27,8 +27,10 @@ __export(genre_tree_exports, {
|
|
|
27
27
|
ArtistImageSchema: () => ArtistImageSchema,
|
|
28
28
|
ArtistMinimumSchema: () => ArtistMinimumSchema,
|
|
29
29
|
ArtistNames: () => ArtistNames,
|
|
30
|
+
ArtistOriginSchema: () => ArtistOriginSchema,
|
|
30
31
|
ArtistSearchResultSchema: () => ArtistSearchResultSchema,
|
|
31
32
|
ArtistSearchResultsSchema: () => ArtistSearchResultsSchema,
|
|
33
|
+
ArtistUuidSchema: () => ArtistUuidSchema,
|
|
32
34
|
CommonsImageSchema: () => CommonsImageSchema,
|
|
33
35
|
CriteriaCreationSchema: () => CriteriaCreationSchema,
|
|
34
36
|
CriteriaDetailedSchema: () => CriteriaDetailedSchema,
|
|
@@ -66,6 +68,7 @@ __export(genre_tree_exports, {
|
|
|
66
68
|
SongHistorySchema: () => SongHistorySchema,
|
|
67
69
|
SongSearchResultSchema: () => SongSearchResultSchema,
|
|
68
70
|
SongSearchResultsSchema: () => SongSearchResultsSchema,
|
|
71
|
+
SongUuidSchema: () => SongUuidSchema,
|
|
69
72
|
SubgenreCountsSchema: () => SubgenreCountsSchema,
|
|
70
73
|
SubgenreScopeSchema: () => SubgenreScopeSchema,
|
|
71
74
|
TrackBaseSchema: () => TrackBaseSchema,
|
|
@@ -119,7 +122,9 @@ __export(genre_tree_exports, {
|
|
|
119
122
|
rankNameIndex: () => rankNameIndex,
|
|
120
123
|
searchGenrePlaylistsByName: () => searchGenrePlaylistsByName,
|
|
121
124
|
songUnplayableReason: () => songUnplayableReason,
|
|
125
|
+
toArtistUuid: () => toArtistUuid,
|
|
122
126
|
toGenreUuid: () => toGenreUuid,
|
|
127
|
+
toSongUuid: () => toSongUuid,
|
|
123
128
|
trigramSimilarity: () => trigramSimilarity,
|
|
124
129
|
useArtist: () => useArtist,
|
|
125
130
|
useArtistGenreCounts: () => useArtistGenreCounts,
|
|
@@ -169,10 +174,17 @@ var import_zod2 = require("zod");
|
|
|
169
174
|
var import_zod = require("zod");
|
|
170
175
|
var GenreUuidSchema = import_zod.z.string().uuid().brand();
|
|
171
176
|
var GenrePlaylistUuidSchema = import_zod.z.string().uuid().brand();
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
177
|
+
var ArtistUuidSchema = import_zod.z.string().uuid().brand();
|
|
178
|
+
var SongUuidSchema = import_zod.z.string().uuid().brand();
|
|
179
|
+
function toId(schema) {
|
|
180
|
+
return (value) => {
|
|
181
|
+
const parsed = schema.safeParse(value);
|
|
182
|
+
return parsed.success ? parsed.data : null;
|
|
183
|
+
};
|
|
175
184
|
}
|
|
185
|
+
var toGenreUuid = toId(GenreUuidSchema);
|
|
186
|
+
var toArtistUuid = toId(ArtistUuidSchema);
|
|
187
|
+
var toSongUuid = toId(SongUuidSchema);
|
|
176
188
|
|
|
177
189
|
// src/genre-tree/schemas/criteria-playlist/minimum.ts
|
|
178
190
|
var CriteriaPlaylistMinimumSchema = import_zod2.z.object({
|
|
@@ -1411,9 +1423,6 @@ function useDeleteGenre(scope, getBackendBaseUrl) {
|
|
|
1411
1423
|
});
|
|
1412
1424
|
}
|
|
1413
1425
|
|
|
1414
|
-
// src/genre-tree/useArtist.ts
|
|
1415
|
-
var import_zod26 = require("zod");
|
|
1416
|
-
|
|
1417
1426
|
// src/genre-tree/schemas/artist-detailed.ts
|
|
1418
1427
|
var import_zod25 = require("zod");
|
|
1419
1428
|
var ArtistMembershipSchema = import_zod25.z.object({
|
|
@@ -1435,6 +1444,15 @@ var ARTIST_LINK_KINDS = [
|
|
|
1435
1444
|
"social"
|
|
1436
1445
|
];
|
|
1437
1446
|
var ArtistImageSchema = CommonsImageSchema;
|
|
1447
|
+
var ArtistOriginSchema = import_zod25.z.object({
|
|
1448
|
+
name: import_zod25.z.string(),
|
|
1449
|
+
kind: import_zod25.z.string(),
|
|
1450
|
+
source: import_zod25.z.enum(["begin_area", "area"]),
|
|
1451
|
+
wikidataId: import_zod25.z.string().nullable(),
|
|
1452
|
+
longitude: import_zod25.z.number().nullable(),
|
|
1453
|
+
latitude: import_zod25.z.number().nullable(),
|
|
1454
|
+
regionId: import_zod25.z.string().nullable()
|
|
1455
|
+
});
|
|
1438
1456
|
var ArtistDetailedSchema = import_zod25.z.object({
|
|
1439
1457
|
uuid: import_zod25.z.string().uuid(),
|
|
1440
1458
|
name: import_zod25.z.string(),
|
|
@@ -1458,7 +1476,8 @@ var ArtistDetailedSchema = import_zod25.z.object({
|
|
|
1458
1476
|
),
|
|
1459
1477
|
tracksCount: import_zod25.z.number().int(),
|
|
1460
1478
|
playableTracksCount: import_zod25.z.number().int(),
|
|
1461
|
-
image: ArtistImageSchema.nullable()
|
|
1479
|
+
image: ArtistImageSchema.nullable(),
|
|
1480
|
+
origin: ArtistOriginSchema.nullable()
|
|
1462
1481
|
});
|
|
1463
1482
|
|
|
1464
1483
|
// src/genre-tree/api/artists/queryKeys.ts
|
|
@@ -1479,10 +1498,11 @@ var artistEndpoints = {
|
|
|
1479
1498
|
// src/genre-tree/useArtist.ts
|
|
1480
1499
|
function useArtist(uuid, getBackendBaseUrl) {
|
|
1481
1500
|
const { fetch: fetch2 } = useFetchWrapper(getBackendBaseUrl);
|
|
1482
|
-
const
|
|
1501
|
+
const id = toArtistUuid(uuid);
|
|
1502
|
+
const isUuid = id !== null;
|
|
1483
1503
|
const { data, isPending, error } = useQueryWithParse({
|
|
1484
|
-
queryKey: artistQueryKeys.detail(
|
|
1485
|
-
queryFn: () => fetch2(artistEndpoints.detail(
|
|
1504
|
+
queryKey: artistQueryKeys.detail(id),
|
|
1505
|
+
queryFn: () => fetch2(artistEndpoints.detail(id), true, false),
|
|
1486
1506
|
schema: ArtistDetailedSchema,
|
|
1487
1507
|
enabled: isUuid,
|
|
1488
1508
|
retry: resourceRetry,
|
|
@@ -1493,19 +1513,19 @@ function useArtist(uuid, getBackendBaseUrl) {
|
|
|
1493
1513
|
}
|
|
1494
1514
|
|
|
1495
1515
|
// src/genre-tree/schemas/artist-search.ts
|
|
1496
|
-
var
|
|
1497
|
-
var ArtistSearchResultSchema =
|
|
1498
|
-
uuid:
|
|
1499
|
-
name:
|
|
1500
|
-
disambiguation:
|
|
1501
|
-
type:
|
|
1502
|
-
country:
|
|
1503
|
-
beginYear:
|
|
1504
|
-
endYear:
|
|
1505
|
-
matchedAlias:
|
|
1506
|
-
recordingCount:
|
|
1516
|
+
var import_zod26 = require("zod");
|
|
1517
|
+
var ArtistSearchResultSchema = import_zod26.z.object({
|
|
1518
|
+
uuid: import_zod26.z.string().uuid(),
|
|
1519
|
+
name: import_zod26.z.string(),
|
|
1520
|
+
disambiguation: import_zod26.z.string().nullable(),
|
|
1521
|
+
type: import_zod26.z.enum(["person", "group", "orchestra", "choir", "character", "other"]).nullable(),
|
|
1522
|
+
country: import_zod26.z.string().nullable(),
|
|
1523
|
+
beginYear: import_zod26.z.number().int().nullable(),
|
|
1524
|
+
endYear: import_zod26.z.number().int().nullable(),
|
|
1525
|
+
matchedAlias: import_zod26.z.string().nullable(),
|
|
1526
|
+
recordingCount: import_zod26.z.number().int()
|
|
1507
1527
|
});
|
|
1508
|
-
var ArtistSearchResultsSchema =
|
|
1528
|
+
var ArtistSearchResultsSchema = import_zod26.z.array(ArtistSearchResultSchema);
|
|
1509
1529
|
|
|
1510
1530
|
// src/genre-tree/useRemoteSearch.ts
|
|
1511
1531
|
var import_react_query6 = require("@tanstack/react-query");
|
|
@@ -1559,17 +1579,14 @@ function useArtistSearch(getBackendBaseUrl, text) {
|
|
|
1559
1579
|
return { artists: results, isError, settled, pending };
|
|
1560
1580
|
}
|
|
1561
1581
|
|
|
1562
|
-
// src/genre-tree/useSong.ts
|
|
1563
|
-
var import_zod30 = require("zod");
|
|
1564
|
-
|
|
1565
1582
|
// src/transport/lib/use-playback-query.ts
|
|
1566
1583
|
var import_react10 = require("react");
|
|
1567
1584
|
|
|
1568
1585
|
// src/transport/PlaybackContext.tsx
|
|
1569
1586
|
var import_react8 = require("react");
|
|
1570
|
-
var
|
|
1587
|
+
var import_zod27 = require("zod");
|
|
1571
1588
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1572
|
-
var PlaybackContextSchema =
|
|
1589
|
+
var PlaybackContextSchema = import_zod27.z.object({ country: import_zod27.z.string().regex(/^[A-Z]{2}$/).nullable() });
|
|
1573
1590
|
var unmanaged = {
|
|
1574
1591
|
country: null,
|
|
1575
1592
|
key: null,
|
|
@@ -1651,7 +1668,7 @@ function usePlaybackQuery({
|
|
|
1651
1668
|
}
|
|
1652
1669
|
|
|
1653
1670
|
// src/genre-tree/schemas/song/detailed.ts
|
|
1654
|
-
var
|
|
1671
|
+
var import_zod28 = require("zod");
|
|
1655
1672
|
var YOUTUBE_UNPLAYABLE_REASON_LABELS = {
|
|
1656
1673
|
not_found: "Video unavailable",
|
|
1657
1674
|
not_embeddable: "Embedding disabled",
|
|
@@ -1660,23 +1677,23 @@ var YOUTUBE_UNPLAYABLE_REASON_LABELS = {
|
|
|
1660
1677
|
region_whitelisted: "Region restricted"
|
|
1661
1678
|
};
|
|
1662
1679
|
var YOUTUBE_UNPLAYABLE_REASONS = Object.keys(YOUTUBE_UNPLAYABLE_REASON_LABELS);
|
|
1663
|
-
var YoutubeAvailabilitySchema =
|
|
1664
|
-
status:
|
|
1665
|
-
reason:
|
|
1666
|
-
country:
|
|
1680
|
+
var YoutubeAvailabilitySchema = import_zod28.z.object({
|
|
1681
|
+
status: import_zod28.z.enum(["eligible", "blocked", "unknown"]),
|
|
1682
|
+
reason: import_zod28.z.string().nullable(),
|
|
1683
|
+
country: import_zod28.z.string().nullable()
|
|
1667
1684
|
});
|
|
1668
1685
|
var SongDetailedSchema = TrackBaseSchema.extend({
|
|
1669
|
-
youtubeVideo:
|
|
1670
|
-
id:
|
|
1686
|
+
youtubeVideo: import_zod28.z.object({
|
|
1687
|
+
id: import_zod28.z.string(),
|
|
1671
1688
|
availability: YoutubeAvailabilitySchema.optional(),
|
|
1672
1689
|
// null = playable
|
|
1673
|
-
unplayableReason:
|
|
1674
|
-
viewCount:
|
|
1690
|
+
unplayableReason: import_zod28.z.enum(YOUTUBE_UNPLAYABLE_REASONS).nullable(),
|
|
1691
|
+
viewCount: import_zod28.z.number().int().nullable().optional()
|
|
1675
1692
|
}).nullable(),
|
|
1676
1693
|
// null for hand-made/admin songs
|
|
1677
|
-
musicbrainzRecordingId:
|
|
1678
|
-
firstReleaseYear:
|
|
1679
|
-
essentialGenres:
|
|
1694
|
+
musicbrainzRecordingId: import_zod28.z.string().uuid().nullable(),
|
|
1695
|
+
firstReleaseYear: import_zod28.z.number().int().nullable().optional(),
|
|
1696
|
+
essentialGenres: import_zod28.z.array(CriteriaMinimumSchema).optional()
|
|
1680
1697
|
});
|
|
1681
1698
|
var NO_VIDEO_LABEL = "No video available";
|
|
1682
1699
|
function isSong(track) {
|
|
@@ -1694,11 +1711,12 @@ function musicBrainzRecordingUrl(song) {
|
|
|
1694
1711
|
|
|
1695
1712
|
// src/genre-tree/useSong.ts
|
|
1696
1713
|
function useSong(uuid, getBackendBaseUrl) {
|
|
1697
|
-
const
|
|
1714
|
+
const id = toSongUuid(uuid);
|
|
1715
|
+
const isUuid = id !== null;
|
|
1698
1716
|
const { data, isPending, error } = usePlaybackQuery({
|
|
1699
1717
|
getBackendBaseUrl,
|
|
1700
|
-
queryKey: libraryQueryKeys.reference.songs.detail(
|
|
1701
|
-
queryFn: (fetchBound, { signal }) => fetchBound(libraryEndpoints.reference.songs.detail(
|
|
1718
|
+
queryKey: libraryQueryKeys.reference.songs.detail(id),
|
|
1719
|
+
queryFn: (fetchBound, { signal }) => fetchBound(libraryEndpoints.reference.songs.detail(id), true, false, { signal }),
|
|
1702
1720
|
schema: SongDetailedSchema,
|
|
1703
1721
|
enabled: isUuid,
|
|
1704
1722
|
retry: resourceRetry,
|
|
@@ -1709,24 +1727,25 @@ function useSong(uuid, getBackendBaseUrl) {
|
|
|
1709
1727
|
}
|
|
1710
1728
|
|
|
1711
1729
|
// src/genre-tree/schemas/song-history.ts
|
|
1712
|
-
var
|
|
1713
|
-
var SongHistoryEntrySchema =
|
|
1714
|
-
uuid:
|
|
1715
|
-
action:
|
|
1716
|
-
actorPseudo:
|
|
1717
|
-
oldValue:
|
|
1718
|
-
newValue:
|
|
1719
|
-
createdOn:
|
|
1730
|
+
var import_zod29 = require("zod");
|
|
1731
|
+
var SongHistoryEntrySchema = import_zod29.z.object({
|
|
1732
|
+
uuid: import_zod29.z.string().uuid(),
|
|
1733
|
+
action: import_zod29.z.string(),
|
|
1734
|
+
actorPseudo: import_zod29.z.string().nullable(),
|
|
1735
|
+
oldValue: import_zod29.z.string().nullable(),
|
|
1736
|
+
newValue: import_zod29.z.string().nullable(),
|
|
1737
|
+
createdOn: import_zod29.z.string()
|
|
1720
1738
|
});
|
|
1721
|
-
var SongHistorySchema =
|
|
1739
|
+
var SongHistorySchema = import_zod29.z.array(SongHistoryEntrySchema);
|
|
1722
1740
|
|
|
1723
1741
|
// src/genre-tree/useSongHistory.ts
|
|
1724
1742
|
function useSongHistory(uuid, getBackendBaseUrl, enabled) {
|
|
1725
|
-
const
|
|
1743
|
+
const id = toSongUuid(uuid);
|
|
1744
|
+
const active = enabled && id !== null;
|
|
1726
1745
|
const { data, isPending, error } = usePlaybackQuery({
|
|
1727
1746
|
getBackendBaseUrl,
|
|
1728
|
-
queryKey: libraryQueryKeys.reference.songs.history(
|
|
1729
|
-
queryFn: (fetchBound, { signal }) => fetchBound(libraryEndpoints.reference.songs.history(
|
|
1747
|
+
queryKey: libraryQueryKeys.reference.songs.history(id),
|
|
1748
|
+
queryFn: (fetchBound, { signal }) => fetchBound(libraryEndpoints.reference.songs.history(id), true, false, { signal }),
|
|
1730
1749
|
schema: SongHistorySchema,
|
|
1731
1750
|
enabled: active,
|
|
1732
1751
|
context: "useSongHistory"
|
|
@@ -1738,20 +1757,20 @@ function useSongHistory(uuid, getBackendBaseUrl, enabled) {
|
|
|
1738
1757
|
}
|
|
1739
1758
|
|
|
1740
1759
|
// src/genre-tree/schemas/song-search.ts
|
|
1741
|
-
var
|
|
1742
|
-
var SongSearchResultSchema =
|
|
1743
|
-
uuid:
|
|
1744
|
-
title:
|
|
1745
|
-
artists:
|
|
1760
|
+
var import_zod30 = require("zod");
|
|
1761
|
+
var SongSearchResultSchema = import_zod30.z.object({
|
|
1762
|
+
uuid: import_zod30.z.string().uuid(),
|
|
1763
|
+
title: import_zod30.z.string(),
|
|
1764
|
+
artists: import_zod30.z.array(ArtistMinimumSchema),
|
|
1746
1765
|
// null for songs not yet linked to a genre.
|
|
1747
1766
|
genre: CriteriaMinimumSchema.nullable(),
|
|
1748
|
-
youtubeVideo:
|
|
1749
|
-
id:
|
|
1750
|
-
unplayableReason:
|
|
1767
|
+
youtubeVideo: import_zod30.z.object({
|
|
1768
|
+
id: import_zod30.z.string(),
|
|
1769
|
+
unplayableReason: import_zod30.z.string().nullable()
|
|
1751
1770
|
}).nullable(),
|
|
1752
|
-
firstReleaseYear:
|
|
1771
|
+
firstReleaseYear: import_zod30.z.number().int().nullable()
|
|
1753
1772
|
});
|
|
1754
|
-
var SongSearchResultsSchema =
|
|
1773
|
+
var SongSearchResultsSchema = import_zod30.z.array(SongSearchResultSchema);
|
|
1755
1774
|
function isSongSearchResultPlayable(result) {
|
|
1756
1775
|
return result.youtubeVideo !== null && result.youtubeVideo.unplayableReason === null;
|
|
1757
1776
|
}
|
|
@@ -1779,18 +1798,18 @@ function useSongSearch(getBackendBaseUrl, text, options = {}) {
|
|
|
1779
1798
|
|
|
1780
1799
|
// src/genre-tree/useArtistGenreCounts.ts
|
|
1781
1800
|
var import_react_query7 = require("@tanstack/react-query");
|
|
1782
|
-
var
|
|
1801
|
+
var import_zod32 = require("zod");
|
|
1783
1802
|
|
|
1784
1803
|
// src/genre-tree/schemas/artist-genre-count.ts
|
|
1785
|
-
var
|
|
1786
|
-
var ArtistGenreCountSchema =
|
|
1804
|
+
var import_zod31 = require("zod");
|
|
1805
|
+
var ArtistGenreCountSchema = import_zod31.z.object({
|
|
1787
1806
|
...GenreCountsSchema.shape,
|
|
1788
1807
|
catalogue: GenreCatalogueCountsSchema,
|
|
1789
1808
|
genrePlaylist: GenrePlaylistUuidSchema,
|
|
1790
1809
|
/** Legacy catalogue count for the default selection. */
|
|
1791
|
-
songsCount:
|
|
1810
|
+
songsCount: import_zod31.z.number().int().nonnegative(),
|
|
1792
1811
|
/** Legacy playlist count for the default selection. */
|
|
1793
|
-
tracksCount:
|
|
1812
|
+
tracksCount: import_zod31.z.number().int().nonnegative()
|
|
1794
1813
|
}).superRefine((row, ctx) => {
|
|
1795
1814
|
const counts = GenreCatalogueCountsSchema.safeParse(row);
|
|
1796
1815
|
if (!counts.success) {
|
|
@@ -1803,11 +1822,12 @@ var ArtistGenreCountSchema = import_zod33.z.object({
|
|
|
1803
1822
|
// src/genre-tree/useArtistGenreCounts.ts
|
|
1804
1823
|
function useArtistGenreCounts(artistUuid, getBackendBaseUrl) {
|
|
1805
1824
|
const { fetch: fetch2 } = useFetchWrapper(getBackendBaseUrl);
|
|
1825
|
+
const id = toArtistUuid(artistUuid);
|
|
1806
1826
|
return useQueryWithParse({
|
|
1807
|
-
queryKey: [...artistQueryKeys.genreCounts(getBackendBaseUrl(),
|
|
1808
|
-
queryFn: () => fetch2(artistEndpoints.genreCounts(
|
|
1809
|
-
schema:
|
|
1810
|
-
enabled:
|
|
1827
|
+
queryKey: [...artistQueryKeys.genreCounts(getBackendBaseUrl(), id), "genreMusicV1"],
|
|
1828
|
+
queryFn: () => fetch2(artistEndpoints.genreCounts(id), true, false),
|
|
1829
|
+
schema: import_zod32.z.array(ArtistGenreCountSchema),
|
|
1830
|
+
enabled: id !== null,
|
|
1811
1831
|
placeholderData: import_react_query7.keepPreviousData,
|
|
1812
1832
|
retry: resourceRetry,
|
|
1813
1833
|
context: "useArtistGenreCounts"
|
|
@@ -1966,32 +1986,32 @@ function useGenreSearch({
|
|
|
1966
1986
|
}
|
|
1967
1987
|
|
|
1968
1988
|
// src/genre-tree/schemas/genre-search.ts
|
|
1969
|
-
var
|
|
1970
|
-
var GenreSearchTreeNameSchema =
|
|
1971
|
-
var GenreSearchResultSchema =
|
|
1989
|
+
var import_zod33 = require("zod");
|
|
1990
|
+
var GenreSearchTreeNameSchema = import_zod33.z.enum(["canonical", "regional"]);
|
|
1991
|
+
var GenreSearchResultSchema = import_zod33.z.object({
|
|
1972
1992
|
/** Criteria (genre) uuid. */
|
|
1973
1993
|
uuid: GenreUuidSchema,
|
|
1974
|
-
name:
|
|
1994
|
+
name: import_zod33.z.string(),
|
|
1975
1995
|
/** Null for app-created genres, which the Wikidata-keyed region index does not reference. */
|
|
1976
|
-
wikidataId:
|
|
1977
|
-
treeName:
|
|
1996
|
+
wikidataId: import_zod33.z.string().nullable(),
|
|
1997
|
+
treeName: import_zod33.z.string(),
|
|
1978
1998
|
/** Null when the genre has no playlist in the tree, so it cannot be opened there. */
|
|
1979
1999
|
genrePlaylistUuid: GenrePlaylistUuidSchema.nullable(),
|
|
1980
|
-
root:
|
|
1981
|
-
isUmbrella:
|
|
1982
|
-
viewsCount:
|
|
2000
|
+
root: import_zod33.z.object({ uuid: GenreUuidSchema, name: import_zod33.z.string() }),
|
|
2001
|
+
isUmbrella: import_zod33.z.boolean(),
|
|
2002
|
+
viewsCount: import_zod33.z.number().int()
|
|
1983
2003
|
});
|
|
1984
|
-
var GenreSearchResultsSchema =
|
|
1985
|
-
var RegionGenreLexiconEntrySchema =
|
|
1986
|
-
wikidataId:
|
|
2004
|
+
var GenreSearchResultsSchema = import_zod33.z.array(GenreSearchResultSchema);
|
|
2005
|
+
var RegionGenreLexiconEntrySchema = import_zod33.z.object({
|
|
2006
|
+
wikidataId: import_zod33.z.string(),
|
|
1987
2007
|
uuid: GenreUuidSchema,
|
|
1988
|
-
name:
|
|
1989
|
-
treeName:
|
|
2008
|
+
name: import_zod33.z.string(),
|
|
2009
|
+
treeName: import_zod33.z.string(),
|
|
1990
2010
|
genrePlaylistUuid: GenrePlaylistUuidSchema.nullable(),
|
|
1991
|
-
isUmbrella:
|
|
1992
|
-
viewsCount:
|
|
2011
|
+
isUmbrella: import_zod33.z.boolean(),
|
|
2012
|
+
viewsCount: import_zod33.z.number().int()
|
|
1993
2013
|
});
|
|
1994
|
-
var RegionGenreLexiconSchema =
|
|
2014
|
+
var RegionGenreLexiconSchema = import_zod33.z.array(RegionGenreLexiconEntrySchema);
|
|
1995
2015
|
|
|
1996
2016
|
// src/genre-tree/useGenreRemoteSearch.ts
|
|
1997
2017
|
var DEFAULT_RESULT_LIMIT2 = 8;
|
|
@@ -2071,9 +2091,10 @@ var projectGenrePlaylistsForArtist = (playlists, counts) => {
|
|
|
2071
2091
|
// src/genre-tree/useVisibleGenrePlaylists.ts
|
|
2072
2092
|
function useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid = null }) {
|
|
2073
2093
|
const { data: tree, isPending: isTreePending, isFetching: isTreeFetching, isError: isTreeError, refetch } = useListFullGenrePlaylists(scope, getBackendBaseUrl);
|
|
2074
|
-
const
|
|
2075
|
-
const
|
|
2076
|
-
const
|
|
2094
|
+
const validArtistUuid = toArtistUuid(artistUuid);
|
|
2095
|
+
const counts = useArtistGenreCounts(validArtistUuid, getBackendBaseUrl);
|
|
2096
|
+
const artistCounts = validArtistUuid !== null ? counts.data : void 0;
|
|
2097
|
+
const isCountsLoading = validArtistUuid !== null && (counts.isPending || counts.isPlaceholderData);
|
|
2077
2098
|
const projection = (0, import_react13.useMemo)(() => {
|
|
2078
2099
|
if (!tree) return { genrePlaylists: [], focusUuids: void 0 };
|
|
2079
2100
|
return artistCounts ? projectGenrePlaylistsForArtist(tree, artistCounts) : { genrePlaylists: tree, focusUuids: void 0 };
|
|
@@ -2213,10 +2234,10 @@ function useGenreTreeViewState({
|
|
|
2213
2234
|
var import_react17 = require("react");
|
|
2214
2235
|
|
|
2215
2236
|
// src/genre-tree/schemas/track-playlist-rel/without-playlist.ts
|
|
2216
|
-
var
|
|
2217
|
-
var makeTrackPlaylistRelSchema = (trackSchema) =>
|
|
2237
|
+
var import_zod34 = require("zod");
|
|
2238
|
+
var makeTrackPlaylistRelSchema = (trackSchema) => import_zod34.z.object({
|
|
2218
2239
|
track: trackSchema,
|
|
2219
|
-
position:
|
|
2240
|
+
position: import_zod34.z.number().min(0)
|
|
2220
2241
|
});
|
|
2221
2242
|
var makeTrackPlaylistRelPageSchema = (trackSchema) => PaginatedResponseSchema(makeTrackPlaylistRelSchema(trackSchema));
|
|
2222
2243
|
|
|
@@ -2872,24 +2893,24 @@ function ArtistNames({
|
|
|
2872
2893
|
}
|
|
2873
2894
|
|
|
2874
2895
|
// src/genre-tree/schemas/mb-artist.ts
|
|
2875
|
-
var
|
|
2876
|
-
var MbArtistDetailedSchema =
|
|
2877
|
-
musicbrainzId:
|
|
2878
|
-
name:
|
|
2896
|
+
var import_zod35 = require("zod");
|
|
2897
|
+
var MbArtistDetailedSchema = import_zod35.z.object({
|
|
2898
|
+
musicbrainzId: import_zod35.z.string().uuid(),
|
|
2899
|
+
name: import_zod35.z.string(),
|
|
2879
2900
|
musicbrainzLink: HttpUrlSchema
|
|
2880
2901
|
});
|
|
2881
2902
|
|
|
2882
2903
|
// src/genre-tree/schemas/mb-recording.ts
|
|
2883
|
-
var
|
|
2884
|
-
var MbRecordingDetailedSchema =
|
|
2885
|
-
musicbrainzId:
|
|
2886
|
-
title:
|
|
2887
|
-
score:
|
|
2888
|
-
musicbrainzArtists:
|
|
2904
|
+
var import_zod36 = require("zod");
|
|
2905
|
+
var MbRecordingDetailedSchema = import_zod36.z.object({
|
|
2906
|
+
musicbrainzId: import_zod36.z.string().uuid(),
|
|
2907
|
+
title: import_zod36.z.string(),
|
|
2908
|
+
score: import_zod36.z.number(),
|
|
2909
|
+
musicbrainzArtists: import_zod36.z.array(MbArtistDetailedSchema),
|
|
2889
2910
|
musicbrainzLink: HttpUrlSchema,
|
|
2890
|
-
durationInSec:
|
|
2891
|
-
durationStrInHourMinSec:
|
|
2892
|
-
releaseDate:
|
|
2911
|
+
durationInSec: import_zod36.z.number().min(0).nullable().optional(),
|
|
2912
|
+
durationStrInHourMinSec: import_zod36.z.string().nullable().optional(),
|
|
2913
|
+
releaseDate: import_zod36.z.union([import_zod36.z.string().datetime(), import_zod36.z.string()]).transform((val) => {
|
|
2893
2914
|
try {
|
|
2894
2915
|
const date = new Date(val);
|
|
2895
2916
|
if (isNaN(date.getTime())) {
|
|
@@ -2965,8 +2986,10 @@ function editGenreSongPages(data, edit) {
|
|
|
2965
2986
|
ArtistImageSchema,
|
|
2966
2987
|
ArtistMinimumSchema,
|
|
2967
2988
|
ArtistNames,
|
|
2989
|
+
ArtistOriginSchema,
|
|
2968
2990
|
ArtistSearchResultSchema,
|
|
2969
2991
|
ArtistSearchResultsSchema,
|
|
2992
|
+
ArtistUuidSchema,
|
|
2970
2993
|
CommonsImageSchema,
|
|
2971
2994
|
CriteriaCreationSchema,
|
|
2972
2995
|
CriteriaDetailedSchema,
|
|
@@ -3004,6 +3027,7 @@ function editGenreSongPages(data, edit) {
|
|
|
3004
3027
|
SongHistorySchema,
|
|
3005
3028
|
SongSearchResultSchema,
|
|
3006
3029
|
SongSearchResultsSchema,
|
|
3030
|
+
SongUuidSchema,
|
|
3007
3031
|
SubgenreCountsSchema,
|
|
3008
3032
|
SubgenreScopeSchema,
|
|
3009
3033
|
TrackBaseSchema,
|
|
@@ -3057,7 +3081,9 @@ function editGenreSongPages(data, edit) {
|
|
|
3057
3081
|
rankNameIndex,
|
|
3058
3082
|
searchGenrePlaylistsByName,
|
|
3059
3083
|
songUnplayableReason,
|
|
3084
|
+
toArtistUuid,
|
|
3060
3085
|
toGenreUuid,
|
|
3086
|
+
toSongUuid,
|
|
3061
3087
|
trigramSimilarity,
|
|
3062
3088
|
useArtist,
|
|
3063
3089
|
useArtistGenreCounts,
|