Author Topic: Additional Tagging & Reporting Tools  (Read 1153400 times)


hiccup

  • Hero Member
  • *****
  • Posts: 9107
I am running into an issue and it might be logic related. I want to link the ratings field to the love field. If the rating is 3.5 then the song should be Loved and vice versa, if the song is loved, then the rating should be 3.5. I can make a rule that defines this independently but it doesn't work simultaneously. I need it to work both ways to link the value of these fields and I'm having a heck of a time figuring out how to do it. I've been trying to use ASR presets for this. Any help is appreciated.
You could try this:

Create a virtual tag:
Code
$If($Or(<Rating>=3.5,<Love>="L"),yes,no)
Then create an ASR preset that has 2 steps:

1.
search for 'yes' in the virtual tag
replace with 'L' in <Love>

2.
search for 'yes' in the virtual tag
replace with '3.5' in <Rating>


Note that if you set it to auto-run, it is not possible to change either 'Love' or Rating for tracks that have 3.5 and Love.
You'll need to create another preset that blanks both tags at the same time.

boroda

  • Hero Member
  • *****
  • Posts: 5171
I am running into an issue and it might be logic related. I want to link the ratings field to the love field. If the rating is 3.5 then the song should be Loved and vice versa, if the song is loved, then the rating should be 3.5. I can make a rule that defines this independently but it doesn't work simultaneously. I need it to work both ways to link the value of these fields and I'm having a heck of a time figuring out how to do it. I've been trying to use ASR presets for this. Any help is appreciated.

@whoozwah, i've managed to solve your task. this was not trivial  8)

no virtual tags are required, but Custom19 and Custom20 must be sacrificed to determine which of 2 tags (rating or love) has been changed.

download latest custom ASR preset pack here. import at least 2 presets: "Custom - 1. Rating [-] Loved.asr-preset" and "Custom - 2. Backup rating & loved status.asr-preset". Read their descriptions. feel free to ask me to clarify anything.

Dizza17

  • Full Member
  • ***
  • Posts: 186
@ boroda,
using the latest version of both mb and ASR, i've found that ASR is no longer in the tools menu only the right click context menu. is this expected?
When the rich wage war, it’s the poor who suffer.

boroda

  • Hero Member
  • *****
  • Posts: 5171
ASR or AT&RT?

all is fine here, but i'm not using the latest MB version. will download it now and check this.

Dizza17

  • Full Member
  • ***
  • Posts: 186
AT&RT. It’s been this way across the last two versions of the plugin
When the rich wage war, it’s the poor who suffer.

boroda

  • Hero Member
  • *****
  • Posts: 5171
well, all is fine using MB 3.6.9189 P.
the only suggestion is that you click on the main MB menu before plugin initialization. then plugin will add its submenu to MB menu never. it's well known MB issue and i can't fix it. only Steven can. try to wait 3-5 secs. before using plugin after MB startup.

boroda

  • Hero Member
  • *****
  • Posts: 5171
AT&RT. It’s been this way across the last two versions of the plugin

hmm. i haven't changed anything related to menu creation for ages.

whoozwah

  • Jr. Member
  • **
  • Posts: 24
@whoozwah, i've managed to solve your task. this was not trivial  8)

no virtual tags are required, but Custom19 and Custom20 must be sacrificed to determine which of 2 tags (rating or love) has been changed.

download latest custom ASR preset pack here. import at least 2 presets: "Custom - 1. Rating [-] Loved.asr-preset" and "Custom - 2. Backup rating & loved status.asr-preset". Read their descriptions. feel free to ask me to clarify anything.

Thank you so much. I'll check it out and report back if I run into any more issues :)

hiccup

  • Hero Member
  • *****
  • Posts: 9107
@whoozwah, i've managed to solve your task. this was not trivial  8)

no virtual tags are required, but Custom19 and Custom20 must be sacrificed....
The solution I proposed requires only 1 virtual tag. (of the 60 available)
Yours requires sacrificing 2 custom tags of which there are only 20 available.

Is there a benefit in using your solution?

boroda

  • Hero Member
  • *****
  • Posts: 5171
The solution I proposed requires only 1 virtual tag. (of the 60 available)
Yours requires sacrificing 2 custom tags of which there are only 20 available.

Is there a benefit in using your solution?

my solution works always even in auto-execution mode:

Note that if you set it to auto-run, it is not possible to change either 'Love' or Rating for tracks that have 3.5 and Love.
You'll need to create another preset that blanks both tags at the same time.

hiccup

  • Hero Member
  • *****
  • Posts: 9107
I can't figure out how to produce the values of one or more existing tags.

Suppose that I want to produce: Artist - Title
Looking at what I was able to find on the matter, I came up with:

Code
\@eval[[<Artist> - <Title>]]
But that doesn't work.
Am I doing something wrong with the syntax, or do I misunderstand how @eval works?

(I tried some variations using double quotes, and even double double-quotes that I saw in existing presets, but I still couldn't get it to work)
Last Edit: March 01, 2025, 05:13:25 PM by hiccup

boroda

  • Hero Member
  • *****
  • Posts: 5171
as  i understand there must be some function/operator inside \@eval. actually, i don't know how Steven implemented API Eval() function. all i tried till now was working. now i'm too tired to test your example. maybe, tomorrow.

if you really just want to generate "<Artist> - <Title>" string, then there is the simpler way. create 2 step preset:

1. search for "^(.*)" in <Artist>
1. replace by "$1 - "

2. search for "^(.*)" in <Title>
2. replace by "$1"
2. tick the option to append replaced value to the end of tag

-----------

quotes, commas, semicolons, and square brackets inside \@eval must be doubled, and double double-quotes is just an empty string.

hiccup

  • Hero Member
  • *****
  • Posts: 9107
if you really just want to generate "<Artist> - <Title>" string, then there is the simpler way. create 2 step preset...
Yes, I know, but it would avoid using (sacrificing) additional 'steps' if existing tags could be read and used in a single step.
Also, using the equivalent of a virtual tag within a step improves flexibility.

So I guess I am asking what I need to change (syntax-wise) when using (what would be) a virtual tag into an ASR step.
And I am admitting that I don't understand this '\@Eval' stuff.

No hurries at all. Nothing urgent going on here.

Quote
…and double double-quotes is just an empty string…
Are you sure?
You are using double double-quotes here?:

Last Edit: March 01, 2025, 09:01:00 PM by hiccup

boroda

  • Hero Member
  • *****
  • Posts: 5171
Quote
…and double double-quotes is just an empty string…
Are you sure?
You are using double double-quotes here?:



yes, sure. that's what ASR \@eval[[]] "function" passes to API Eval() function:

Code
$If($Not("<Temp 2>"="$1"),$If("<Temp 2>"="<Custom text 1>","L",""),"<Temp 1>")

the "" after "L" is an empty string. (empty tag value)

all these quotes, commas, etc. must be doubled only if used for service purposes. (to not mess them with generic quotes, commas, etc. in tag values/generic text) i.e. if you wanted to set tag value to, say, "L,M" instead of "L" (just a stupid example), then you would type literally "L,M" (not "L,,M") because this comma is just part of string, it's not a "service comma".