Skip to main content
Topic: Re: Facets (foo_facets) (Read 891 times) previous topic - next topic - Topic derived from Re: Facets (foo_facets)
0 Members and 1 Guest are viewing this topic.

Re: Facets (foo_facets)

Hi to all,

Someone with experience could tell me how can I make facets only to show me the tracks with a certain word in the genre and filter the rest as an example:

First column "classic" or "metal" or "Instrumental" in the Genres
Second column: artists
Third column: comments
Fourth column: rating

Thank you in advance for the great help and best regards
Vasco


Re: Facets (foo_facets)

Reply #2
If you want to experiment with columns (+ headers) in Facets, see: Facets column patterns
As Facets' columns are based on title formatting and not query syntax, see also: Title Formatting Reference
Columns are created/edited in File:Preferences -> Media Library -> Facets.

A genre column, two examples
Code: [Select]
$if($stricmp(%genre%,classical),%genre%,$if($stricmp(%genre%,comedy),%genre%,$if($stricmp(%genre%,blues),%genre%,Unsorted)))
$if($stricmp(%genre%,classical),%genre%,$if($stricmp(%genre%,comedy),%genre%,$if($stricmp(%genre%,blues),%genre%)))
Requirement: Only one genre per item; at the moment I can't figure out what to do in case of multiple genres per item. Replace the three genres so they suit your needs.
See screenshot for the first string. The second string omits all genres not fulfilling the three conditions.
The string(s) can probably be beautified/made shorter, maybe Daeron – he's way above my paygrade – can tell.

May I suggest that your genre column just has one of the following examples (Brackets, as in %<genre>%, allow for multiple genres per item (track or album) see Facets doc.).
Code: [Select]
$if2(%genre%,'('N/A')')
$if2(%<genre>%,'('N/A')')
[%genre%]
[%<genre>%]
and then, as Daeron says, create some filters based on query syntax, File:Preferences -> Media Library -> Facets -> Filters
Code: [Select]
%genre% HAS classic
%genre% HAS metal
%genre% HAS instrumental
Combined filter
Code: [Select]
(%genre% HAS classic) OR (%genre% HAS metal) OR (%genre% HAS instrumental)
The parentheses are not mandatory, only for readability, this is the same:
Code: [Select]
%genre% HAS classic OR %genre% HAS metal OR %genre% HAS instrumental
The same result can be achieved by allowing multiple filters in the Filter drop-down list and use the above shown three filters.

An artists column, some examples
Code: [Select]
%artist%
$swapprefix(%artist%)
$if(%solo artist%,$swapprefix(%album artist%,$trim($left(%album artist%,$strrchr(%album artist%, )))),$swapprefix(%album artist%))
Note: The last example is a bit extreme, as it requires a user-defined field in properties, %solo artist%. Give the relevant artists an arbitrary value in the field, e.g. 1, for example: Ian Anderson 1, Jethro Tull nothing, The Beatles nothing. The string gives this sorting in a Facets Artists column:

Anderson, Ian (value 1)
Beatles, The (no value)
Jethro Tull (no value)

A rating column, some examples
Code: [Select]
>>>$if2(%rating_stars_fixed%,'('N/A')')<<<
$if2(%rating_stars_fixed%,'('N/A')')
$if2(%rating_stars_fixed%,Unrated)
$if2(%rating_stars_fixed%,0)
$if2(%rating_stars%,'('N/A')')
[%rating_stars-fixed%]
{%rating_stars%]
[%rating%]
Requirement: Playback Statistics component. See Playback Statistics v3.x

A comments column
Code: [Select]
[%comment%]
Unless you are using short comments, I don't think this is convenient.

I hope this helps.

Edit. Facets has a separate thread, Facets thread. You should use that if you have further questions.

Re: Facets (foo_facets)

Reply #3
Wow... What a great community!!

Thank you a lot for all the feedback, I'll be testing it all tonight and check what suits me best.

Thank you all for the helpful reply seriously.
Vasco

Re: Facets (foo_facets)

Reply #4

Code: [Select]
$if($stricmp(%genre%,classical),%genre%,$if($stricmp(%genre%,comedy),%genre%,$if($stricmp(%genre%,blues),%genre%,Unsorted)))



Hi, thanks once more

