{"record":{"id":"1b958764a4513450","repo":"maotoumao/MusicFree","slug":"toast-currentqualitynotavailableforcurrentmusic","errorCode":null,"errorMessage":"toast.currentQualityNotAvailableForCurrentMusic","messagePattern":"toast\\.currentQualityNotAvailableForCurrentMusic","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/pages/musicDetail/components/content/albumCover/operations.tsx","lineNumber":53,"sourceCode":"    return (\r\n        <View\r\n            style={[\r\n                styles.wrapper,\r\n                orientation === \"horizontal\" ? styles.horizontalWrapper : null,\r\n            ]}>\r\n            <HeartIcon />\r\n            <Pressable\r\n                onPress={() => {\r\n                    if (!musicItem) {\r\n                        return;\r\n                    }\r\n                    showPanel(\"MusicQuality\", {\r\n                        musicItem,\r\n                        async onQualityPress(quality) {\r\n                            const changeResult =\r\n                                await TrackPlayer.changeQuality(quality);\r\n                            if (!changeResult) {\r\n                                Toast.warn(i18n.t(\"toast.currentQualityNotAvailableForCurrentMusic\"));\r\n                            }\r\n                        },\r\n                    });\r\n                }}>\r\n                <Image\r\n                    source={ImgAsset.quality[currentQuality]}\r\n                    style={styles.quality}\r\n                />\r\n            </Pressable>\r\n            <Icon\r\n                name={isDownloaded ? \"check-circle-outline\" : \"arrow-down-tray\"}\r\n                size={iconSizeConst.normal}\r\n                color=\"white\"\r\n                onPress={() => {\r\n                    if (musicItem && !isDownloaded) {\r\n                        showPanel(\"MusicQuality\", {\r\n                            type: \"download\",\r\n                            musicItem,\r","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/maotoumao/MusicFree/blob/d118b18b3d0c904400f7eea7bf99c0ceec6c1aee/src/pages/musicDetail/components/content/albumCover/operations.tsx#L35-L71","documentation":"Toast shown when a requested audio quality change is not available for the current track. onQualityPress calls TrackPlayer.changeQuality(quality); a falsy changeResult means the player could not switch to that quality, so a warning is displayed instead of throwing.","triggerScenarios":"Selecting a quality option (e.g. hires/flac) that the current music source/URL does not actually provide — changeQuality returns false rather than throwing.","commonSituations":"Plugin only exposes one bitrate but the UI lists more; quality URL expired or requires VIP on the source; track loaded from a source without quality variants.","solutions":["Pick a quality listed as supported for this track's source","Reload the track (or switch source plugin) so quality variants refresh","Check whether the source requires login/VIP for higher qualities"],"exampleFix":"// before\nconst changeResult = await TrackPlayer.changeQuality(quality);\nif (!changeResult) {\n    Toast.warn(i18n.t(\"toast.currentQualityNotAvailableForCurrentMusic\"));\n}\n// after\nconst changeResult = await TrackPlayer.changeQuality(quality);\nif (!changeResult) {\n    Toast.warn(i18n.t(\"toast.currentQualityNotAvailableForCurrentMusic\"));\n    await TrackPlayer.changeQuality(currentQuality); // revert to previous quality\n}","handlingStrategy":"fallback","validationCode":"const supported = qualityList.includes(quality); // only offer qualities advertised by the source\nif (!supported) return;","typeGuard":null,"tryCatchPattern":"const ok = await TrackPlayer.changeQuality(quality);\nif (!ok) {\n    Toast.warn(i18n.t('toast.currentQualityNotAvailableForCurrentMusic'));\n    await TrackPlayer.changeQuality(previousQuality); // fallback\n}","preventionTips":["Only render quality options the source reports as available","Revert to the previous quality on failure","Refresh quality list when the track or plugin changes"],"tags":["audio-quality","playback"],"backgroundTag":"quality-unavailable","analyzedSha":"d118b18b3d0c904400f7eea7bf99c0ceec6c1aee","analyzedAt":"2026-08-30T11:49:12.932Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}