Bugzilla – Bug 5121
Accented characters in Genre broken in Random Mix Web Interface
Last modified: 2008-12-18 11:12:53 UTC
When using FLAC with multiple genres (; separated) and probably also with other sorts of file and without multiple genres, accented characters don't show in the "random mix genre selection". Those genres appear as a select box but without any label. For example: [ ] Chamber [ ] Pop [ ] Chamber Pop [ ] Pop Rock [ ] Chanson [ ] Pop-Soul [ ] [ ] Post-bop [ ] Choral [ ] Post-Punk The missing genre is "Chanson Française". In the database, tags are correct: mysql> select genres.name from genres order by genres.name; +-----------------------------+ | name | +-----------------------------+ | ... | | Chamber | | Chamber Pop | | Chanson | | Chanson Française | | Choral | | Cl18 | When browsing genres on the squeezebox and when watching files details with the web interface, all is perfect.
Here is the source code resulting in html code: <tr class="even"> <td><input name="genre_19" id="genre_19" value="1" onclick="changeNumSelected(this)" type="checkbox"> <label for="genre_19">Chanson</label></td> <td><input name="genre_43" id="genre_43" value="1" onclick="changeNumSelected(this)" type="checkbox"> <label for="genre_43">Pop-Soul</label></td> </tr> <tr class="odd"> <td><input name="genre_" id="genre_" value="1" onclick="changeNumSelected(this)" type="checkbox"> <label for="genre_"></label></td> <td><input name="genre_53" id="genre_53" value="1" onclick="changeNumSelected(this)" type="checkbox"> <label for="genre_53">Post-bop</label></td> </tr>
Created attachment 2042 [details] genre tag example
Verified with attached file.
It seems that this patch get rid of the problem: < [%- genreid = "genre_" _ pluginRandomGenreList.$genre.id %] --- > [%- genreid = "genre_" _ pluginRandomGenreList.item("$genre").id %] 84c89 < <label for="[% genreid %]">[% pluginRandomGenreList.$genre.name | html %]</label></td> --- > <label for="[% genreid %]">[% pluginRandomGenreList.item("$genre").name | html %]</label></td> 167d171 <
I forgot the path of the file the patch was for: SlimServer_v6.5.2/Plugins/RandomPlay/HTML/EN/plugins/RandomPlay/randomplay_list.html < [%- genreid = "genre_" _ pluginRandomGenreList.$genre.id %] --- > [%- genreid = "genre_" _ pluginRandomGenreList.item("$genre").id %] 84c89 < <label for="[% genreid %]">[% pluginRandomGenreList.$genre.name | html %]</label></td> --- > <label for="[% genreid %]">[% pluginRandomGenreList.item("$genre").name | html %]</label></td> 167d171 <
When display fixed, the selection is still broken. If "Chanson Française" is clicked and saved, the new page appear without the style selected. Here is the complete code with this last correction: (line 171 of "Plugins/RandomPlay/HTML/EN/plugins/RandomPlay/randomplay_list.html" ) =============================== <table border="0" width="100%">[% USE table pluginRandomGenreList.keys.sort, cols=2, pad=0 %] [%- FOREACH genrerow = table.rows %] <tr class="[% odd ? "odd" : "even" %]"> [%- FOREACH genre = genrerow %] [%- genreid = "genre_" _ pluginRandomGenreList.item("$genre").id %] <td><input type="checkbox" name="[% genreid %]" id="[% genreid %]" value="1" [% pluginRandomGenreList.item("$genre").enabled ? "checked" : "" %] onclick="changeNumSelected(this)"> <label for="[% genreid %]">[% pluginRandomGenreList.item("$genre").name | html %]</label></td> [%- END %] </tr> [% odd = (not odd) %] [%- END %] </table> =============================== Sorry not commit it in SVN, can anybody commit code in the repository?
Robin - could you please do a "svn diff" against a clean SVN tree? How did you tag your files, what encoding are you using? I did some tests with my files (MP3 only), but wasn't able to reproduce your case.
I think Ross Levine verified the bug with a flac file (see attached file on this post). I tag my flac files using latest version of MP3Tag on WinXP. I think it's using unicode utf8. Problem is the same with slimserver on XP or on Linux. The problem is clearly related to "TemplateToolkit" as I debugged output Hash data from GetGenre in RandomPlay module and all genres was present, even genres with accented characters. The workaround was for me te replace < [%- genreid = "genre_" _ pluginRandomGenreList.$genre.id %] With: > [%- genreid = "genre_" _ pluginRandomGenreList.item("$genre").id %] I'll try to get clean svn this evening and post the diff as you requested. For a quick start, what is the "repository name/command line" to get a clean svn checkout?
svn co https://svn.slimdevices.com/repos/slim/trunk/server Thanks!
I may have missed something with svn but after the CO, i can't find the file I modified (i'm not skilled with slimserver tree handling nor with svn). I modified /usr/local/squeezebox/SlimServer_v6.5.2/Plugins/RandomPlay/HTML/EN/plugins/RandomPlay/randomplay_list.html And only find in my svn checkout: $ find /tmp/slimsvn/ | grep -i randomplay_list.html /tmp/slimsvn/server/HTML/ExBrowse3/plugins/RandomPlay/.svn/text-base/randomplay_list.html.svn-base /tmp/slimsvn/server/HTML/ExBrowse3/plugins/RandomPlay/randomplay_list.html What's wrong with this?
Oops... Sorry: the link I gave you is for the trunk (7.0) only, for 6.5.x please use the following: https://svn.slimdevices.com/repos/slim/branches/6.5/server
Here it is (the commented <pre> ... </pre> block at the beginning is just some debugging code): sun:/tmp/slimsvn/server/Plugins/RandomPlay/HTML/EN/plugins/RandomPlay# svn diff Index: randomplay_list.html =================================================================== --- randomplay_list.html (revision 12260) +++ randomplay_list.html (working copy) @@ -75,13 +75,18 @@ <p>[% "PLUGIN_RANDOM_GENRE_FILTER_WEB" | string %]</p> [% odd = 1 %] + <!-- <pre> + [% FOREACH key IN pluginRandomGenreList.keys.sort %] + * [% key %] = [% pluginRandomGenreList.item("$key").item('id') %] + [% END %] + </pre> --> <table border="0" width="100%">[% USE table pluginRandomGenreList.keys.sort, cols=2, pad=0 %] [%- FOREACH genrerow = table.rows %] <tr class="[% odd ? "odd" : "even" %]"> [%- FOREACH genre = genrerow %] - [%- genreid = "genre_" _ pluginRandomGenreList.$genre.id %] - <td><input type="checkbox" name="[% genreid %]" id="[% genreid %]" value="1" [% pluginRandomGenreList.$genre.enabled ? "checked" : "" %] onclick="changeNumSelected(this)"> - <label for="[% genreid %]">[% pluginRandomGenreList.$genre.name | html %]</label></td> + [%- genreid = "genre_" _ pluginRandomGenreList.item("$genre").id %] + <td><input type="checkbox" name="[% genreid %]" id="[% genreid %]" value="1" [% pluginRandomGenreList.item("$genre").enabled ? "checked" : "" %] onclick="changeNumSelected(this)"> + <label for="[% genreid %]">[% pluginRandomGenreList.item("$genre").name | html %]</label></td> [%- END %] </tr> [% odd = (not odd) %]
looks good here with the patch. as a note, for debugging you can also use something like this: [% USE Dumper; Dumper.dump_html(pluginRandomGenreList) %]
Was this checked in? Robin could you please attach the change number? Thanks! :)
Change 12261
Thanks Michael. what do we think about porting this to 6.5.3 as well, given that it's a rather simple fix?
If I have the permission to commit it, I'm doing it right now. I didn't know I could commit into the repository and I didn't know if my correction was good enough (if working is good enough, it was, at least for me). Let's see this... svn talk me bad: svn: Commit failed (details follow): svn: MKACTIVITY of '/repos/slim/!svn/act/ef8a8b1f-257e-4220-9de9-6194988bbed0': 404 Not Found (http://svn.slimdevices.com) svn: Your commit message was left in a temporary file: svn: '/tmp/slimsvn/server/Plugins/RandomPlay/HTML/EN/plugins/svn-commit.tmp' sun:/tmp/slimsvn/server/Plugins/RandomPlay/HTML/EN/plugins/RandomPlay# I had to checkout using http and not https, maybe this error is related to this changing of url. (svn asked me for a password when I tried to co with https and I didn't find one suitable, when I switch to http, checkout worked fine). By the way, it seems that the patch was commited by "mherger".
This was 6.5.3 only - sorry. Trunk is change 12262.
Verified to be fixed in 6.5.3 and 7. Thank you Robin and Michael.
This bug has recently been fixed in the latest release of SqueezeCenter 7.0.1 Please try that version, if you still see the error, then reopen this bug. To download this version, please navigate to: http://www.slimdevices.com/su_downloads.html