Fixed conversion to mp3 command main

This commit is contained in:
Nikolaj Frey 2024-02-23 13:56:06 +11:00
parent f571ee1470
commit cbfcaccd52
3 changed files with 27 additions and 6 deletions

View File

@ -146,10 +146,10 @@
]
},
{
"name": "commanderMp3ToMp4",
"title": "mp3 to mp4",
"name": "commanderMp4ToMp3",
"title": "mp4 to mp3",
"description": "Converts an mp4 into an mp3 using ffmpeg at 320Kbps",
"mode": "view",
"mode": "no-view",
"fallbackText": "test2",
"keywords": [
"commander",
@ -158,7 +158,7 @@
],
"preferences": [
{
"name": "name",
"name": "mp4ToMp3",
"required": false,
"type": "textfield",
"key": "name",

View File

@ -39,8 +39,29 @@ export default async function Command(props: any) {
return
}
console.log('nik process.argv', process.argv)
console.log('nik process.cwd()', process.cwd())
// log preferences
console.log(preferences)
if (Object.hasOwnProperty.call(preferences, 'mp4ToMp3')) {
console.log('here !')
const selectedFiles = await getSelectedFiles();
await runOperation({
operation: () => any(selectedFiles, 'MP3'),
selectedImages: selectedFiles,
inProgressMessage: "Conversion in progress...",
successMessage: "Converted",
failureMessage: "Failed to convert",
});
await showHUD(`🌈 MP4 to MP3 🦄`)
return
}
return (
<List searchBarPlaceholder="Search image transformations...">
<List.EmptyView