Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foobar grouping by folder from root of disc; grouping by tag (Read 13531 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foobar grouping by folder from root of disc; grouping by tag

Hello, i have a few question)

1. Grouping by filepath
how can i create grouping in playlist from root of disc?
i known only "$directory(x,n)". but he start from file.

for example i have hierarchy of dirrectories:

d:\Music\Rock\Splean\album1
d:\Music\Rock\Splean\album2
d:\Music\Rock\Splean\album3
d:\Music\Ellectronic\dub\Netslov\album1
d:\Music\Ellectronic\dub\Netslov\2010\album1
d:\Music\Ellectronic\dub\Netslov\2010\album2
d:\Music\Ellectronic\dub\Netslov\album3
create a few rules is matterless becouse hierarchy is different.

2. QuickTag interface
In foobar i tag file by context menu:

it's terrible!) for example, in uTorrent when you do right click on tag column you see this menu:

it's simple and fast.
How can i make tag list like uTorrent? Or maybe create a downdrop…

3. Group by drag'n'drop
How can i create group like folder in playlist? At now files group by addres or costume tag, but what if create group do not depended of file? I just drug file in this, and file move to group)

4. Radio label
Also, i don't know how name radio url. QuickTag don't tagged him. There is need group like folder, but i don't know how make them.

Thx, and sorry for my bad Eng.

foobar grouping by folder from root of disc; grouping by tag

Reply #1
1. something like: $substr(%path%,1,3) should work

foobar grouping by folder from root of disc; grouping by tag

Reply #2
1. something like: $substr(%path%,1,3) should work


nope(
if code like this:
$substr(%path%,22,10)

Result:
Ozzy Osbour
Pearl Jam/C
PINK FLOYD
PLACEBO/Pla
RAMONA FALL
SHERYL CROW

foobar grouping by folder from root of disc; grouping by tag

Reply #3
and if code like this:
$substr(%path%,1,3)  ...as I told you   

Result:
D\:

foobar grouping by folder from root of disc; grouping by tag

Reply #4
The official Titleformat help (in the main menu Help) is your friend:
Code: [Select]
$directory_path(%path%)

foobar grouping by folder from root of disc; grouping by tag

Reply #5
and if code like this:
$substr(%path%,1,3)  ...as I told you   

Result:
D\:



emm) thank you, but how this code help me? maybe i bad explain, i try again)

i need group track in my playlist, for exaple by artist.
i have this directory hierarchy:

d:\Music\Rock\Splean\album3\cd1\1.mp3
d:\Music\Rock\Splean\album3\cd2\2.mp3
d:\Music\Rock\Splean\album2\3.mp3
d:\Music\Rock\Splean\4.mp3

and i have a varible: $directory(x,n) (he started from file)

Code: [Select]
$directory(%path%,1)


give us:

Code: [Select]
cd1 --------
1
cd2 --------
2
album2 --------
3
Splean --------
4


that's bad. But, if this varible start from root...

Code: [Select]
$directoryFromRoot(%path%,4)


it give us:

Code: [Select]
Splean --------
1
2
3
4


but varible "$directoryFromRoot(x,n)" does not exist! ?_?
what can i do?

maybe exists any way to create this grouping? or maybe nobody use grouping, and i wrong? But i think is normal goup files by artist and album..
I see grouping by ID3 tag, but it's not variant.

foobar grouping by folder from root of disc; grouping by tag

Reply #6
The official Titleformat help (in the main menu Help) is your friend:
Code: [Select]
$directory_path(%path%)


"is your friend" =D

i allready see it varible, and sure i first read manual, but i need part of address, becouse if playlist include many files from different folders it's mean 1 group per 1 file

foobar grouping by folder from root of disc; grouping by tag

Reply #7
but varible "$directoryFromRoot(x,n)" does not exist! ?_?
what can i do?
Well you'd probably have to write such a function yourself.

Strip the first part of the path (till first backslash):
Code: [Select]
$puts(d1,$substr(%path%,$add($strchr(%path%,\),1),999))
Strip the second part of the path:
Code: [Select]
$puts(d2,$substr($get(d1),$add($strchr($get(d1),\),1),999))
Etc.
Finally print only the characters till the next backslash:
Code: [Select]
$substr($get(d2),0,$sub($strchr($get(d2),\),1))

Full-quoting makes you scroll past the same junk over and over.

foobar grouping by folder from root of disc; grouping by tag

Reply #8
Here is a one-liner alternative for the N-th directory from the root:
Code: [Select]
$directory($replace(%path%,:,),$sub($sub($len(%path%),$len($replace(%path%,\,))),N))

N=0 yields the very root (hard drive)
N=1 yields the first directory level
etc.

If you want the actual file to be captured as the highest level, replace "%path%" by "%path%\" everywhere.



 

foobar grouping by folder from root of disc; grouping by tag

Reply #11
@herojoker:
Your line fails to consider reading from archives and archives with subfolders. Expanding the $replace fixes this:
Code: [Select]
$directory(%path%,$sub($len(%path%),$len($replace(%path%,\,,|,,/,)),N))
Also not nesting $sub and lremoving the unneeded replacement of the path colon makes this even shorter. As with your version N must be replaced by the desired path depth.

(This post is designated to all the ppl finding this topic even if it's 2 years old :p)