Bug 236 - make m3u files with backslashes from windows systems parse cleanly elsewhere
: make m3u files with backslashes from windows systems parse cleanly elsewhere
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Playlists
: unspecified
: PC All
: P2 normal (vote)
: Future
Assigned To: Blackketter Dean
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-05 16:23 UTC by Kevin Pearsall
Modified: 2008-12-15 13:05 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Pearsall 2004-04-05 16:23:18 UTC
Submitted by Art Mellor

I run my slimserver on Linux. I like to create my playlists using a
variety of methods on different computers. Some of them are created on
windows by winamp. I wanted the slimserver to be able to read the
playlists created that way. My mod is below.

In the file Slim/Formats/Parse.pm I added the following line right
after carriage returns are fixed. I'm assuming you'll need something
more general since this probably breaks the playing on windows.

sub M3U {
        my $m3u = shift;
        my $m3udir = shift;
        my @items;

        my $title;
        my $itemCount = 0;

        $::d_parse && msg("parsing M3U: $m3u\n");

        while(my $entry = <$m3u>) {
                chomp($entry);
                # strip carriage return from dos playlists
                $entry =~ s/\cM//g;
                #+++art: change backslash to forward slash from dos playlists
                $entry =~ s/\\/\//g;
Comment 1 KDF 2004-04-05 16:50:03 UTC
something like his might be more appropriate:

while(my $entry = <$m3u>) {
    chomp($entry);
    # strip carriage return from dos playlists
    $entry =~ s/\cM//g;

    # when using iTunes in Linux, use / for paths. 
    if ((Slim::Utils::OSDetect::OS() eq 'unix') && useiTunesLibrary()) {
        $entry =~ s/\\/\//g;
    }
Comment 2 Blackketter Dean 2004-04-05 17:03:03 UTC
The right fix is to make Slim::Misc::fixPath a bit smarter about slashes.
Comment 3 Dan Sully 2005-08-27 18:44:58 UTC
Fixed in subversion change 4099
Comment 4 James Richardson 2008-12-15 13:05:23 UTC
This bug appears to have been fixed in the latest release!

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.

Make sure to include the version number of the software you are seeing the error with.