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: Setting up a Facets window for specific music folders (Read 1059 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Setting up a Facets window for specific music folders

I currently have Facets set up with the standard Genre / Album Artist / Albums panes, but I would like to set up a top-level pane that basically displays only the music contained in several top level folders. I have my music sorted in my library in the following top level directories:
\Artists  (my main music library)
\Compilations  (comps)
\New (new music)
\Archive (Stuff that I don't want to show up in my main library, but that I want to keep)

Is there a way to have a Facet pane that filters by the contents of  these top level folders?  I'm having trouble formulating the syntax, but maybe there's a simple way to do this using %directoryname%?

Thanks


Re: Setting up a Facets window for specific music folders

Reply #1
Hi there,

The easy way would be to add a 'Folder' pane as the left most column. (The built-in Facets column that shows folder structure - right-click column header > Columns > Folder). It should show the folders starting inside the monitored music folder, so if they are actually "top-level" folders, you would have to be monitoring the root drive (in Library > Configure > under Music Folders) to see those folders. In other words, if you are monitoring each individual folder, that would not work.

Otherwise you could setup a column using $if functions to filter based on the %path% -

Code: [Select]
$if($strstr($directory_path(%path%),\Artists\),Artists)

^ IF the %path% HAS string \Artists\ (use backslashes to get exact match of folder name), THEN show text "Artists". Following that just add additional $if functions for each folder -

Code: [Select]
$if($strstr($directory_path(%path%),\Artists\),Artists,$if($strstr($directory_path(%path%),\Compilations\),Compilations,$if($strstr($directory_path(%path%),\New\),New)))

^ Show "Artists", ELSE "Compilations", ELSE "New"

An alternative way would be to get the actual folder name with -

Code: [Select]
$directory(%path%,3)
Quote
Extracts directory name from the file path; goes up by n levels. - Title Formatting Reference

However, if you keep music files in differing levels of folders (perhaps a "Disc 1" folder for some albums but not others), that would not show the correct folder, since it is relative to the file location. Every file in the library would have to be in the same folder level.

Cheers

Re: Setting up a Facets window for specific music folders

Reply #2
Your first suggestion worked brilliantly.  I would have never figured it out on my own, so thank you very much!

Re: Setting up a Facets window for specific music folders

Reply #3
Lately I've been getting into using the Facets Search function, and after using Facets for years I really do wonder why it took me so long. Showing/filtering the contents of particular folders is pretty easy, but you can create more complex filters.

A filter without any syntax will show nothing. If the folders you mentioned are all on the same level then a filter like this would show you the contents of the Artist folder and it's subfolders.
%path% HAS "Artists"
If there's an Artists sub-folder under New (for example) you'd filter it out like this.
(%path% HAS "Artists") AND (NOT %path% HAS "New")

Here's a couple of examples that won't be completely relevant to you (I have a different folder hierarchy) but it'll give you an idea. I have two top level folders named MP3 and FLAC, for obvious reasons, and both contain a subfolder named Miscellaneous. This would show just the contents of the Miscellaneous MP3 sub-folder.
(%path% HAS "MP3s") AND (%path% HAS "Miscellaneous")

To make it more funky, I have the the Tabs UI with 5 tabs containing different Facets configurations for sorting.
Screenshot #1 below is the contents of just that MP3s/Miscellaneous folder.
Screenshot #2 is the contents of the  MP3s folder and subfolders, but only if the artist is Joe Cocker.
Screenshot #3 is the same MP3/Joe Cocker filter, sorted using the second Facets configuration (sorted by album when clicking on an album name).
(%path% HAS "MP3s") AND (%artist% HAS "Joe Cocker")