Kid3 for android7/5/2023 ![]() ![]() So, those double-quotes were never being passed to the program at all. These are all identical: "set Title "TITLE"" What actually is happening is you are concatenating a quoted string, an unquoted title, and then an empty quoted string, all into a single command-line argument. ![]() All of those double-quote characters are interpreted by the shell, so none of them will be passed to the kid3-cli program. You are not specifying an argument with double-quotes in the argument. ![]() The double-quote characters are only special in a shell (like bash), where they indicate that a value with spaces should not be split by the shell into multiple arguments.īut there is more. Which means you want to pass each quoted argument as a single parameter to ProcessBuilder, without those quotes. What you’re really doing is this: kid3-cli -c "tag 1" -c "set Title "TITLE"" -c "set Artist "ARTIST"" FILENAME.EXT It would be nearly impossible for any parser to know which quote characters are the end of the argument and which ones are part of the argument. Nesting quotes inside quotes doesn’t just work magically. Yes, it “works,” but not for the reasons you think. Double-quotes are appropriate for shells (like bash), not for direct execution in programs.įirst, let’s look at the command-line version of your command:.Your command is not doing what you think it’s doing. artist "\"\"" path.toString() "\"") Īlthough it leads to the correct string: INFO: COMMAND: bash -c "kid3-cli -c "tag 1" -c "set Title "Unfinished Cathedral"" -c "set Artist "DAN TERMINUS""/home/sarah/Music/Indexing/Temp/DAN TERMINUS - Unfinished Cathedral.mp3" this also fails (although it has the exact same output when the command is queried, and if run on bash, will change the tags): new ProcessBuilder(Arrays.asList("bash", "-c", "\"kid3-cli -c \"tag 1\" -c \"set Title \"" title "\"\" -c \"set Artist \"" I'm fairly certain that I'm doing something wrong with regards to the number of entries to give the processbuilder, but I'm not sure. Name: DAN TERMINUS - Unfinished Cathedral.mp3 When I run the program (with a few helpful debugging statements, I get: INFO: COMMAND: kid3-cli -c "tag 1" -c "set Title "Unfinished Cathedral"" -c "set Artist "DAN TERMINUS"" /home/sarah/Music/Indexing/Temp/DAN TERMINUS - Unfinished Cathedral.mp3Īnd the tags come up as: (base) kid3-cli -c "get" DAN\ TERMINUS\ -\ Unfinished\ Cathedral.mp3įile: MPEG 1 Layer 3 128 kbps 44100 Hz Joint Stereo 4:38 Whether or not it was successful can be verified with: kid3-cli -c "get" SONG.EXT I also thought to treat the quotes as a single parameter: new ProcessBuilder(Arrays.asList("kid3-cli", "-c", "\"tag 1\"", "-c", "\"set Title \"" title "\"\"", This command works: kid3-cli -c "tag 1" -c "set Title "TITLE"" -c "set Artist "ARTIST"" FILENAME.EXT I'm on Linux and am writing a subroutine to change the ID tag of an mp3 file. ![]()
0 Comments
Leave a Reply. |