[Exception] M3U list doesn't generete ...

Got an idea? Missing something? Post your feature request here.

Moderator: moderators

[Exception] M3U list doesn't generete ...

Postby U-Boat » Mon May 04, 2009 6:20 am

M3U list doesn't generete which contains non ascii code.

I got java.io.CharConversionException at
net.sourceforge.subsonic.controller.M3UController.java.

I changed the file for test.
Then I got a M3U list.

Code: Select all
    private void createClientSidePlaylist(ServletOutputStream out, Player player, String url) throws Exception {
        out.println("#EXTM3U");
        for (MusicFile musicFile : player.getPlaylist().getFiles()) {
            MusicFile.MetaData metaData = musicFile.getMetaData();
            Integer duration = metaData.getDuration();
            if (duration == null) {
                duration = -1;
            }
           try { // add
               out.println("#EXTINF:" + duration + "," + metaData.getArtist() + " - " + metaData.getTitle());
           } catch(java.io.CharConversionException e) {  // add
               out.println("#EXTINF:" + duration + "," + "No Artist" + " - " + "No Title"); // add
           } // add
           out.println(url + "player=" + player.getId() + "&pathUtf8Hex=" + StringUtil.utf8HexEncode(musicFile.getPath()) + "&suffix=." + transcodingService.getSuffix(player, musicFile));
        }
    }
           }
U-Boat
 
Posts: 4
Joined: Fri Apr 24, 2009 4:46 am

Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 4 guests