External drag & drop: not sorted

Bug #311912 reported by Johannes Sasongko
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Low
Vladimir Kokarev

Bug Description

When files/dirs from another application are dropped into Exaile, they are not sorted.

The common use case is this: a user drags a directory from his file manager. Files in the directory come from one album and are named "<title>.mp3". The user expects that Exaile will correctly sort the files based on their track numbers, but instead Exaile follows the alphabetical filename order.

Revision history for this message
Johannes Sasongko (sjohannes) wrote :

We are sorting on the drag source (e.g. Collection/Files panel) but not on the drag destination (the trackslist). Perhaps we should remove the drag source sorting and do it on the drag destination?

Revision history for this message
reacocard (reacocard) wrote :

If implemented, drag sources should be able to override this, as dragging from something with user-created order (eg. another playlist) should retain that order on insert.

Changed in exaile:
status: New → Confirmed
importance: Undecided → Low
Changed in exaile:
milestone: none → 0.3.x
Revision history for this message
Mathias Brodala (mathbr) wrote :

Should be fixed with r2674. Can you confirm?

Revision history for this message
Vladimir Kokarev (matrix47) wrote :

in the current tree sorting is really a mess:
1) sorting indicators aren't set correctly
2) files added to playlist are always sorted by fields in order: album, tracknumber, artist, date, discnumber. that doesn't make sence to me at all (I can only imagine one thing - it's a hack to sort tracks according to source sort order in collection panel with view 'Artist')

at least more logical behaviour is to sort added files according to the playlist sort order, I think
the patch attached implements that and also solves problem 1)

Revision history for this message
reacocard (reacocard) wrote :

The patch breaks sorting from drag and drop completely, and also has a naming conflict between the track module and a local variable track that needs to be resolved.

Revision history for this message
Vladimir Kokarev (matrix47) wrote :

here's modified patch
previous one caused error when adding tracks to empty playlist (stupid identifiers conflict)

I'm not sure if my comments are for the correct bug. they are relevant to a general problem of adding tracks to playlist (not only from external source)

Revision history for this message
Vladimir Kokarev (matrix47) wrote :

can you please explain why it breaks sorting from d&d completely?
looks like added tracks are sorted according to current playlist sort settings...

Revision history for this message
reacocard (reacocard) wrote :

If the playlist has no sort setting, its completely unsorted - artists, albums, tracks, everything is out of order. When it does have a sort, it doesn't sort properly Inside that sort. For example, if I have the playlist sorted by Artist and drag a single album by that artist onto the playlist, the tracks in the album will not be in order by tracknumber.

Revision history for this message
Vladimir Kokarev (matrix47) wrote :

>If the playlist has no sort setting, its completely unsorted - artists, albums, tracks, everything is out of order
That one I cannot reproduce :( How do you remove sort setting from playlist completely? It defaults to this: ['artist', 'date', 'album', 'discnumber', 'tracknumber', 'title']. And when when we press column headers, it only gets reordered or prepended by new tags.
>When it does have a sort, it doesn't sort properly Inside that sort.
Maybe that's because your second sort level is something like length?

Maybe the problem is that we support sorting in playlist by several keys, but ui shows only the first one. Should we create a dialog to modify playlist sort settings? We could also use it to set sort order for new playlists.

Revision history for this message
Vladimir Kokarev (matrix47) wrote :

here's patch, that seems to solve all the issues

Revision history for this message
reacocard (reacocard) wrote :

patch committed trunk/2694.

Changed in exaile:
assignee: nobody → Vladimir Kokarev (matrix47)
milestone: 0.3.x → 0.3.1
status: Confirmed → Fix Committed
reacocard (reacocard)
Changed in exaile:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.