Compare commits

...

3 Commits

Author SHA1 Message Date
54ed2e08e7 fix(config): reorder hidden_files and extension_colon for correct configuration structure 2026-06-10 16:42:53 -04:00
aa67b9ee17 fix(IECPage): update section title from "Directory Settings" to "Directory Enhancements" for clarity
feat(settings): add getTextWithFallback function to improve file reading reliability
fix(config): reorder nfo_header in directory settings for consistency
2026-06-10 16:37:38 -04:00
fed6a35e59 feat(config): add extension_colon option to directory settings 2026-06-10 16:15:13 -04:00
3 changed files with 14 additions and 5 deletions

View File

@ -169,7 +169,7 @@ export default function IECPage({ config, setConfig }: IECPageProps) {
/> />
)} )}
<h2 className="text-sm text-neutral-500 pt-4 flex items-center gap-2"><List className="w-4 h-4" /> Directory Settings</h2> <h2 className="text-sm text-neutral-500 pt-4 flex items-center gap-2"><List className="w-4 h-4" /> Directory Enhancements</h2>
<div className="bg-white border border-neutral-200 rounded-lg divide-y divide-neutral-200"> <div className="bg-white border border-neutral-200 rounded-lg divide-y divide-neutral-200">
{Object.entries(iec.directory || {}).map(([key, value]) => ( {Object.entries(iec.directory || {}).map(([key, value]) => (

View File

@ -40,12 +40,20 @@ const SAVED_INDICATOR_MS = 1500;
export type SettingsConfig = Record<string, any>; export type SettingsConfig = Record<string, any>;
/** Try primary path first, fall back to secondary. Returns null if both fail. */
async function getTextWithFallback(primary: string, fallback: string): Promise<string | null> {
try { return await getFileContents(primary).then(b => b.text()); } catch { /* try fallback */ }
try { return await getFileContents(fallback).then(b => b.text()); } catch { /* both failed */ }
return null;
}
/** Read both config files from the WebDAV server and merge them. Returns null on failure. */ /** Read both config files from the WebDAV server and merge them. Returns null on failure. */
export async function readSettings(): Promise<SettingsConfig | null> { export async function readSettings(): Promise<SettingsConfig | null> {
try { try {
// Mirror firmware priority: /sd/.sys/ first, fall back to /.sys/
const [configText, devicesText] = await Promise.all([ const [configText, devicesText] = await Promise.all([
getFileContents(SETTINGS_PATH).then(b => b.text()), getTextWithFallback('/sd' + SETTINGS_PATH, SETTINGS_PATH),
getFileContents(DEVICES_PATH).then(b => b.text()).catch(() => null), getTextWithFallback('/sd' + DEVICES_PATH, DEVICES_PATH),
]); ]);
if (!configText) return null; if (!configText) return null;
const config = JSON.parse(configText); const config = JSON.parse(configText);

View File

@ -91,10 +91,11 @@
}, },
"directory": { "directory": {
"force_0801": 1, "force_0801": 1,
"nfo_header": 1,
"bam_message": 1, "bam_message": 1,
"hidden_files": 1, "nfo_header": 1,
"hidden_dirs": 1, "hidden_dirs": 1,
"hidden_files": 1,
"extension_colon": 1,
"date_time": 1, "date_time": 1,
"load_address": 1, "load_address": 1,
"sys_address": 1, "sys_address": 1,