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

boroda

  • Sr. Member
  • ****
  • Posts: 4659
i thinks it's just a combination of 2 known issues (internal mb issue and plugin issue), each of which separately is not very important to fix it. roughly speaking, you click mb "tools" menu before plugin's submenu registration (and plugin's submenu won't be ever registered in this case). i've moved plugin's submenu registration to the beginning of plugin initialization (before auto-applying asr presets at startup).

try fixed plugin. it's worth to wait 1-2 sec. before clicking mb menu on mb startup in any case.

https://www.mediafire.com/file/h2t08o9562efboi/mb_TagTools_latest.zip/file

bkev

  • Jr. Member
  • **
  • Posts: 41
i thinks it's just a combination of 2 known issues (internal mb issue and plugin issue), each of which separately is not very important to fix it. roughly speaking, you click mb "tools" menu before plugin's submenu registration (and plugin's submenu won't be ever registered in this case). i've moved plugin's submenu registration to the beginning of plugin initialization (before auto-applying asr presets at startup).

try fixed plugin. it's worth to wait 1-2 sec. before clicking mb menu on mb startup in any case.

https://www.mediafire.com/file/h2t08o9562efboi/mb_TagTools_latest.zip/file

Brill, it doesn't break now nice one!

One question, when does the plug in change the tags? Will it rescan the playlists or does something else need to be done for it to check the playlist and/or library so it can check any new files added?

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9369
One question, when does the plug in change the tags? Will it rescan the playlists or does something else need to be done for it to check the playlist and/or library so it can check any new files added?
If you tick the box to the left of the desired preset, it will automatically apply the preset to all files that meet the criteria. Otherwise you must select the files > open ASR > select the preset > preview > apply.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

boroda

  • Sr. Member
  • ****
  • Posts: 4659
One question, when does the plug in change the tags? Will it rescan the playlists or does something else need to be done for it to check the playlist and/or library so it can check any new files added?
asr auto-applies ticked presets if "changed" file meet the criteria (as phred has written) directly on file change. "file change" is either any change of its tag(s), if this tag change is not made by asr itself (to avoid infinite loops), or moving file from inbox to library, or just adding new file to the library.

i would recommend you not to auto-apply asr presets on mb startup. it's slower that:

1st manually apply required presets to files that belong to required playlist (select playlist in the left navigator panel to show only tracks from that playlist in the main panel, and select all tracks from playlist (ctrl+A))

2nd auto-apply required presets on "tag changes" (this will also auto-apply presets on adding new tracks to the library), if "changed files" belong to that (auto)playlist


i've made auto-applying asr presets slightly faster, not sure if it's noticeable:

https://www.mediafire.com/file/h2t08o9562efboi/mb_TagTools_latest.zip/file

bkev

  • Jr. Member
  • **
  • Posts: 41
One question, when does the plug in change the tags? Will it rescan the playlists or does something else need to be done for it to check the playlist and/or library so it can check any new files added?
asr auto-applies ticked presets if "changed" file meet the criteria (as phred has written) directly on file change. "file change" is either any change of its tag(s), if this tag change is not made by asr itself (to avoid infinite loops), or moving file from inbox to library, or just adding new file to the library.

i would recommend you not to auto-apply asr presets on mb startup. it's slower that:

1st manually apply required presets to files that belong to required playlist (select playlist in the left navigator panel to show only tracks from that playlist in the main panel, and select all tracks from playlist (ctrl+A))

2nd auto-apply required presets on "tag changes" (this will also auto-apply presets on adding new tracks to the library), if "changed files" belong to that (auto)playlist


i've made auto-applying asr presets slightly faster, not sure if it's noticeable:

https://www.mediafire.com/file/h2t08o9562efboi/mb_TagTools_latest.zip/file


That's great thanks. Happy to run it through my library I've already got manually and the tick in the preset means it applies to any new files is perfect. Thanks for putting so much work in to getting this sorted.


Messiaen

  • Jr. Member
  • **
  • Posts: 103
I seem to have encountered an unusual problem with the \@replace function.  A simple single step reproducer is outlined below.

<Tag 1> is writable, corresponds to Title
<Custom text 1> is active, and set to: 1/A|2/B|3/C
Search for: (\d)
Replace with: \@replace[[$1;;\@1]]

Testing with a title of "Let A = 2" results in the expected "Let A = B" (single match to the regex).

However, if the regex finds two matches such as in the title "Let 1 = 3" (which should result in "Let A = C"), the result is instead a very mangled:

