After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 751265 - JSON import errors
JSON import errors
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Importing
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-20 18:08 UTC by Thomas
Modified: 2015-06-29 11:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example json with import error (110 bytes, application/json)
2015-06-22 17:09 UTC, Thomas
Details

Description Thomas 2015-06-20 18:08:54 UTC
I've added an Audiobook folder to my Rhythmbox library. Each audiobook mp3 is accompanied by a .json file with a bookmarked position. Rhythmbox is confused by the .json files and reports each .json within Import Errors.

Would it be possible to instruct Rhythmbox to ignore the .json files? As you did with other text files.

Thank you for your time.

Thomas
Comment 1 Jonathan Matthew 2015-06-20 22:32:27 UTC
What error message are you getting for these files?

Can you attach the output you get from 'gst-discoverer-1.0 /path/to/file.json'?
Comment 2 Thomas 2015-06-21 19:29:50 UTC
Some more information & output:

The audiobooks in question are in a 32Gb USB stick. To which I've added a hidden .is_audio_player file. So that Rhythmbox mounts and displays the stick as an audio device.

The contents of the USB stick are synchronised with an Android smartphone and Android tablet via Syncthing.

The phone and tablet both run the Listen Audiobook Player application. It is this application which adds the .json bookmarking files. Which the application synchronises between Android devices via Dropbox.

My Rhythmbox Music library has sub libraries for audiobooks, documentaries, drama, music and poetry. All of which live in a NAS box. 

I punt new audiobooks to the phone and tablet with a drag and drop of an audiobook from the sub-library on to the Audiobook device. Which works seamlessly until I play an audiobook on either device and the Listen application then creates a .json bookmark.

To make things more complicated, Rhythmbox is only reporting 3 of the 4 .json files within Import Errors. The Errors being “Could not determine type of stream”.

I wasn't sure how to save the output to a file so I've pasted the output below. Hope this is OK.


thomas@PC:~$ gst-discoverer-1.0 /media/thomas/AUDIOBOOKS/mp3/Marilynne Robinson - Gilead/Marilynne Robinson - Gilead.lap.json
Analyzing file:///media/thomas/AUDIOBOOKS/mp3/Marilynne
Done discovering file:///media/thomas/AUDIOBOOKS/mp3/Marilynne
An error was encountered while discovering the file
 Resource not found.

Analyzing file:///home/thomas/Robinson
Done discovering file:///home/thomas/Robinson
An error was encountered while discovering the file
 Resource not found.

Analyzing file:///home/thomas/-
Done discovering file:///home/thomas/-
An error was encountered while discovering the file
 Resource not found.

Analyzing file:///home/thomas/Gilead/Marilynne
Done discovering file:///home/thomas/Gilead/Marilynne
An error was encountered while discovering the file
 Resource not found.

Analyzing file:///home/thomas/Robinson
Done discovering file:///home/thomas/Robinson
An error was encountered while discovering the file
 Resource not found.

Analyzing file:///home/thomas/-
Done discovering file:///home/thomas/-
An error was encountered while discovering the file
 Resource not found.

Analyzing file:///home/thomas/Gilead.lap.json
Done discovering file:///home/thomas/Gilead.lap.json
An error was encountered while discovering the file
 Resource not found.
Comment 3 Jonathan Matthew 2015-06-21 22:24:24 UTC
OK, so the actual problem here is that GStreamer's text/plain typefinder (it doesn't have one for json) isn't working on these files, which probably means they aren't correctly encoded.  Can you attach one of the files?
Comment 4 Bastien Nocera 2015-06-22 07:55:37 UTC
(In reply to Jonathan Matthew from comment #3)
> OK, so the actual problem here is that GStreamer's text/plain typefinder (it
> doesn't have one for json) isn't working on these files

Or rather that he didn't run them on these files. Thomas, put quotes around your filename, or simply use your shell's Tab key to auto-complete. It should have been:
gst-discoverer-1.0 "/media/thomas/AUDIOBOOKS/mp3/Marilynne Robinson - Gilead/Marilynne Robinson - Gilead.lap.json"

>, which probably
> means they aren't correctly encoded.  Can you attach one of the files?
Comment 5 Thomas 2015-06-22 17:09:09 UTC
Created attachment 305843 [details]
example json with import error
Comment 6 Thomas 2015-06-22 17:11:07 UTC
Comment on attachment 305843 [details]
example json with import error

Also ran the line suggested. The result was shorter but essentially the same.

thomas@PC:~$ gst-discoverer-1.0 "/media/thomas/AUDIOBOOKS/mp3/Marilynne Robinson - Gilead/Marilynne Robinson - Gilead.lap.json"
Analyzing file:///media/thomas/AUDIOBOOKS/mp3/Marilynne%20Robinson%20-%20Gilead/Marilynne%20Robinson%20-%20Gilead.lap.json
Done discovering file:///media/thomas/AUDIOBOOKS/mp3/Marilynne%20Robinson%20-%20Gilead/Marilynne%20Robinson%20-%20Gilead.lap.json
An error was encountered while discovering the file
 Resource not found.
Comment 7 Bastien Nocera 2015-06-23 07:53:26 UTC
(In reply to Thomas from comment #6)
> Comment on attachment 305843 [details]
> example json with import error
> 
> Also ran the line suggested. The result was shorter but essentially the same.
<snip>
>  Resource not found.

You typed it wrong again. Maybe you want to try drag'n'dropping it from the file manager instead?
Comment 8 Thomas 2015-06-23 12:01:09 UTC
Sorry for the incompetence. Dragged and dropped results below. Thanks for your patience.

thomas@PC:~$ gst-discoverer-1.0 '/media/thomas/AUDIOBOOKS/mp3/Marilynne Robinson - Gilead/Marilynne Robinson - Gilead.lap.json'
Analyzing file:///media/thomas/AUDIOBOOKS/mp3/Marilynne%20Robinson%20-%20Gilead/Marilynne%20Robinson%20-%20Gilead.lap.json
Done discovering file:///media/thomas/AUDIOBOOKS/mp3/Marilynne%20Robinson%20-%20Gilead/Marilynne%20Robinson%20-%20Gilead.lap.json
An error was encountered while discovering the file
 Could not determine type of stream.
Comment 9 Jonathan Matthew 2015-06-29 11:25:45 UTC
While gstreamer isn't helping us much here, everything would be fine if the rhythmbox metadata code was handling errors as everything else expects it to.  Files smaller than 4k that cannot be identified (like these json files) should be ignored.
Comment 10 Jonathan Matthew 2015-06-29 11:43:01 UTC
fixed in commit 2447525