Robyer / foo-httpcontrol

Automatically exported from code.google.com/p/foo-httpcontrol
2 stars 2 forks source link

line end characters break playlist display #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Obtain files whse tags include end-lines.
2. Insert them in a foobar2000 into a playlist.
3. Browse to that playlist through the web interface.

What is the expected output? What do you see instead?
One expects to see the playlist.
One sees an error:

"An AJAX error occured.

Possible reasons:

    JSON parser got stuck on erroneous data;
    borken connection;
    god knows what else.
Restart template or think of something else."

and also:

"settings.url: /ajquery/?cmd=SwitchPlaylist&¶m1=10¶m3=js/state.json

XMLHttpRequest.responseText: 
{"playlist":[{"a":"DW-WORLD.DE | Deutsche Welle","b":"Correspondents report | 
Deutsche Welle","n":"01","t":"France expels Libyan diplomats 

","l":"3:10","ls":"190","d":"2011"}],
"playlists":[{"name":"Default","count":"0"},{"name":"fixme 
first","count":"1"},{"name":"fixme 
second","count":"1"},{"name":"fixme","count":"172853"},{"name":"splitme","count"
:"3736"},{"name":"convertme","count":"3165"},{"name":"fixtags","count":"351"},{"
name":"pod","count":"4546"},{"name":"newpod","count":"419"},{"name":"streamrip",
"count":"5"},{"name":"DW-WORLD.DE","count":"1"},{"name":"Library Viewer 
Selection","count":"1"},{"name":"from 
Explorer","count":"60"},{"name":"Query","count":"313"}],
"playbackOrder":"0",
"volume":"2",
"volumedb":"320",
"SAC":"",
"SAQ":"",
"isPlaying":"0",
"isPaused":"0",
"isEnqueueing":"0",
"playingItem":"?",
"focusedItem":"?",
"prevplayedItem":"",
"itemPlayingPos":"0",
"itemPlayingLen":"0",
"playlistPage":"0",
"playlistItemsPerPage":"30",
"playlistItemsCount":"1",
"playlistActive":"10",
"playlistPlaying":"?",
"playlistPlayingItemsCount":"?",
"playlistTotalTime":"3:10",
"queueTotalTime":"",
"isUndoAvailable":"1",
"isRedoAvailable":"0",
"helper1":"",
"helper2":"",
"helper3":"",
"albumArt":"/ajquery/img/icon1rx.png"}

XMLHttpRequest.statusText: parsererror"

What version of the product are you using? On what operating system?
Windows XP, foobar 1.1.7, foo_httpcontrol 0.97.8.

Please provide any additional information below.
Vakata skin also fails, but it does not throw an error message.

Original issue reported on code.google.com by lucisan...@gmail.com on 12 Jun 2011 at 7:50

GoogleCodeExporter commented 9 years ago
it's hard to get rid of cr/lf characters in state json array on component side 
as it breaks compatibility with various other templates, so you have to deal 
with them using titleformatting. I suggest sanitizing artist and album fields 
with $fix_eol() function, like demonstrated in attached file.
this fix will make it in next ajquery version.

Original comment by oblikoamorale@gmail.com on 13 Jun 2011 at 1:09

Attachments: