Closed markmccoid closed 4 months ago
This is because there are unescaped quotes as well as line returns. the line returns I can remove easily, but the embedded quotes are a bit more problematic.
Thanks for reporting... this is strange, because I use JsonSerializer
. Could you give me an example for a value that fails? Thank you.
Similar case, that's why I'm commenting on this issue. Using tone-0.1.5-linux-x64, but similar behaviour was observed on windows as well. It seems like tone is inserting custom word breaks into the json output, for me it would insert a word break if the line would exceed 80 characters. Usually printing lines that exceed the consoles text width will wrap to the next line. I've encountered this issue wile working with an audiobook that contained a lengthy description / long chapter titles.
Example output:
tone dump file.mp3 --format json > tone.json
[...]
"additionalFields": {
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut etiam sit
amet nisl purus in mollis nunc. Morbi quis commodo odio aenean sed adipiscing
diam. Porta nibh venenatis cras sed felis eget velit aliquet. Urna et pharetra
pharetra massa massa ultricies. In nisl nisi scelerisque eu ultrices vitae. Elit
at imperdiet dui accumsan sit amet. Massa tempor nec feugiat nisl pretium fusce
id velit. Odio facilisis mauris sit amet massa. Mauris pellentesque pulvinar
pellentesque habitant morbi tristique senectus. Quam lacus suspendisse faucibus
interdum. Ultricies leo integer malesuada nunc vel risus commodo viverra. Etiam
dignissim diam quis enim lobortis scelerisque. Quis enim lobortis scelerisque
fermentum dui faucibus. Sodales ut etiam sit amet nisl purus. Ac tincidunt vitae
semper quis lectus. Et odio pellentesque diam volutpat commodo. Semper auctor
neque vitae tempus quam pellentesque nec nam aliquam. Ut lectus arcu bibendum at
varius. Donec ac odio tempor orci dapibus ultrices in."
}
[...]
How it should look like (more or less, console will wrap automatically):
cat test.json
[...]
"additionalFields": {
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut etiam sit amet nisl purus in mollis nunc. Morbi quis commodo odio aenean sed adipiscing diam. Porta nibh venenatis cras sed felis eget velit aliquet. Urna et pharetra pharetra massa massa ultricies. In nisl nisi scelerisque eu ultrices vitae. Elit at imperdiet dui accumsan sit amet. Massa tempor nec feugiat nisl pretium fusce id velit. Odio facilisis mauris sit amet massa. Mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus. Quam lacus suspendisse faucibus interdum. Ultricies leo integer malesuada nunc vel risus commodo viverra. Etiam dignissim diam quis enim lobortis scelerisque. Quis enim lobortis scelerisque fermentum dui faucibus. Sodales ut etiam sit amet nisl purus. Ac tincidunt vitae semper quis lectus. Et odio pellentesque diam volutpat commodo. Semper auctor neque vitae tempus quam pellentesque nec nam aliquam. Ut lectus arcu bibendum at varius. Donec ac odio tempor orci dapibus ultrices in."
}
[...]
How it should look like (more or less, console will wrap automatically):
@euphoria0
This might be an issue with the Spectre.Console
lib. Currently I'm busy with another project but in November I'll be able to fix some things. Sorry for the delay.
@euphoria0
Since tone 0.1.6
there is an --export
option to export into a file without output redirection. Should solve the problem. Feel free to reopen the issue, if the issue still exists.
I'm using Tone to read m4b and mp3 audiobook files and pull the metadata out.
First off, it is a truly awesome tool!!
However, I did find that most of the Description and Comments won't get past JavaScriptt's JSON.parse() .
This is because there are unescaped quotes as well as line returns. the line returns I can remove easily, but the embedded quotes are a bit more problematic.
This is the statement I'm using:
tone dump "${pathPlusFilename}" --format json --exclude-property=description --exclude-property=comment --exclude-property=embeddedPictures
I'm excluding the keys that had the most issues.
Thanks for all your work on this project!!