More > JRiver Media Center 26 for Linux

auto Import rules, can I put multiple custom strings in one tag rule?

(1/2) > >>

zetetic:
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

lepa:
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: ---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))
--- End code ---

zetetic:
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.

lepa:
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: ---Save([Grouping], v_Grouping)/
--- End code ---

zetetic:
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: ---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))




--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version