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: Album List Panel issue (Read 1888 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Album List Panel issue

Hey, I wrote two pieces of code that suit my needs best for arranging my music library in foobar but I can't find a way to merge them so they work together.

Code: [Select]
#1
    $if(
    %album%
    ,
    [$if2(%album artist%,%artist%)]|['['[%date%]']' ][%album%]|[[%discnumber% - ]%tracknumber%. ]%title%
    ,
    [$if2(%album artist%,%artist%)]|Misc|%title%
    )

#2    
    $if(
    %totaltracks%
    ,
    [$if2(%album artist%,%artist%)]|['['[%date%]']' ][%album%]|[[%discnumber% - ]%tracknumber%. ]%title%
    ,
    --Incomplete albums--|[$if2(%album artist%,%artist%)]|%title%
    )


#1
I have some songs that belong to an artist I listen to a lot but don't fall into any albums, so I'd like to keep them under Artist/Misc.
Example:

I listen to a lot of Queens of the Stone Age but to little R.E.M. - the Misc folder keeps all the covers, alternative versions etc. in one place but I also want R.E.M. out of the picture until I get at least one full album

#2
The second code puts all the single songs that I wish to keep but don't have or want the whole album (therefore no %totaltracks% value) in a separate tree (Incomplete Albums/Artist/Album), so the almost empty "albums" don't appear in the main Artist/Album tree and don't clutter the view. Example (inside "Incomplete Albums" tree):

Main Artist/Album tree looks neat but all the "Misc" songs end up under Incomplete tree.

Is there any way to keep "Misc" under respective artist AND put single songs away under "Incomplete Albums"? I guess I could just give all the "Misc" songs fake %totaltracks% but I'm interested in a solution rather than a workaround.

Album List Panel issue

Reply #1
how are the incomplete tracks physically organized? I ask because I keep most (all if we're just talking single tracks) incomplete album tracks at the artist folder level vs. within an album level, so if similar I wonder if that could help

Album List Panel issue

Reply #2
Try this:
Code: [Select]
%album artist%|$if($and(%album%,$not(%totaltracks%)),--Incomplete albums--|,$if($not(%album%),Misc|))[['['%date%']' ][%album%]|][[%discnumber% - ]%tracknumber%. ]%title%

Album List Panel issue

Reply #3
That's why I organize my music on file system level  . I only need proper playlist sorting pattern, which is easy achievable, and everything can be simply presented on single autoplaylist. However I am impressed that some users are able to operate so smoothly on those title formatting functions. Those functions are always making me stupid

Album List Panel issue

Reply #4
Try this:
Code: [Select]
%album artist%|$if($and(%album%,$not(%totaltracks%)),--Incomplete albums--|,$if($not(%album%),Misc|))[['['%date%']' ][%album%]|][[%discnumber% - ]%tracknumber%. ]%title%

Unfortunately, all it does is put all empty albums in "--Incomplete albums--" under each artist. I need "--Incomplete albums--" to gather all artists and their "empty" albums and remain on the same level as Artist:
. I only need proper playlist sorting pattern, which is easy achievable, and everything can be simply presented on single autoplaylist. However I am impressed that some users are able to operate so smoothly on those title formatting functions. Those functions are always making me stupid [/quote]
Over the years my music library got messy beyond repair, hence all this coding... Of course I could just throw these old lonely tracks away or make them not appear in foobar but why should I?  It's a fun brain-exercise as well, it looks overwhelming at first but it's just simple classical logic.

Album List Panel issue

Reply #5
I understood what you wanted in your original post but disagreed with having artists listed on different node levels.

A simple modification of what I posted will do exactly what you want. You ought to be able to figure it out.

Album List Panel issue

Reply #6
Thanks to your tips, BenB, I managed to come up with some sort of final version. It's clumsy and a tad self-contradictory. Plus it made me realize I'm going to need to do some tagging anyway or change the method altogether (should have weeks ago ). But this particular problem is solved, thanks for your time guys!

I'll leave the code in case someone wants to use some parts of it:
No 'totaltracks' value, 'album' value present --> Incomplete albums/Artist/Title
No 'album' and 'totaltracks' value --> Artist/Misc/Title
Both values present --> Artist/[Year]Album/
  • Title[/b]
    Code: [Select]
    $if($and(%album%,$not(%totaltracks%)), --Incomplete albums--|[$if2(%album artist%,%artist%)]|%title%,$if($and($not(%album%),$not(%totaltracks%)),[$if2(%album artist%,%artist%)]|Misc|%title%,[$if2(%album artist%,%artist%)]|['['[%date%]']' ][%album%]|[[%discnumber% - ]%tracknumber%. ]%title%))


    $if(
        $and(%album%,$not(%totaltracks%))
    ,
         --Incomplete albums--|[$if2(%album artist%,%artist%)]|%title%
    ,
        $if(
            $and($not(%album%),$not(%totaltracks%))
        ,
            [$if2(%album artist%,%artist%)]|Misc|%title%
        ,
            [$if2(%album artist%,%artist%)]|['['[%date%]']' ][%album%]|[[%discnumber% - ]%tracknumber%. ]%title%
        )
    )

Album List Panel issue

Reply #7
This construction isn't really necessary.
Code: [Select]
[$if2(%album artist%,%artist%)]

foobar uses the ARTIST tag when no ALBUM ARTIST tag is found, thus you can simply use %album artist%.

Also, using conditional brackets around title formatting can have the unwanted effect of hiding tracks which don't have the tag or meet the criteria for the expression. If you must use conditional brackets, make sure the pipe for that node is within the brackets to prevent the behavior. For example, use this construction:
Quote
[TAG|][TAG|][TAG]

NOT this:
Quote
[TAG]|[TAG]|[TAG]

And I don't what you're trying to achieve with what looks to be two sets of conditional brackets here:
Code: [Select]
['['[%date%]']' ]

when the outer set will suffice.

Here's the latest code you posted after taking the above into account:
Code: [Select]
$if($and(%album%,$not(%totaltracks%)),--Incomplete albums--|[%album artist%|]%title%,[%album artist%|]$if($and($not(%album%),$not(%totaltracks%)),Misc|%title%,[['['%date%']' ][%album%]|][[%discnumber% - ]%tracknumber%. ]%title%))


Also, I suggest you learn the information on the following pages:
http://wiki.hydrogenaudio.org/index.php?ti...tting_Reference
http://wiki.hydrogenaudio.org/index.php?ti...00:Query_syntax

Album List Panel issue

Reply #8
And I don't what you're trying to achieve with what looks to be two sets of conditional brackets here:
Code: [Select]
['['[%date%]']' ]

when the outer set will suffice.

That was probably the first thing I ever did while tinkering in foobar and never got round to smooth it

Thanks a lot for your advice, it seems I still have a lot to learn.

 

Album List Panel issue

Reply #9
Your scripts work, and you made the effort to do it yourself before asking for help (which is more than most people do). Well done.