···66 </p>
77 <div id="options">
88 <p>
99+ <!-- TODO: Need to check if supported on this device -->
910 <a href="../../input/native-fs/" class="with-icon">
1011 <i class="iconoir-open-in-window"></i>
1112 <strong>My device</strong>
+16-4
src/pages/input/native-fs/_applet.astro
···9292 // ACTIONS
9393 ////////////////////////////////////////////
9494 const consult = async (fileUriOrScheme: string) => {
9595- const isSupported = !!(globalThis as any).showDirectoryPicker;
9696- if (!isSupported) {
9595+ if (!isSupported()) {
9796 return { supported: false, reason: "File System Access API is not supported" };
9897 }
9998···109108 };
110109111110 const list = async (cachedTracks: Track[] = []) => {
111111+ if (!isSupported()) return cachedTracks;
112112+113113+ // Continue if supported
112114 const handles = await fetchHandlesList();
115115+116116+ // Recursive listing of all tracks of available handles
113117 const processed: Track[][] = await Promise.all(
114118 handles.map(({ id, handle }) => {
115119 return recursiveList(handle, id, []);
116120 }),
117121 );
118122123123+ // Group tracks by handle id & index by track uri
119124 const cache = cachedTracks.reduce(
120125 (acc: Record<string, Record<string, Track>>, track: Track) => {
121126 const handleId = trackHandleId(track);
···126131 {},
127132 );
128133134134+ // Replace indexes in groups of which we have the handle.
135135+ // Keeping around tracks with handles we don't have access to,
136136+ // and removing tracks that are no longer available (for handles we do have access to).
129137 const groups = processed.flat(1).reduce(
130138 (acc, track) => {
131139 const handleId = trackHandleId(track);
···138146 }, cache),
139147 );
140148149149+ // Transform in track list and sort by uri
141150 const data = Object.values(groups)
142151 .map((tracks) => Object.values(tracks))
143152 .flat(1)
···153162 };
154163155164 const resolve = async (fileUri: string) => {
156156- const isSupported = !!(globalThis as any).showDirectoryPicker;
157157- if (!isSupported) return undefined;
165165+ if (!isSupported()) return undefined;
158166159167 const uri = URI.parse(fileUri);
160168 if (uri.scheme !== SCHEME) return undefined;
···227235 return Object.entries(await fetchHandles()).map(([id, handle]) => {
228236 return { id, handle };
229237 });
238238+ }
239239+240240+ function isSupported() {
241241+ return !!(globalThis as any).showDirectoryPicker;
230242 }
231243232244 function trackCid(track: Track): string | undefined {
+1-2
src/scripts/themes/webamp/index.ts
···11import Webamp from "webamp";
22-// import "98.css";
3244-import type { Output, Track } from "@applets/core/types.d.ts";
33+import type { Track } from "@applets/core/types.d.ts";
54import { applet } from "../../theme.ts";
6576////////////////////////////////////////////