Let A;;A/A|B/B|C/C]] = \@replace[[C

...which seems to be a combination of the title with the 'A' and 'C' parts visibly changed as expected, but the rest is actually the data from the preset fields themselves.

Again, this only happens when 2 or more pattern matches are encountered in a title, single matching works reliably.

Using the latest version of the plugin (from 26-Aug-22), and the latest MB (3.5.8274 P)

boroda

  • Sr. Member
  • ****
  • Posts: 4659
exactly for the case you've described, use search pattern ^(.*), not (\d), because you already have explicitly defined to replace only digits 1, 2 and 3 in <custom text 1>. or is it a simplified example?

btw, are you using "Multiple Search & Replace" to create this ASR preset? function "\@replace" had been created only as backend for MSR. it's better to use MSR (convenient frontend) for such tasks.

Messiaen

  • Jr. Member
  • **
  • Posts: 103
...or is it a simplified example?
It's a vastly simplified example (what the grumpy StackOverflow people would call "Minimal, Complete, and Verifiable").  :)

My actual regex is this: ((?=\b[MCDXLVI]{1,6}\b)M{0,4}(?:CM|CD|D?C{0,3})(?:XC|XL|L?X{0,3})(?:IX|IV|V?I{0,3}))

(It matches Roman Numerals to the exclusion of other text - using that as the example would just complicate everything!)

btw, are you using "Multiple Search & Replace" to create this ASR preset? function "\@replace" had been created only as backend for MSR. it's better to use MSR (convenient frontend) for such tasks.
I was using ASR (that's the more convenient frontend, isn't it?) - MSR is almost impossible to use as the UI input-fields don't seem to allow simple cursor movement with the <Left>/<Right> keys, so editing is a lost cause.  (The ASR input fields work fine, so that's the best one for me.  I have no idea why the MSR input is so difficult - maybe I adjusted the keyboard settings in MB and it interferes with your UI?)

In any event, the result is the same for either (I just tried it), so it's something in the function itself, probably not user-error.  ;)

To be completely fair, what I'm really looking for is a function which is the opposite of @lc (I need roman numerals in all upper-case, after using @tc on the rest of the text).  There doesn't seem to be an all upper-case function (is there?), so I'm using @replace as an awkward workaround.
Last Edit: August 27, 2022, 10:50:07 PM by Messiaen

boroda

  • Sr. Member
  • ****
  • Posts: 4659
\@replace function was never intended to use this way. you must always use ^(.*) as search pattern and $1 as 1st parameter of \@replace.

but you can use any regexes in the second parameter of \@replace (in "Custom text 1" in your case), e.g. something like \@replace[[$1;;*(\\d)/A]], which replaces all digits by "A" (asterisk means using regex for search, backslashes must be escaped). in msr just tick checkbox in "(*)" column to use regex.

I was using ASR (that's the more convenient frontend, isn't it?) - MSR is almost impossible to use as the UI input-fields don't seem to allow simple cursor movement with the <Left>/<Right> keys, so editing is a lost cause.  (The ASR input fields work fine, so that's the best one for me.  I have no idea why the MSR input is so difficult - maybe I adjusted the keyboard settings in MB and it interferes with your UI?)
it's strange, because <left>/<right> keys are working fine for me in msr.

To be completely fair, what I'm really looking for is a function which is the opposite of @lc (I need roman numerals in all upper-case, after using @tc on the rest of the text).  There doesn't seem to be an all upper-case function (is there?), so I'm using @replace as an awkward workaround.
\@uc was missing only because i was thinking it wouldn't be needed to anyone. not a big deal, it's just couple of new lines of code in plugin:

https://www.mediafire.com/file/h2t08o9562efboi/mb_TagTools_latest.zip/file

i've also added asr preset "Example: 'Change case' command - UPPER CASE" as an example.
Last Edit: August 28, 2022, 06:30:03 AM by boroda

Messiaen

  • Jr. Member
  • **
  • Posts: 103
...you can use any regexes in the second parameter of \@replace (in "Custom text 1" in your case), e.g. something like \@replace[[$1;;*(\\d)/A]], which replaces all digits by "A"...
Nice to know, except your example (typed literally) doesn't seem to work (the title is returned as blank).  Not sure what I could be doing wrong, as I simply copy/pasted your regex directly into MSR.  :-\

\@uc was missing only because i was thinking it wouldn't be needed to anyone... i've also added asr preset "Example: 'Change case' command - UPPER CASE" as an example.
...umm.... doesn't seem to be working.  Downloaded the new version from your link, found the new ASR preset, but it doesn't seem to work: it's literally replaced by "\@uc[[movement iii;;]]".  @lc works as usual.

 :'(

Messiaen

  • Jr. Member
  • **
  • Posts: 103
it's strange, because <left>/<right> keys are working fine for me in msr.
I discovered that I had set "Playback: Skip Forward 5 seconds" in MB to the <Right> key and Back 5 seconds to the <Left> key, and that messes up your input fields (only in that MSR listview form).  Deleting those hotkeys allows the fields/keys to work properly.  Weird.  At least that's one mystery solved.  ::)

boroda

  • Sr. Member
  • ****
  • Posts: 4659
Nice to know, except your example (typed literally) doesn't seem to work (the title is returned as blank).  Not sure what I could be doing wrong, as I simply copy/pasted your regex directly into MSR.  :-\
no, this example is for use in asr preset. msr do all escaping for you automatically, type usual regexes in msr, i.e. the same example for msr is:

search for (\d) and replace by A. no asterisk and escaping of backslashes is needed in msr.

...umm.... doesn't seem to be working.  Downloaded the new version from your link, found the new ASR preset, but it doesn't seem to work: it's literally replaced by "\@uc[[movement iii;;]]".  @lc works as usual.
hmm... it seems that you haven't updated plugin .dll, only asr presets.


boroda

  • Sr. Member
  • ****
  • Posts: 4659
...umm.... doesn't seem to be working.  Downloaded the new version from your link, found the new ASR preset, but it doesn't seem to work: it's literally replaced by "\@uc[[movement iii;;]]".  @lc works as usual.
sorry, it's me who haven't updated plugin .dll in plugin .zip :) redownload plugin from the same link.

Messiaen

  • Jr. Member
  • **
  • Posts: 103
msr do all escaping for you automatically
Ah, that explains that.  I actually searched through all 177 pages of this thread before I posted originally, and the "documentation" for \@replace amounts to a single example when you first added it, no other details.  Thanks.

hmm... it seems that you haven't updated plugin .dll...
Ok, the most recent one from 28-Aug now works properly, the previous one from a few hours ago did not work - maybe the mediafire link needed flushing.

Thank you very much.  :)