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 584899 - [Formatter] Fix .pls/.m3u Formatters
[Formatter] Fix .pls/.m3u Formatters
Status: RESOLVED FIXED
Product: pitivi
Classification: Other
Component: General
Git
Other Linux
: Normal normal
: 0.13.2
Assigned To: Alessandro Decina
Pitivi maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-05 08:23 UTC by j^
Modified: 2009-06-29 15:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add m3u to list of playlist extensions (1.11 KB, patch)
2009-06-05 08:24 UTC, j^
none Details | Review
parse pls format and add m3u to list of playlist extensions (3.13 KB, patch)
2009-06-05 10:54 UTC, j^
none Details | Review

Description j^ 2009-06-05 08:23:43 UTC
right now pitivi only reads pls files, which one has to guess or read in the code. another common extension for simple playlists is m3u
Comment 1 j^ 2009-06-05 08:24:30 UTC
Created attachment 136004 [details] [review]
add m3u to list of playlist extensions
Comment 2 Edward Hervey 2009-06-05 09:36:09 UTC
so... pls and m3u files are all the same ? Just a list of uri (one per line) ?
Comment 3 j^ 2009-06-05 09:41:53 UTC
yes basically one uri per line after removing those starting with #

from http://en.wikipedia.org/wiki/M3U

An M3U file is a plain text file that contains the locations of one or more media files that the mediaplayer should play. Each location is placed on a new line. The locations can be either absolute or relative local pathnames (e.g., "C:\My Music\Heavysets.mp3" or "Heavysets.mp3") or they can be URLs. The file can also include comments, prefaced by the "#" character. In extended M3U, "#" also introduces extended M3U directives.

pls on the other hand is not, example from
http://en.wikipedia.org/wiki/PLS_%28file_format%29

<pre>
[playlist]
NumberOfEntries=3

File1=http://streamexample.com:80
Title1=My Favorite Online Radio
Length1=-1

File2=http://example.com/song.mp3
Title2=Remote MP3
Length2=286

File3=/home/myaccount/album.flac
Title3=Local album
Length3=3487

Version=2
</pre>
Comment 4 Edward Hervey 2009-06-05 09:44:06 UTC
Ok, then changing the bug title accordingly :)
Comment 5 j^ 2009-06-05 09:52:33 UTC
so pls is ini config format, here a minimal parser to get the list of files:

def filesFromPls(filename):
    import ConfigParser
    config = ConfigParser.ConfigParser()
    config.read(filename)
    files = []
    for i in range(config.getint('playlist', 'NumberOfEntries')):
        files.append(config.get('playlist', 'File%d' % (i+1)))
    
    return files
Comment 6 j^ 2009-06-05 10:54:15 UTC
Created attachment 136011 [details] [review]
parse pls format and add m3u to list of playlist extensions