So I tried to use the code above but only let me put 3 genres, if I add $if($stricmp(%genre%,Rock),%genre% at the end it gives me a error !!!
Why can't I add more then 3 types of genre !!??

thank you

Moderation: Removed extra code tag after quote.

Re: Facets (foo_facets)

Reply #5
... if I add $if($stricmp(%genre%,Rock),%genre% at the end it gives me a error !
It would have been easier if you had shown us the complete string instead of merely writing "at the end", I suppose.
Look at the original string again, now split up in a few lines:
Code: [Select]
$if(
$stricmp(%genre%,classical),%genre%,
$if(
$stricmp(%genre%,comedy),%genre%,
$if(
$stricmp(%genre%,blues),%genre%,Unsorted
)
)
)
The 'Unsorted' gives the rest of the library. We want to add an extra $if statement with a rock genre
Code: [Select]
$if($stricmp(%genre%,rock),%genre%)
moving the 'Unsorted' to a new level:
Code: [Select]
$if(
$stricmp(%genre%,classical),%genre%,
$if(
$stricmp(%genre%,comedy),%genre%,
$if(
$stricmp(%genre%,blues),%genre%,
$if(
$stricmp(%genre%,rock),%genre%,Unsorted
)
)
)
)
And in one line
Code: [Select]
$if($stricmp(%genre%,classical),%genre%,$if($stricmp(%genre%,comedy),%genre%,$if($stricmp(%genre%,blues),%genre%,$if($stricmp(%genre%,rock),%genre%,Unsorted))))
You may have forgot to type a parenthesis somewhere. I can recommend foosion's Title Formatting Sandbox as a validator, see screenshot. Note the error message.
The component doesn't like user-defined words, but doesn't throw an error, see screenshot.

You would be better off using Facets' standard genre pattern
Code: [Select]
$if2(%<genre>%,'('Unknown')')
instead of making more and more complicated strings. Use the Filter to define some simple query syntax filters and activate the Multiple filters to combine them.



Re: Re: Facets (foo_facets)

Reply #6
You would be better off using Facets' standard genre pattern
Code: [Select]
$if2(%<genre>%,'('Unknown')')
instead of making more and more complicated strings. Use the Filter to define some simple query syntax filters and activate the Multiple filters to combine them.

Sorry for that, you are right, I should be more explicit but I'm not a programer so I appreciate all the help.

What do you mean about using the filters instead??

And by the way, is there a way to display the iTunes automated playlists ??

best regards and thank you all very much
Vasco

Re: Facets (foo_facets)

Reply #7
Dammit and oops, forget about Multiple filters in this specific context, I've had a catastrophic memory lapse, I'm very sorry for the possible confusion. Note to self: Test before publish.

In Facets' toolbar there's a Filter button. If it's not visible, then right-click the toolbar and enable it.
Click on the down-arrow and chose Preferences from the drop-down list, see screenshot.
In the Preferences:Filters window click the button Add new to create a new filter (Query).

Name: Classic
Query: %genre% HAS classic

Click Add new again
Name: Metal
Query: %genre% HAS metal

These could be combined with OR to a new query (Add new)
Name: Classic + metal
Query: %genre% HAS classic OR %genre% HAS metal

With your four suggested genres
Name: You name it
Query: %genre% HAS classic OR %genre% HAS metal OR %genre% HAS instrumental OR %genre% HAS rock

Now you can enable one of the new filters by clicking the Filter down-arrow and chose it.
You can achieve the same by simply typing your query in the Search field in Facets' toolbar and only save long/complex/important/often used queries; e.g. the one with four genres.
If you in addition to the genre 'rock' have genre(s) called e.g. 'progressive rock' and/or 'psychedelic rock' they will be shown as well.
To avoid this use IS instead of HAS. IS will of course only work when there's only one value in the %genre% field.

Repetition
Use Title Formatting in Column patterns (probably avoiding really complicated strings at least as a start).
Use Query Syntax in the Search field for simple queries. Save complex/often used queries in the Filter preferences.
It may be easier to understand the logic behind a query than to begin building some hairy title formatting.
Read the documentation (linked to earlier).

Re: Facets (foo_facets)

Reply #8
Thank you very very much once more... this been great help.
Is working now for me, I just to clean better my iTunes library I guess because the filtering is passing some Hip-Hop music in the Rock Genre selection !!!

Regarding the iTunes playlists
Is there any way to import the automated playlists from iTunes as they are ??

thank you once more for all the detailed info and great support
best regards
Vasco

Re: Facets (foo_facets)

Reply #9
Thanks, you're welcome. That I'm not at all happy with my answers is by no means your fault.
Is there any way to import the automated playlists from iTunes as they are ??
I haven't got a clue, but you're far from being the first one to ask that export/import question.
The subject has nothing to do with Facets, so it's off topic.
Instead of opening a new thread I suggest you perform a search, here on HA or a global one. Good luck.

 
SimplePortal 1.0.0 RC1 © 2008-2019