Need help with these strings, some various artists rules |
Please read foobar2000 Tech Support Forum Rules before posting and comply with all the points.
Failure to provide all the information pointed out in the above document in your post is considered wasting other people's time and in extreme cases will lead to your topic getting locked without a reply.
See also: Hydrogenaudio Terms of Service.
Need help with these strings, some various artists rules |
Mar 8 2004, 09:52
Post
#1
|
|
|
Group: Members Posts: 244 Joined: 1-September 03 Member No.: 8630 |
i need some help making a change to my formatting. i've tried to make the changes, but i just can't seem to get them right.
my current formatting does the following: -- if (OST) is present at the end of the directory name, the album is assumed to be an ORIGINAL SOUNDTRACK. -- if the first 3 characters of the ARTIST are not the same as the first three characters of the directory, the album is assumed to be by VARIOUS ARTISTS. the formatting goes as follows: CODE $if($strcmp($num(%tracknumber%,1),1), $if($stricmp($right(%_directoryname%,5),'(OST)'), $get(color_art)'Original Soundtrack', $if($not($stricmp($left(%artist%,3),$left(%_directoryname%,3))), $get(color_art)'Various Artists', $get(color_art)%Artist%)) $get(color_gri)$repeat('—',100),) what i want to do, however, is make the following exception to the VARIOUS ARTIST naming: -- if the album is in a folder starting with "CD" or "DISC", then i want it to do the same check (match first 3 characters of dir against artist) to the directory above. i tried this: CODE $if($strcmp($num(%tracknumber%,1),1), $if($stricmp($right(%_directoryname%,5),'(OST)'), $get(color_art)'Original Soundtrack', $if($not($stricmp($left(%artist%,3),$left(%_directoryname%,3))), $if($stricmp($left(%_directoryname%,2),'CD'), $if($not($stricmp($left(%artist%,3),$left($directory(%_path%,2),3))), $get(color_art)'Various Artists', $if($stricmp($left(%_directoryname%,4),'disc'), $if($not($stricmp($left(%artist%,3),$left($directory(%_path%,2),3))), $get(color_art)'Various Artists', $get(color_art)%artist%)))))) $get(color_gri)$repeat('—',100),) ...but it doesn't work. can anyone help me make the desired changes to the first chunk of code? |
|
|
|
![]() |
Mar 8 2004, 15:09
Post
#2
|
|
![]() Group: Members Posts: 1428 Joined: 10-April 03 Member No.: 5916 |
The problem is that the first $if comparison for OST will override the last $if comparison for OST and "DISC".
One way to work around this is to already make an exception for the "disc" guesing in the first $if string for OST guessing. Something like CODE $if($and($stricmp($right(%_directoryname%,5),'(OST)'),$not($stricmp($left(%_directoryname%,4),'disc'))) should most likely work.$get(color_art)'Original Soundtrack', Also I assume you are using CODE $if($strcmp($num(%tracknumber%,1),1), for some kind of album based formatting.You might want to look into the $select function and use that for albumbased formatting instead of $if...... Something like CODE $select($min(X,%tracknumber%), usually works quite well on album based formattings. Simply replace X by the last tracknumber you need any special formatting for.
|
|
|
|
Mar 8 2004, 22:31
Post
#3
|
|
![]() Group: Members Posts: 1099 Joined: 18-March 03 From: Oslo, Norway Member No.: 5569 |
@aron: I you have a look at the start of the guessing code in my "dynamic" formatting you might find something useful. There is some code there that will adjust the directory level used to look for artist and album name, depending on the presens of a "cd" or "disc" directory.
The relevant part starts at line 190, and you can see an example of it's usage on line 250. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th June 2013 - 09:44 |