Author Topic: Auto-Playlist function to Compare if Two Tag Fields Match  (Read 1013 times)

MotleyG

  • Full Member
  • ***
  • Posts: 144
I'm trying to create a condition in an Auto-Playlist to filter for files where the Artist tag is the exact same as the AlbumArtist field. From the current list of comparators available in the rules when editing an Auto-Playlist it doesn't appear to me that this is supported, except possibly using the "match RegEx" or "match RegEx/i" options.

My question, is this possible with the current possible filter options for an Auto-Playlist? And if yes, can anybody share what that would look like? I'm not sure how to go about getting this to work.

I did find a thread from 2018 here that Redwing had started, but it looks like that went silent before a solution was offered.

tjinc

  • Sr. Member
  • ****
  • Posts: 323
I don't believe that you can achieve this directly in an auto-playlist as regex doesn't support fields and virtual tag functions are not available in auto-playlist criteria. (I will wait to be proved wrong!)

You can achieve this using a virtual tag, something like:
         $If(<Album Artist>=<Artist>,T,F)

And then auto-playlist with 'match all' criteria:
         VirtualTag is T
         <Album Artist> has a value
Last Edit: October 05, 2023, 08:10:58 PM by tjinc

MotleyG

  • Full Member
  • ***
  • Posts: 144
Thanks for this idea. I’ll give it some effort tomorrow and see what I can do to make it work.

MotleyG

  • Full Member
  • ***
  • Posts: 144
This worked great, thanks @tjinc again for the suggestion. Used up a Virtual tag, but helps for a few Auto-Playlists for me.

Cheers!

tjinc

  • Sr. Member
  • ****
  • Posts: 323
Glad it helped.

This function is a little neater as the whole determination of the match is done within the virtual tag itself:
     $IsNull(<Album Artist>,False,$If(<Album Artist>=<Artist>,True,False))

and then the auto-playlist would have a single criterion:
      <VirtualTag> is True

It doesn't really make much difference, but one advantage of this method is that you could use this virtual tag as a displayed field in a list if you wanted.
Last Edit: October 06, 2023, 07:45:47 AM by tjinc

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
I don't believe that you can achieve this directly in an auto-playlist as regex doesn't support fields and virtual tag functions are not available in auto-playlist criteria. (I will wait to be proved wrong!)


You won't be proven wrong, but you could totally support this wish!
EDIT: I see you already have!