playlist get_selected_paths() is used incorrectly
Bug #1052768 reported by
Dustin Spicuzza
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Exaile |
Fix Released
|
High
|
Dustin Spicuzza |
Bug Description
In xlgui.widgets.
We need a method to translate paths to playlist indexes. However, there doesn't seem to be a good way to do this.
I'm too tired to think of a good way to fix this tonight, but we should definitely fix it before the release. It pops up in all kinds of unexpected ways.
Changed in exaile: | |
importance: | Undecided → High |
Changed in exaile: | |
milestone: | none → 3.4.0 |
Changed in exaile: | |
milestone: | 3.4.0 → 3.3.1 |
Changed in exaile: | |
milestone: | 3.3.1 → 3.3.2 |
Changed in exaile: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
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 get_selected_ page() get(model. iter_nth_ child(None, 0), 0)
page = xlgui.main.
model = page.view.model
# will show some track here
model.
-> sort the playlist display using one of the columns, then run this again:
# will show a different track here get(model. iter_nth_ child(None, 0), 0)
model.
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.