Skip to main content

Topic: Album list: Show all directories before files (Read 11797 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Dandruff
  • [*][*][*][*][*]
Album list: Show all directories before files
Album list:

-> sorting by folder structure


say we have mainfolder = C:\Music


contents of C:\Music are

dsdff (subfolder)
trtwr (subfolder)
1.mp3 (file)
s.mp3 (file)



-> now foobar displays it as

1.mp3
dsdff
s.mp3
trtwr


(folders and files listed mixed)





Why not displaying

dsdff
trtwr
1.mp3
s.mp3


(folders before files)

?

Windows Explorer and Total Commander for example both always display the folders before files.

  • Yirkha
  • [*][*][*][*][*]
  • Moderator
Album list: Show all directories before files
Reply #1
It would make some sense, however I think Album list sorts always simply by the displayed string. Another hidden sorting criteria might need complex architecture changes, so don't hold your breath.
Full-quoting makes you scroll past the same junk over and over.

  • Yirkha
  • [*][*][*][*][*]
  • Moderator
Album list: Show all directories before files
Reply #2
Btw, I've tried this custom formatting for a while and it works great, only looks a bit ugly...
[font= "Courier New"]$replace($directory_path($substr(%path%,4,999)),\,|000: )|%filename_ext%[/font]
Full-quoting makes you scroll past the same junk over and over.

Album list: Show all directories before files
Reply #3
Hi, I tried this command and I confirm this sorting does look ugly lol

I think the simpler way to solve Dandruff's problem would be by counting and comparing the number of "\" : one more=one subfolder deeper.

Moreover, related issues have been posted here and here. When I had enough free time I'll try to craft a nice sorting command

Cheers

  • Dandruff
  • [*][*][*][*][*]
Album list: Show all directories before files
Reply #4
Any chance to get this in the next version by default in the folder structure view? Really odd in my opinion that single files get listed between folders.

  • Yirkha
  • [*][*][*][*][*]
  • Moderator
Album list: Show all directories before files
Reply #5
Eh "000:"... I currently use the following pattern, it looks quite nice:
"by folder structure+", "[font= "Courier New"]$replace($directory_path($substr(%path%,4,999)),\,| $char(8226) )|%filename_ext%[/font]"
Full-quoting makes you scroll past the same junk over and over.

  • Noxxit
  • [*]
Album list: Show all directories before files
Reply #6
@Yirkha
just was looking for something like that. But changed it in some way:

Code: [Select]
$replace($replace($directory_path(%path%),C:\[path of your music]\,),\,|$char(8239))|[%tracknumber% - ][%track artist% - ]%title%


1. I changed the way the library shows your music (You have to paste the path of your music library)
2. I changed it not to show the full filename (just tracknumber, artist and title)
3. 8239 instead of 8226 to change the bullet to an empty space (just because the bullet doesn't seem to be nice to me  - but you have to be carefull if some files have an empty space on the first digit of their %title% - they'll probably be previous the folders)
  • Last Edit: 07 May, 2010, 01:05:43 PM by Noxxit

Album list: Show all directories before files
Reply #7
I just stumbled onto this thread and it's exactly how i want to arrange my album list.

Can someone please tell me where/how to enter this code.
i don't really have time to learn anything advanced so just some simple instructions would be very helpful

  • Frecktel
  • [*]
Album list: Show all directories before files
Reply #8
Can someone please tell me where/how to enter this code.


Go to Files -> Preferences -> Media Library -> Album List -> Add New
Put a custom name in the first column and copy paste the code in the second.
You should then be able to select your custom view in the Album List window.

Album list: Show all directories before files
Reply #9
thankyou i got it sorted now

  • baget
  • [*]
Album list: Show all directories before files
Reply #10
Can someone please tell me where/how i can do like this in foobar:
Attach please screenshot of how is your tune up should look like.

  • Makaki
  • [*][*]
Album list: Show all directories before files
Reply #11
This feature seems to be requested for a long time now. The workarounds seem to get pretty close, but it's not so intuitive to do. And gets more complicated if your library searches various folders.

Is there a "tracked" feature request list somewhere? What do the devs have to say about this feature?

In case custom is still preferred. they could make it easier. I can think of two other features that would make path-based album listing easier:
* A string function that strips all "Music folders" set in the preferences, from the path. So you don't have to do a replace for each one individually.
* A replace function that supports regular expressions or wildcards.

I found Noxxit's solution the closest to my needs.

  • Makaki
  • [*][*]
Album list: Show all directories before files
Reply #12
@Yirkha
just was looking for something like that. But changed it in some way:

Code: [Select]
$replace($replace($directory_path(%path%),C:\[path of your music]\,),\,|$char(8239))|[%tracknumber% - ][%track artist% - ]%title%


1. I changed the way the library shows your music (You have to paste the path of your music library)
2. I changed it not to show the full filename (just tracknumber, artist and title)
3. 8239 instead of 8226 to change the bullet to an empty space (just because the bullet doesn't seem to be nice to me  - but you have to be carefull if some files have an empty space on the first digit of their %title% - they'll probably be previous the folders)


Further changed this line, as I had some issues with it:
1. Songs which were on the base of the music library would still show the entire path. This is because the directory_path function strips the last slash and the replace wouldn't find it.
Example:
path = $directory_path = $replace
C:\Users\MyName\Music\song.mp3 = C:\Users\MyName\Music = C:\Users\MyName\Music (replace won't work)
C:\Users\MyName\Music\artist\song.mp3 = C:\Users\MyName\Music\artist = artist

And if you change the replace so it doesn't include the \ another problem occurs:
Example:
path = $directory_path = $replace
C:\Users\MyName\Music\song.mp3 = C:\Users\MyName\Music = "" (empty string)
C:\Users\MyName\Music\artist\song.mp3 = C:\Users\MyName\Music\artist = \artist (this leading slash would cause a leading collapsible entry in the listings)

So this was fixed by doing the replace first, then doing the directory_path function.

2. There's a | pipe that is always between the folder and song, even when the folder is an empty string. Which means that all songs in the base folder now show like if they were in subfolder that had no name. This pipe should only be there if there is a folder. So I added an if condition. To make it cleaner I used the puts and get function to store directory part. Another non-breaking space is needed in this case on the left of the directory string, as the replace doesn't cover this spot.

Code: [Select]
$puts(dir,$replace($directory_path($replace(%path%,C:\[path of your music]\,)),\,|$char(8239)))$if($get(dir),$char(8239)$get(dir)|)%filename_ext%
$puts(dir,$replace($directory_path($replace(%path%,C:\[path of your music]\,)),\,|$char(8239)))$if($get(dir),$char(8239)$get(dir)|)[%tracknumber% - ][%track artist% - ]%title%


Note that how the songs are shown can be either a filename or more detailed information.