Aubin Paul wrote:
> Having looked into this a little for the past couple of days, and
> without knowing the authors original intent, I can't fix it. A flat
> playlist (like an m3u) is made of a list of strings, but trying to 
> browse it in the menu structure always checks to see if it has Item
> properties.
>
> It crashes Freevo every time I try to browse a playlist.
>
> Either we have to massage the strings into a list of Items, or we have
> to change the skin code not to assume that the items have Item
> properties.
>
> Help!?

Like I wrote before on a different thread: I don't have much time
right now, so I won't fix it soon (maybe Monday, maybe Dec. 29th,
maybe next year).

So help for you to maybe find the bug. The cuurent playlist gets
'playlist' as parameter. This is:

        playlist: a) a filename to a playlist file (e.g. m3u)
                  b) a list of items to play, this list can include
                     1) Items
                     2) filenames
                     3) a list (directoryname, recursive=0|1)

So what you see in your debug is correct: 

> ['/media/Music/Bright Eyes/Fevers And Mirrors/04 Something Vague.mp3',
> '/media/Music/Bright Eyes/Fevers And Mirrors/03 The Ca
> lendar Hung Itself.mp3', '/media/Music/Bright Eyes/Lifted Or The Story
> Is In The Soil, Keep Your Ear To The Ground/03 False A
> dvertising.mp3', "/media/Music/Bright Eyes/Lifted Or The Story Is In
> The Soil, Keep Your Ear To The Ground/05 Lover I Don't H
> ave To Love.mp3", '/media/Music/Blink 182/Blink 182/04 Violence.mp3',
> '/media/Music/Blink 182/Blink 182/06 Down.mp3', '/', 'v
> ', 'a', 'r', '/', 'c', 'a', 'c', 'h', 'e', '/', 'f', 'r', 'e', 'e',
> 'v', 'o', '/', 'p', 'l', 'a', 'y', 'l', 'i', 's', 't', 's
> ', '/', 'F', 'r', 'e', 'e', 'v', 'o', ' ', 'P', 'l', 'a', 'y', 'l',
> 'i', 's', 't', ' ', '-', ' ', '1', '2', '1', '6', '-', '0
> ', '2', '2', '8', '.', 'm', '3', 'u']

Except the only character entries. If you load a m3u file as playlist,
it should call build

    def build(self):
        """
        Build the playlist. Create a list of items and filenames. This function
        will load the playlist file or expand directories
        """

to create a list of _files_ as playlist. Later in the code:

    def play(self, arg=None, menuw=None):
        """
        play the playlist
        """
        [...]
        if not callable(self.current_item):
            # element is a string, make a correct item
            play_items = []

            # get a real item
            for p in self.get_plugins:
                for i in p.get(self, [ self.current_item ]):
                    play_items.append(i)

            if play_items:
                pos = self.playlist.index(self.current_item)
                self.current_item = play_items[0]
                self.playlist[pos] = play_items[0]

This creates a correct object. Why? Creating objects may take a very
long time, so a playlist is only a list of files to speed this up. The
files will be transformed to an item when needed.


HTH


Dischi

-- 
printk("; corrupted filesystem mounted read/write - your computer 
will explode within 20 seconds ... but you wanted it so!\n");
        2.4.3 linux/fs/hpfs/super.c


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to