Comment 1 for bug 1052768

Revision history for this message
Dustin Spicuzza (dustin-virtualroadside) wrote :

After some closer examination, a lot of things about the PlaylistModel are broken in very subtle ways, and only haven't shown up because playlists aren't typically modified by anything other than the PlaylistView. If that were to change, this bug would show up in a lot more places. Misuse of the tree path is just one of the ways the PlaylistModel is broken.

Another way that it is broken is the assumption that the position in a playlist can correspond to the position in the model, particularly by using insert(position, ...) and iter_nth_child(None, position). However, a simple test shows that the position is completely arbitrary and is not related to the playlist position at all. A way you can prove this to yourself is populate a playlist in the main window, and open up an IPython window in Exaile:

    import xlgui
    page = xlgui.main.get_selected_page()
    model = page.view.model
    # will show some track here
    model.get(model.iter_nth_child(None, 0), 0)

-> sort the playlist display using one of the columns, then run this again:

    # will show a different track here
    model.get(model.iter_nth_child(None, 0), 0)

In the interest of time, I recommend going ahead with the release without fixing this bug. Because we don't share playlist instances across boundaries, and most of the playlist stuff is modified using the model, this bug doesn't show up very often.

However, definitely needs to be fixed ASAP, as it introduces subtle bugs that a user may not notice right away, until they've done something to a playlist that won't be revertable. Due to limitations in the TreeModel in gtk, I believe that fixing this may require major changes to the PlaylistModel to ensure that they're synced properly.