[Bug 73657] New: Play order is `wrong' when adding a directory with sub-directories to the playlist

Nathaniel Taylor nde at ntmm.org
Wed Jan 28 01:22:20 GMT 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=73657      
           Summary: Play order is `wrong' when adding a directory with sub-
                    directories to the playlist
           Product: noatun
           Version: unspecified
          Platform: unspecified
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
        AssignedTo: kde-multimedia at kde.org
        ReportedBy: nde at ntmm.org


Version:           2.4.0 (using KDE 3.2.0 RC1, compiled sources)
Compiler:          gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)
OS:          Linux (i686) release 2.4.20-gentoo-r8

When adding files from a tree more than one directory deep to the playlist, the order in which the contained audio files appear in the playlist is often not the obvious order of going through the tree according to the filename order of subdirectories.

Note that the order of files immediately within any directory _is_ correct as far as I can see; it is just the ordering of directories that is wrong.

______________________________________________

CAUSE:  I believe the cause may be that noatun uses simple system calls to find and add sub-directories, and therefore adds them in the order in which their entries in the parent directory were created.

WHY A PROBLEM:  It is very often the case that someone rips a set of several cds, keeping directory names and filenames numbered in the hope that they will play in the right order.  This should work even if the order of ripping is not the same as of the CDs, or if some file moving/copying done later changes timestamps and directory entry order.

SUGGESTION:  recurse directory trees strictly by subdirectory name. 
Use preferably non-ascii order, i.e. AaBb etc rather than A-Za-z , as I guess this is how most users would prefer an alphabetical but case-sensitive ordering to work.
Start at the top directory, and play all music files in it in this name order.  Then take the sub-directories (if any) in the same name order, and repeat the same rules for each of these.
For what I have seen as common music file trees, this would give the most desirable ordering.

EXAMPLE:

#  Make clearly ordered directories, but in strange 
# creation order. Add music files to directories.
mkdir cd_{1,3,2}
cp ~/test.ogg cd_1/1st_cd.ogg
cp ~/test.ogg cd_3/3rd_cd.ogg
cp ~/test.ogg cd_2/2nd_cd.ogg

# Use `find' to show the directory entry order
find . -type f
./cd_1/1st_cd.ogg
./cd_3/3rd_cd.ogg
./cd_2/2nd_cd.ogg
## NOATUN ADDS TO PLAYLIST IN THIS SAME ORDER


# Now do same thing for creating cd_{1,3,2}
# but create files in normal order.
cd ..; mkdir new; cd new
mkdir cd_{1,3,2}
cp ~/test.ogg cd_1/1st_cd.ogg
cp ~/test.ogg cd_2/2nd_cd.ogg
cp ~/test.ogg cd_3/3rd_cd.ogg
## SAME RESULT AS ABOVE, FOR FIND AND FOR NOATUN
## Suggests it is listing of subdirectories in parent
## rather than creation times of files that is used 
## for ordering

# Finally, add more files in the above tree, in yet another order:
cp ~/test.ogg cd_3/3rd_cd__a.ogg
cp ~/test.ogg cd_2/2nd_cd__a.ogg
cp ~/test.ogg cd_1/1st_cd__a.ogg

find . -type f
./cd_1/1st_cd.ogg
./cd_1/1st_cd__a.ogg
./cd_3/3rd_cd.ogg
./cd_3/3rd_cd__a.ogg
./cd_2/2nd_cd.ogg
./cd_2/2nd_cd__a.ogg
## Noatun does exactly the same as `find' here too


The sensible order is given by 
echo */* | xargs -n1
cd_1/1st_cd.ogg
cd_1/1st_cd__a.ogg
cd_2/2nd_cd.ogg
cd_2/2nd_cd__a.ogg
cd_3/3rd_cd.ogg
cd_3/3rd_cd__a.ogg


Finally:  I rather wonder if some random play effect is used by default, as I have just tried this same test-directory in noatun with a different result from last time.  If this is part of the problem, I suggest it should be turned off by default, as it is confusing.  I deleted my noatunrc file just in case I had sometime set such a thing.



More information about the kde-multimedia mailing list