@behindthemusictree/app-kit 29.1.0 → 30.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.
@@ -4,7 +4,7 @@ import {
4
4
  useFetchWrapper,
5
5
  useQueryWithParse,
6
6
  useValidatedMutation
7
- } from "./chunk-7EOS2K24.js";
7
+ } from "./chunk-BVWRP6IK.js";
8
8
  import {
9
9
  useSession
10
10
  } from "./chunk-T5D5T52J.js";
@@ -127,6 +127,8 @@ var makeSongQueryKeys = (prefix) => ({
127
127
  all: [`${prefix}Songs`],
128
128
  list: (page) => [`${prefix}Songs`, "list", page],
129
129
  detail: (uuid) => [`${prefix}Songs`, "detail", uuid],
130
+ history: (uuid) => [`${prefix}Songs`, "history", uuid],
131
+ search: (params) => [`${prefix}Songs`, "search", params],
130
132
  // baseUrl keeps distinct backends sharing a scope (e.g. grow and its prototype proxy) apart.
131
133
  byGenre: (baseUrl, genreUuid) => [`${prefix}Songs`, baseUrl, "genre", genreUuid]
132
134
  });
@@ -134,6 +136,8 @@ var makeSongQueryKeys = (prefix) => ({
134
136
  // src/genre-tree/api/library/songs/endpoints.ts
135
137
  var makeSongEndpoints = () => ({
136
138
  list: () => "library/songs/",
139
+ search: () => "library/songs/search/",
140
+ history: (uuid) => `library/songs/${uuid}/history/`,
137
141
  detail: (uuid) => `library/songs/${uuid}/`,
138
142
  delete: (uuid) => `library/songs/${uuid}/`
139
143
  });
@@ -275,7 +279,8 @@ var TrackBaseSchema = UuidResourceSchema.extend({
275
279
  artists: z9.array(ArtistMinimumSchema).nullable().optional(),
276
280
  album: AlbumMinimumSchema.nullable().optional(),
277
281
  trackNumber: z9.number().nullable().optional(),
278
- genre: CriteriaMinimumSchema,
282
+ // null for a song not yet linked to a genre.
283
+ genre: CriteriaMinimumSchema.nullable(),
279
284
  rating: z9.number().min(0).max(10).nullable().optional(),
280
285
  language: z9.string().nullable().optional(),
281
286
  playCount: z9.number().min(0),
@@ -678,7 +683,7 @@ function useArtistSearch(getBackendBaseUrl, text) {
678
683
  const enabled = query.length >= MIN_QUERY_LENGTH;
679
684
  const { data, isFetching, isError } = useQueryWithParse({
680
685
  queryKey: artistQueryKeys.search(query),
681
- queryFn: () => fetch(artistEndpoints.search(), true, false, {}, { q: query, limit: RESULT_LIMIT }),
686
+ queryFn: ({ signal }) => fetch(artistEndpoints.search(), true, false, { signal }, { q: query, limit: RESULT_LIMIT }),
682
687
  schema: ArtistSearchResultsSchema,
683
688
  context: "useArtistSearch",
684
689
  enabled,
@@ -694,38 +699,180 @@ function useArtistSearch(getBackendBaseUrl, text) {
694
699
  };
695
700
  }
696
701
 
697
- // src/genre-tree/useArtistGenreCounts.ts
698
- import { keepPreviousData as keepPreviousData2 } from "@tanstack/react-query";
702
+ // src/genre-tree/useSong.ts
699
703
  import { z as z23 } from "zod";
700
704
 
701
- // src/genre-tree/schemas/artist-genre-count.ts
705
+ // src/genre-tree/schemas/song/detailed.ts
702
706
  import { z as z22 } from "zod";
703
- var ArtistGenreCountSchema = z22.object({
707
+ var YOUTUBE_UNPLAYABLE_REASON_LABELS = {
708
+ not_found: "Video unavailable",
709
+ not_embeddable: "Embedding disabled",
710
+ private: "Private video",
711
+ not_processed: "Video still processing",
712
+ region_whitelisted: "Region restricted"
713
+ };
714
+ var YOUTUBE_UNPLAYABLE_REASONS = Object.keys(YOUTUBE_UNPLAYABLE_REASON_LABELS);
715
+ var SongDetailedSchema = TrackBaseSchema.extend({
716
+ youtubeVideo: z22.object({
717
+ id: z22.string(),
718
+ // null = playable
719
+ unplayableReason: z22.enum(YOUTUBE_UNPLAYABLE_REASONS).nullable(),
720
+ viewCount: z22.number().int().nullable().optional()
721
+ }).nullable(),
722
+ // null for hand-made/admin songs
723
+ musicbrainzRecordingId: z22.string().uuid().nullable(),
724
+ firstReleaseYear: z22.number().int().nullable().optional(),
725
+ essentialGenres: z22.array(CriteriaMinimumSchema).optional()
726
+ });
727
+ var NO_VIDEO_LABEL = "No video available";
728
+ function isSong(track) {
729
+ return "youtubeVideo" in track;
730
+ }
731
+ function songUnplayableReason(song) {
732
+ if (!song.youtubeVideo) return NO_VIDEO_LABEL;
733
+ const reason = song.youtubeVideo.unplayableReason;
734
+ return reason ? YOUTUBE_UNPLAYABLE_REASON_LABELS[reason] : null;
735
+ }
736
+ function musicBrainzRecordingUrl(song) {
737
+ return song.musicbrainzRecordingId ? `https://musicbrainz.org/recording/${song.musicbrainzRecordingId}` : null;
738
+ }
739
+
740
+ // src/genre-tree/useSong.ts
741
+ var isNotFound2 = (error) => error instanceof AppError && error.code === "BAC4040" /* BACKEND_NOT_FOUND */;
742
+ function useSong(uuid, getBackendBaseUrl) {
743
+ const { fetch } = useFetchWrapper(getBackendBaseUrl);
744
+ const isUuid = uuid !== null && z23.string().uuid().safeParse(uuid).success;
745
+ const { data, isPending, error } = useQueryWithParse({
746
+ queryKey: libraryQueryKeys.reference.songs.detail(uuid),
747
+ // A missing song is shown in the panel, not raised as an app-wide connectivity error.
748
+ queryFn: ({ signal }) => fetch(libraryEndpoints.reference.songs.detail(uuid), true, false, { signal }, void 0, false, true),
749
+ schema: SongDetailedSchema,
750
+ enabled: isUuid,
751
+ retry: (failureCount, retryError) => !isNotFound2(retryError) && failureCount < 3,
752
+ context: "useSong"
753
+ });
754
+ if (uuid === null) return { status: "idle" };
755
+ if (!isUuid || isNotFound2(error)) return { status: "not-found" };
756
+ if (error) return { status: "error" };
757
+ if (isPending) return { status: "loading" };
758
+ return { status: "success", song: data };
759
+ }
760
+
761
+ // src/genre-tree/schemas/song-history.ts
762
+ import { z as z24 } from "zod";
763
+ var SongHistoryEntrySchema = z24.object({
764
+ uuid: z24.string().uuid(),
765
+ action: z24.string(),
766
+ actorPseudo: z24.string().nullable(),
767
+ oldValue: z24.string().nullable(),
768
+ newValue: z24.string().nullable(),
769
+ createdOn: z24.string()
770
+ });
771
+ var SongHistorySchema = z24.array(SongHistoryEntrySchema);
772
+
773
+ // src/genre-tree/useSongHistory.ts
774
+ function useSongHistory(uuid, getBackendBaseUrl, enabled) {
775
+ const { fetch } = useFetchWrapper(getBackendBaseUrl);
776
+ const active = enabled && uuid !== null;
777
+ const { data, isPending, error } = useQueryWithParse({
778
+ queryKey: libraryQueryKeys.reference.songs.history(uuid),
779
+ queryFn: ({ signal }) => fetch(libraryEndpoints.reference.songs.history(uuid), true, false, { signal }, void 0, false, true),
780
+ schema: SongHistorySchema,
781
+ enabled: active,
782
+ context: "useSongHistory"
783
+ });
784
+ if (!active) return { status: "idle" };
785
+ if (error) return { status: "error" };
786
+ if (isPending) return { status: "loading" };
787
+ return { status: "success", entries: data };
788
+ }
789
+
790
+ // src/genre-tree/useSongSearch.ts
791
+ import { keepPreviousData as keepPreviousData2 } from "@tanstack/react-query";
792
+ import { useEffect as useEffect2, useState as useState2 } from "react";
793
+
794
+ // src/genre-tree/schemas/song-search.ts
795
+ import { z as z25 } from "zod";
796
+ var SongSearchResultSchema = z25.object({
797
+ uuid: z25.string().uuid(),
798
+ title: z25.string(),
799
+ artists: z25.array(ArtistMinimumSchema),
800
+ // null for songs not yet linked to a genre.
801
+ genre: CriteriaMinimumSchema.nullable(),
802
+ youtubeVideo: z25.object({
803
+ id: z25.string(),
804
+ unplayableReason: z25.string().nullable()
805
+ }).nullable(),
806
+ firstReleaseYear: z25.number().int().nullable()
807
+ });
808
+ var SongSearchResultsSchema = z25.array(SongSearchResultSchema);
809
+ function isSongSearchResultPlayable(result) {
810
+ return result.youtubeVideo !== null && result.youtubeVideo.unplayableReason === null;
811
+ }
812
+
813
+ // src/genre-tree/useSongSearch.ts
814
+ var DEBOUNCE_MS2 = 250;
815
+ var MIN_QUERY_LENGTH2 = 2;
816
+ var RESULT_LIMIT2 = 8;
817
+ function useSongSearch(getBackendBaseUrl, text) {
818
+ const { fetch } = useFetchWrapper(getBackendBaseUrl);
819
+ const trimmed = text.trim();
820
+ const [query, setQuery] = useState2("");
821
+ useEffect2(() => {
822
+ const timer = setTimeout(() => setQuery(trimmed), DEBOUNCE_MS2);
823
+ return () => clearTimeout(timer);
824
+ }, [trimmed]);
825
+ const enabled = query.length >= MIN_QUERY_LENGTH2;
826
+ const { data, isFetching, isError } = useQueryWithParse({
827
+ queryKey: libraryQueryKeys.reference.songs.search({ q: query, limit: RESULT_LIMIT2 }),
828
+ queryFn: ({ signal }) => fetch(libraryEndpoints.reference.songs.search(), true, false, { signal }, { q: query, limit: RESULT_LIMIT2 }),
829
+ schema: SongSearchResultsSchema,
830
+ context: "useSongSearch",
831
+ enabled,
832
+ placeholderData: keepPreviousData2
833
+ });
834
+ const settled = enabled && !isFetching && query === trimmed;
835
+ const failed = enabled && isError;
836
+ return {
837
+ songs: trimmed.length >= MIN_QUERY_LENGTH2 ? data ?? [] : [],
838
+ isError: failed,
839
+ settled,
840
+ pending: trimmed.length >= MIN_QUERY_LENGTH2 && !settled && !failed
841
+ };
842
+ }
843
+
844
+ // src/genre-tree/useArtistGenreCounts.ts
845
+ import { keepPreviousData as keepPreviousData3 } from "@tanstack/react-query";
846
+ import { z as z27 } from "zod";
847
+
848
+ // src/genre-tree/schemas/artist-genre-count.ts
849
+ import { z as z26 } from "zod";
850
+ var ArtistGenreCountSchema = z26.object({
704
851
  genrePlaylist: GenrePlaylistUuidSchema,
705
852
  /** All the artist's songs in the genre playlist's subtree; drives pruning. */
706
- songsCount: z22.number().int().nonnegative(),
853
+ songsCount: z26.number().int().nonnegative(),
707
854
  /** The playable ones among them; drives node size and the play button. */
708
- tracksCount: z22.number().int().nonnegative()
855
+ tracksCount: z26.number().int().nonnegative()
709
856
  });
710
857
 
711
858
  // src/genre-tree/useArtistGenreCounts.ts
712
- var isNotFound2 = (error) => error instanceof AppError && error.code === "BAC4040" /* BACKEND_NOT_FOUND */;
859
+ var isNotFound3 = (error) => error instanceof AppError && error.code === "BAC4040" /* BACKEND_NOT_FOUND */;
713
860
  function useArtistGenreCounts(artistUuid, getBackendBaseUrl) {
714
861
  const { fetch } = useFetchWrapper(getBackendBaseUrl);
715
862
  return useQueryWithParse({
716
863
  queryKey: artistQueryKeys.genreCounts(getBackendBaseUrl(), artistUuid),
717
864
  // A missing artist is shown in the artist panel, not raised as an app-wide connectivity error.
718
865
  queryFn: () => fetch(artistEndpoints.genreCounts(artistUuid), true, false, void 0, void 0, false, true),
719
- schema: z23.array(ArtistGenreCountSchema),
866
+ schema: z27.array(ArtistGenreCountSchema),
720
867
  enabled: artistUuid !== null,
721
- placeholderData: keepPreviousData2,
722
- retry: (failureCount, error) => !isNotFound2(error) && failureCount < 3,
868
+ placeholderData: keepPreviousData3,
869
+ retry: (failureCount, error) => !isNotFound3(error) && failureCount < 3,
723
870
  context: "useArtistGenreCounts"
724
871
  });
725
872
  }
726
873
 
727
874
  // src/genre-tree/useGenreSearch.ts
728
- import { useState as useState2 } from "react";
875
+ import { useState as useState3 } from "react";
729
876
 
730
877
  // src/genre-tree/lib/genre-search.ts
731
878
  var searchGenrePlaylistsByName = (genrePlaylists, query) => {
@@ -743,8 +890,8 @@ function useGenreSearch({
743
890
  selectedName = null,
744
891
  onClear
745
892
  }) {
746
- const [query, setQuery] = useState2(selectedName ?? "");
747
- const [prevSelectedName, setPrevSelectedName] = useState2(selectedName);
893
+ const [query, setQuery] = useState3(selectedName ?? "");
894
+ const [prevSelectedName, setPrevSelectedName] = useState3(selectedName);
748
895
  if (selectedName !== prevSelectedName) {
749
896
  setPrevSelectedName(selectedName);
750
897
  setQuery(selectedName ?? "");
@@ -767,7 +914,7 @@ function useGenreSearch({
767
914
  }
768
915
 
769
916
  // src/genre-tree/useGenreTreeViewState.ts
770
- import { useCallback as useCallback2, useEffect as useEffect2, useMemo as useMemo2, useRef, useState as useState3 } from "react";
917
+ import { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useRef, useState as useState4 } from "react";
771
918
 
772
919
  // src/genre-tree/useVisibleGenrePlaylists.ts
773
920
  import { useMemo } from "react";
@@ -830,9 +977,9 @@ function useGenreTreeViewState({
830
977
  onSelectedNodeIdChange,
831
978
  criteriaOverviewSchema
832
979
  }) {
833
- const [internalViewMode, setInternalViewMode] = useState3("pop-core");
834
- const [allowWheelRotation, setAllowWheelRotation] = useState3(false);
835
- const [internalSelectedNodeId, setInternalSelectedNodeId] = useState3(null);
980
+ const [internalViewMode, setInternalViewMode] = useState4("pop-core");
981
+ const [allowWheelRotation, setAllowWheelRotation] = useState4(false);
982
+ const [internalSelectedNodeId, setInternalSelectedNodeId] = useState4(null);
836
983
  const isSelectionControlled = controlledSelectedNodeId !== void 0;
837
984
  const requestedSelectedNodeId = isSelectionControlled ? controlledSelectedNodeId : internalSelectedNodeId;
838
985
  const setSelectedNodeId = useCallback2(
@@ -851,7 +998,7 @@ function useGenreTreeViewState({
851
998
  [genrePlaylists, requestedSelectedNodeId]
852
999
  );
853
1000
  const selectedNodeId = selectedGenrePlaylist?.uuid ?? requestedSelectedNodeId;
854
- useEffect2(() => {
1001
+ useEffect3(() => {
855
1002
  if (!isSelectionControlled || requestedSelectedNodeId == null || selectedGenrePlaylist == null || requestedSelectedNodeId === selectedGenrePlaylist.uuid) {
856
1003
  return;
857
1004
  }
@@ -865,7 +1012,7 @@ function useGenreTreeViewState({
865
1012
  );
866
1013
  const prefetchGenreOverview = usePrefetchGenreOverview(scope, getBackendBaseUrl, criteriaOverviewSchema);
867
1014
  const hoverPrefetchTimerRef = useRef(null);
868
- useEffect2(
1015
+ useEffect3(
869
1016
  () => () => {
870
1017
  if (hoverPrefetchTimerRef.current) clearTimeout(hoverPrefetchTimerRef.current);
871
1018
  },
@@ -892,7 +1039,7 @@ function useGenreTreeViewState({
892
1039
  ),
893
1040
  [genrePlaylists]
894
1041
  );
895
- useEffect2(() => {
1042
+ useEffect3(() => {
896
1043
  if (!isLoading && needsPopCore(internalViewMode) && !canShowPopCore) {
897
1044
  setInternalViewMode("wheel");
898
1045
  }
@@ -928,13 +1075,13 @@ function useGenreTreeViewState({
928
1075
  }
929
1076
 
930
1077
  // src/genre-tree/TrackListContext.tsx
931
- import { createContext as createContext2, useState as useState5, useContext as useContext2, useCallback as useCallback4, useEffect as useEffect3, useMemo as useMemo4, useRef as useRef2 } from "react";
1078
+ import { createContext as createContext2, useState as useState6, useContext as useContext2, useCallback as useCallback4, useEffect as useEffect4, useMemo as useMemo4, useRef as useRef2 } from "react";
932
1079
 
933
1080
  // src/genre-tree/schemas/track-playlist-rel/without-playlist.ts
934
- import { z as z24 } from "zod";
935
- var makeTrackPlaylistRelSchema = (trackSchema) => z24.object({
1081
+ import { z as z28 } from "zod";
1082
+ var makeTrackPlaylistRelSchema = (trackSchema) => z28.object({
936
1083
  track: trackSchema,
937
- position: z24.number().min(0)
1084
+ position: z28.number().min(0)
938
1085
  });
939
1086
  var makeTrackPlaylistRelPageSchema = (trackSchema) => PaginatedResponseSchema(makeTrackPlaylistRelSchema(trackSchema));
940
1087
 
@@ -1038,11 +1185,11 @@ var TrackListOriginFromArtist = class extends TrackListOrigin {
1038
1185
  };
1039
1186
 
1040
1187
  // src/genre-tree/TrackListSidebarVisibilityContext.tsx
1041
- import { createContext, useContext, useState as useState4, useCallback as useCallback3, useMemo as useMemo3 } from "react";
1188
+ import { createContext, useContext, useState as useState5, useCallback as useCallback3, useMemo as useMemo3 } from "react";
1042
1189
  import { jsx } from "react/jsx-runtime";
1043
1190
  var TrackListSidebarVisibilityContext = createContext(void 0);
1044
1191
  function TrackListSidebarVisibilityProvider({ children }) {
1045
- const [isTrackListSidebarVisible, setIsTrackListSidebarVisible] = useState4(false);
1192
+ const [isTrackListSidebarVisible, setIsTrackListSidebarVisible] = useState5(false);
1046
1193
  const toggleTrackListSidebar = useCallback3(() => {
1047
1194
  setIsTrackListSidebarVisible((prev) => !prev);
1048
1195
  }, []);
@@ -1071,38 +1218,6 @@ function useTrackListSidebarVisibility() {
1071
1218
  return context;
1072
1219
  }
1073
1220
 
1074
- // src/genre-tree/schemas/song/detailed.ts
1075
- import { z as z25 } from "zod";
1076
- var YOUTUBE_UNPLAYABLE_REASON_LABELS = {
1077
- not_found: "Video unavailable",
1078
- not_embeddable: "Embedding disabled",
1079
- private: "Private video",
1080
- not_processed: "Video still processing",
1081
- region_whitelisted: "Region restricted"
1082
- };
1083
- var YOUTUBE_UNPLAYABLE_REASONS = Object.keys(YOUTUBE_UNPLAYABLE_REASON_LABELS);
1084
- var SongDetailedSchema = TrackBaseSchema.extend({
1085
- youtubeVideo: z25.object({
1086
- id: z25.string(),
1087
- // null = playable
1088
- unplayableReason: z25.enum(YOUTUBE_UNPLAYABLE_REASONS).nullable()
1089
- }).nullable(),
1090
- // null for hand-made/admin songs
1091
- musicbrainzRecordingId: z25.string().uuid().nullable()
1092
- });
1093
- var NO_VIDEO_LABEL = "No video available";
1094
- function isSong(track) {
1095
- return "youtubeVideo" in track;
1096
- }
1097
- function songUnplayableReason(song) {
1098
- if (!song.youtubeVideo) return NO_VIDEO_LABEL;
1099
- const reason = song.youtubeVideo.unplayableReason;
1100
- return reason ? YOUTUBE_UNPLAYABLE_REASON_LABELS[reason] : null;
1101
- }
1102
- function musicBrainzRecordingUrl(song) {
1103
- return song.musicbrainzRecordingId ? `https://musicbrainz.org/recording/${song.musicbrainzRecordingId}` : null;
1104
- }
1105
-
1106
1221
  // src/genre-tree/TrackListContext.tsx
1107
1222
  import { jsx as jsx2 } from "react/jsx-runtime";
1108
1223
  var TRACKS_PAGE_SIZE = 100;
@@ -1131,10 +1246,10 @@ function TrackListProvider({
1131
1246
  getBackendBaseUrl,
1132
1247
  schema
1133
1248
  }) {
1134
- const [trackList, setTrackList] = useState5(null);
1135
- const [selectedTrack, setSelectedTrack] = useState5(null);
1136
- const [autoAdvanceScrollRequest, setAutoAdvanceScrollRequest] = useState5(null);
1137
- const [runtimeUnplayableTrackIds, setRuntimeUnplayableTrackIds] = useState5(() => /* @__PURE__ */ new Set());
1249
+ const [trackList, setTrackList] = useState6(null);
1250
+ const [selectedTrack, setSelectedTrack] = useState6(null);
1251
+ const [autoAdvanceScrollRequest, setAutoAdvanceScrollRequest] = useState6(null);
1252
+ const [runtimeUnplayableTrackIds, setRuntimeUnplayableTrackIds] = useState6(() => /* @__PURE__ */ new Set());
1138
1253
  const { loadTrackForPlayer, setOnTrackEnd } = usePlayer();
1139
1254
  const { showTrackListSidebar } = useTrackListSidebarVisibility();
1140
1255
  const { fetch } = useFetchWrapper(getBackendBaseUrl);
@@ -1236,7 +1351,7 @@ function TrackListProvider({
1236
1351
  selectedTrack
1237
1352
  ]
1238
1353
  );
1239
- useEffect3(() => {
1354
+ useEffect4(() => {
1240
1355
  setOnTrackEnd(trackList && selectedTrack ? advanceAfterTrackEnd : null);
1241
1356
  return () => setOnTrackEnd(null);
1242
1357
  }, [advanceAfterTrackEnd, trackList, selectedTrack, setOnTrackEnd]);
@@ -1382,7 +1497,7 @@ function TrackListProvider({
1382
1497
  setSelectedTrack(previousTrack);
1383
1498
  loadTrackForPlayer(previousTrack.uuid);
1384
1499
  }, [clearDelayedTrackLoad, loadTrackForPlayer, previousTrack, requestAutoAdvanceScroll]);
1385
- useEffect3(() => {
1500
+ useEffect4(() => {
1386
1501
  const pending = pendingAdvanceRef.current;
1387
1502
  if (!pending) return;
1388
1503
  if (!trackList || trackList.origin !== pending.origin || selectedTrack?.uuid !== pending.trackId) {
@@ -1415,8 +1530,8 @@ function TrackListProvider({
1415
1530
  runtimeUnplayableTrackIds,
1416
1531
  selectedTrack
1417
1532
  ]);
1418
- useEffect3(() => clearDelayedTrackLoad, [clearDelayedTrackLoad]);
1419
- useEffect3(() => {
1533
+ useEffect4(() => clearDelayedTrackLoad, [clearDelayedTrackLoad]);
1534
+ useEffect4(() => {
1420
1535
  if (!trackList || trackList.nextPage === null || !selectedTrack) return;
1421
1536
  const index = trackList.tracks.findIndex((track) => track.uuid === selectedTrack.uuid);
1422
1537
  if (index !== -1 && trackList.tracks.length - index <= AUTO_LOAD_REMAINING_TRACKS) {
@@ -1485,24 +1600,24 @@ function ArtistNames({
1485
1600
  }
1486
1601
 
1487
1602
  // src/genre-tree/schemas/mb-artist.ts
1488
- import { z as z26 } from "zod";
1489
- var MbArtistDetailedSchema = z26.object({
1490
- musicbrainzId: z26.string().uuid(),
1491
- name: z26.string(),
1603
+ import { z as z29 } from "zod";
1604
+ var MbArtistDetailedSchema = z29.object({
1605
+ musicbrainzId: z29.string().uuid(),
1606
+ name: z29.string(),
1492
1607
  musicbrainzLink: HttpUrlSchema
1493
1608
  });
1494
1609
 
1495
1610
  // src/genre-tree/schemas/mb-recording.ts
1496
- import { z as z27 } from "zod";
1497
- var MbRecordingDetailedSchema = z27.object({
1498
- musicbrainzId: z27.string().uuid(),
1499
- title: z27.string(),
1500
- score: z27.number(),
1501
- musicbrainzArtists: z27.array(MbArtistDetailedSchema),
1611
+ import { z as z30 } from "zod";
1612
+ var MbRecordingDetailedSchema = z30.object({
1613
+ musicbrainzId: z30.string().uuid(),
1614
+ title: z30.string(),
1615
+ score: z30.number(),
1616
+ musicbrainzArtists: z30.array(MbArtistDetailedSchema),
1502
1617
  musicbrainzLink: HttpUrlSchema,
1503
- durationInSec: z27.number().min(0).nullable().optional(),
1504
- durationStrInHourMinSec: z27.string().nullable().optional(),
1505
- releaseDate: z27.union([z27.string().datetime(), z27.string()]).transform((val) => {
1618
+ durationInSec: z30.number().min(0).nullable().optional(),
1619
+ durationStrInHourMinSec: z30.string().nullable().optional(),
1620
+ releaseDate: z30.union([z30.string().datetime(), z30.string()]).transform((val) => {
1506
1621
  try {
1507
1622
  const date = new Date(val);
1508
1623
  if (isNaN(date.getTime())) {
@@ -1613,6 +1728,20 @@ export {
1613
1728
  ArtistSearchResultSchema,
1614
1729
  ArtistSearchResultsSchema,
1615
1730
  useArtistSearch,
1731
+ YOUTUBE_UNPLAYABLE_REASON_LABELS,
1732
+ SongDetailedSchema,
1733
+ NO_VIDEO_LABEL,
1734
+ isSong,
1735
+ songUnplayableReason,
1736
+ musicBrainzRecordingUrl,
1737
+ useSong,
1738
+ SongHistoryEntrySchema,
1739
+ SongHistorySchema,
1740
+ useSongHistory,
1741
+ SongSearchResultSchema,
1742
+ SongSearchResultsSchema,
1743
+ isSongSearchResultPlayable,
1744
+ useSongSearch,
1616
1745
  ArtistGenreCountSchema,
1617
1746
  useArtistGenreCounts,
1618
1747
  searchGenrePlaylistsByName,
@@ -1635,12 +1764,6 @@ export {
1635
1764
  TrackListOriginFromArtist,
1636
1765
  TrackListSidebarVisibilityProvider,
1637
1766
  useTrackListSidebarVisibility,
1638
- YOUTUBE_UNPLAYABLE_REASON_LABELS,
1639
- SongDetailedSchema,
1640
- NO_VIDEO_LABEL,
1641
- isSong,
1642
- songUnplayableReason,
1643
- musicBrainzRecordingUrl,
1644
1767
  useListTracks,
1645
1768
  TrackListProvider,
1646
1769
  useTrackList,
@@ -1653,4 +1776,4 @@ export {
1653
1776
  getReparentCandidates,
1654
1777
  editGenreSongPages
1655
1778
  };
1656
- //# sourceMappingURL=chunk-WI4455RN.js.map
1779
+ //# sourceMappingURL=chunk-4EBHHVZI.js.map