maotoumao/MusicFree · info

panel.musicItemLyricOptions.deleteFail

Error message

panel.musicItemLyricOptions.deleteFail

What it means

Toast shown when removing a locally-associated lyric fails. onPress calls lyricManager.removeLocalLyric(musicItem) synchronously; a thrown exception (missing file, media library error, invalid musicItem) is caught and shown as this toast with reason.

Source

Thrown at src/components/panels/types/musicItemLyricOptions.tsx:191

                    hidePanel();
                } catch (e: any) {
                    console.log(e);
                    Toast.warn(t("panel.musicItemLyricOptions.settingFail", {
                        reason: e?.message,
                    }));
                }
            },
        },
        {
            icon: "trash-outline",
            title: t("panel.musicItemLyricOptions.deleteLocalLyric"),
            async onPress() {
                try {
                    lyricManager.removeLocalLyric(musicItem);
                    hidePanel();
                } catch (e: any) {
                    console.log(e);
                    Toast.warn(t("panel.musicItemLyricOptions.deleteFail", {
                        reason: e?.message,
                    }));
                }
            },
        },
    ];

    return (
        <PanelBase
            renderBody={() => (
                <>
                    <View style={style.header}>
                        <FastImage
                            style={style.artwork}
                            source={musicItem?.artwork}
                            placeholderSource={ImgAsset.albumDefault}
                        />
                        <View style={style.content}>

View on GitHub (pinned to d118b18b3d)

Solutions

  1. Check console.log(e) and the toast reason for the underlying exception
  2. Verify the local lyric file still exists / clean up stale lyric metadata in the media library
  3. Grant the app storage permissions and retry
  4. Re-associate the lyric then delete again if metadata is corrupt

Example fix

// before
lyricManager.removeLocalLyric(musicItem);
// after
try {
    lyricManager.removeLocalLyric(musicItem);
} catch (e) {
    // tolerate missing-file: treat as already removed
    console.warn('removeLocalLyric failed', e);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// removal can fail on missing files; verify association first
const hasLocal = musicItem?.$localLyric != null; // adjust to your metadata source

Type guard

function canRemoveLyric(m: any): boolean {
    return !!m && typeof m.id !== 'undefined';
}

Try / catch

try {
    lyricManager.removeLocalLyric(musicItem);
    hidePanel();
} catch (e: any) {
    console.warn(e);
    Toast.warn(t('panel.musicItemLyricOptions.deleteFail', { reason: e?.message }));
}

Prevention

When it happens

Trigger: Pressing 'delete lyric' for a track when removeLocalLyric throws — e.g. the lyric file was already deleted externally, the musicItem has no associated local lyric metadata, or filesystem permissions block deletion.

Common situations: User manually deleted the .lrc file from storage so removal targets a missing file; permission errors on app storage; corrupt lyric metadata in the media library.

Related errors


AI-assisted analysis of maotoumao/MusicFree@d118b18b3d (2026-08-30). Data as JSON: /api/errors/d0c0e2f1d540c6fe. Report an issue: GitHub.