INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: auto Import rules, can I put multiple custom strings in one tag rule?  (Read 3229 times)

zetetic

  • Recent member
  • *
  • Posts: 19

I add a bunch of grouping tags to my music on auto import based on artist or aspects of the track name.

Can I have multiple values in one tag rule?
I assume I have to have one field per tag rule because I have to choose the field at the top, but then i could have one for genre and one for grouping.

Currently I have about 8 for grouping, example:

Tag rule 1:
Field:
Grouping
Value:
> ListSort(ListClean(If(Regex([name], /#(instrumental|inst[\]\)]|inst\.\)|[\( ]inst\.)#/, 0, 0), ListBuild(1, ;, [Grouping], IN), [Grouping]), 1))

Tag rule 2:
Field:
Grouping
Value:
> ListSort(ListClean(If(Regex([name], /#(remix|rmx|\(.*mix.*\))#/, 0, 0), ListBuild(1, ;, [Grouping], RX), [Grouping]), 1))

Can I make it...
Tag rule 1:
Field:
Grouping
Value:
> ListSort(ListClean(If(Regex([name], /#(instrumental|inst[\]\)]|inst\.\)|[\( ]inst\.)#/, 0, 0), ListBuild(1, ;, [Grouping], IN), [Grouping]), 1))
> ListSort(ListClean(If(Regex([name], /#(remix|rmx|\(.*mix.*\))#/, 0, 0), ListBuild(1, ;, [Grouping], RX), [Grouping]), 1))

It seems to me that it should be possible but I can't work out how to do it.

Cheers
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: auto Import rules, can I put multiple custom strings in one tag rule?
« Reply #1 on: October 25, 2021, 09:43:31 am »

So [Grouping] for the file is empty when you start autoimport?
Would this kind of variable solution works for you? this assumes [Grouping] was initially empty and it is filled with varible v_Grouping which is getting values from those regex checks during the flow. You could also do it without variable but then sorting and cleaning is more cumbersome to do IMO. "/" at the end of lines are for MC to ignore line breaks and to make formatting the code possible for easier readability and maintain

Value:
Code: [Select]
Save(, v_Grouping)/

If(Regex([name], /#(instrumental|inst[\]\)]|inst\.\)|[\( ]inst\.)#/, 0, 0),
    SaveAdd([v_Grouping], ;IN),
)/

If(Regex([name], /#(remix|rmx|\(.*mix.*\))#/, 0, 0),
    SaveAdd([v_Grouping], ;RX),
)/

ListSort(ListClean([v_Grouping],3))
Logged

zetetic

  • Recent member
  • *
  • Posts: 19
Re: auto Import rules, can I put multiple custom strings in one tag rule?
« Reply #2 on: October 26, 2021, 05:47:18 pm »

Thanks for the reply.

In the past [Grouping] often had values that I had added using other tagging programs, but I am trying to move to a system where I run albums through Beets which then moves them directly into my JRiver autoimport directories which would mean [Grouping] would be empty.

I haven't used Save or SaveAdd before but I think I can see how you have adjusted my expressions into it so I will give it a go. Thanks.
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: auto Import rules, can I put multiple custom strings in one tag rule?
« Reply #3 on: October 27, 2021, 01:06:32 am »

If you want keep whatever items was in the [Grouping] then just initialize the variable with it in the begining and you should be good to go

Code: [Select]
Save([Grouping], v_Grouping)/
Logged

zetetic

  • Recent member
  • *
  • Posts: 19
Re: auto Import rules, can I put multiple custom strings in one tag rule?
« Reply #4 on: November 11, 2021, 06:55:53 pm »

Thanks your expression worked great.

When I added some more name rules it worked as well, but when I added rules based on album it didnt work, for example...

This works when I add it alone like my first examples:
ListSort(ListClean(If(Regex([album], /#(instrumental|inst[\]\)]|inst\.\)|\(inst\.)#/, 0, 0), ListBuild(1, ;, [Grouping], IN), [Grouping]), 1))

...but when I add it into your expression like this it doesnt work:
If(Regex([album], /#(instrumental|inst[\]\)]|inst\.\)|[\( ]inst\.)#/, 0, 0),
    SaveAdd([v_Grouping], ;IN),
)/

Also, initialiazing the variable worked to save information already in the Grouping, but then it didn't add anything new to files that already had information that field but should of had extra based on the rules.

Here is what I tested with:
Code: [Select]
Save([Grouping], v_Grouping)/

If(Regex([name], /#(instrumental|inst[\]\)]|inst\.\)|[\( ]inst\.)#/, 0, 0),
    SaveAdd([v_Grouping], ;IN),
)/

If(Regex([album], /#(instrumental|inst[\]\)]|inst\.\)|[\( ]inst\.)#/, 0, 0),
    SaveAdd([v_Grouping], ;IN),
)/

If(Regex([name], /#(Live |\([Ll]ive\)|[Ll]ive [Vv]ersion|[Ll]ive [Ii]n|[Ll]ive [Aa]t| Live$)#/, 0, 0),
    SaveAdd([v_Grouping], ;LV),
)/

If(Regex([album], /#(Live |\([Ll]ive\)|[Ll]ive [Vv]ersion|[Ll]ive [Ii]n|[Ll]ive [Aa]t|^[Ll]ive| Live$)#/, 0, 0),
    SaveAdd([v_Grouping], ;LV),
)/

If(Regex([name], /#(remix|rmx|\(.*mix.*\))#/, 0, 0),
    SaveAdd([v_Grouping], ;RX),
)/

ListSort(ListClean([v_Grouping],3))



Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: auto Import rules, can I put multiple custom strings in one tag rule?
« Reply #5 on: November 12, 2021, 06:56:49 am »

My bad. Should have read the function description. So SaveAdd doesn't need square brackets for variable and needs option 1 to append as string.
ListClean with options 1 and 3 to remove duplicates and empty items

https://wiki.jriver.com/index.php/Accessing_and_Storing_Functions#SaveAdd
https://wiki.jriver.com/index.php/List_Manipulation_Functions#ListClean

Code: [Select]
Save([Grouping], v_Grouping)/

If(Regex([name], /#(instrumental|inst[\]\)]|inst\.\)|[\( ]inst\.)#/, 0, 0),
    SaveAdd(v_Grouping, ;IN,1),
)/

If(Regex([album], /#(instrumental|inst[\]\)]|inst\.\)|[\( ]inst\.)#/, 0, 0),
    SaveAdd(v_Grouping, ;IN,1),
)/

If(Regex([name], /#(Live |\([Ll]ive\)|[Ll]ive [Vv]ersion|[Ll]ive [Ii]n|[Ll]ive [Aa]t| Live$)#/, 0, 0),
    SaveAdd(v_Grouping, ;LV,1),
)/

If(Regex([album], /#(Live |\([Ll]ive\)|[Ll]ive [Vv]ersion|[Ll]ive [Ii]n|[Ll]ive [Aa]t|^[Ll]ive| Live$)#/, 0, 0),
    SaveAdd(v_Grouping, ;LV,1),
)/

If(Regex([name], /#(remix|rmx|\(.*mix.*\))#/, 0, 0),
    SaveAdd(v_Grouping, ;RX,1),
)/

ListSort(ListClean(ListClean([v_Grouping],1),3))
Logged

zetetic

  • Recent member
  • *
  • Posts: 19
Re: auto Import rules, can I put multiple custom strings in one tag rule?
« Reply #6 on: January 14, 2022, 05:47:39 pm »

Thanks, works a treat now

This is my new auto import grouping rule:
Code: [Select]
Save([Grouping], v_Grouping)/

If(Regex([name], /#(instrumental|inst[\]\)]|inst\.\)|[\( ]inst\.)#/, 0, 0),
    SaveAdd(v_Grouping, ;IN,1),
)/

If(Regex([album], /#(instrumental|inst[\]\)]|inst\.\)|[\( ]inst\.)#/, 0, 0),
    SaveAdd(v_Grouping, ;IN,1),
)/

If(Regex([name], /#(Live |\([Ll]ive\)|[Ll]ive [Vv]ersion|[Ll]ive [Ii]n|[Ll]ive [Aa]t| Live$)#/, 0, 0),
    SaveAdd(v_Grouping, ;LV,1),
)/

If(Regex([album], /#(Live |\([Ll]ive\)|[Ll]ive [Vv]ersion|[Ll]ive [Ii]n|[Ll]ive [Aa]t|^[Ll]ive| Live$)#/, 0, 0),
    SaveAdd(v_Grouping, ;LV,1),
)/

If(Regex([name], /#(remix|rmx|\(.*mix.*\))#/, 0, 0),
    SaveAdd(v_Grouping, ;RX,1),
)/

If(Regex([name], /#([^a-z]skit[^a-z]|^skit[^a-z]|[^a-z]skit$)#/, 0, 0),
    SaveAdd(v_Grouping, ;SK,1),
)/

If(Regex([artist], /#(Dead Cross|Faith No More|Fantômas|Hemophiliac|House Of Discipline|Lovage|Maldoror|Mike Patton|Mr. Bungle|Nevermen|Peeping Tom|Tētēma|The Fantômas Melvins Big Band|Tomahawk|Weird Little Boy)#/, 0, 0),
    SaveAdd(v_Grouping, ;00;MP,1),
)/

If(Regex([artist], /#(Activities Of Dust|Arcana|Astral Night Rollers|Autonomous Zone|Axiom Funk|Bass Invaders|Bill Laswell|Blind Light|Blixt|Blue Buddha|Buck Jam Tonic|Charged|Cobra Strike|Curlew|Cymatic Scan|Deadline|Divination|Dubadelic|Equations Of Eternity|Flying Mijinko Band|Ginger Baker Band|Jah Wobble's Solaris|Last Exit|Mandingo|Massacre|Material|Method Of Defiance|Mooko|Mumpbeak|New York Gong|Niels & The New York Street Percussionists|Operazone|Outland|PainKiller|Phantom City|Possession|Praxis|Psychonavigation|Purple Trap|Radioaxiom|Second Nature|Shango|Somma|Surds|SXL|Sypher|Tabla Beat Science|Telesterion|The Big Guns|The Blood Of Heroes|The Golden Palominos|Third Rail|Tokyo Rotation|Toy Killers|U.M.A.|Web )#/, 0, 0),
    SaveAdd(v_Grouping, ;BL,1),
)/

ListSort(ListClean(ListClean([v_Grouping],1),3))
Logged
Pages: [1]   Go Up