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

bkev

  • Jr. Member
  • **
  • Posts: 41
So it is doing something a little strange.

It seems that it does want to change the names of titles where the album begins with a T. It also looks like it does it where there is a comma (,) in the title and what happens is that

So for example:

Track = 1-1. Artist - Album beginning with T - Song name
Original Title = Song Name

New title tag then = Song name$If($TagContainsAnyString(<file path>)

But in the file path, the separator \ between Artist and Album has been replaced and the "T" at the beginning of the album is $he

So, if the path was \artist\Thealbum

The script adds this to the title and changes it to \artist$healbum

If that makes sense?

It also looks like it is trying to replace T in the Artist name too?

boroda

  • Sr. Member
  • ****
  • Posts: 4657
The only other thing I've noticed is that in the newer version I now get an error if I try and load "Library Reports". I know it's unrelated and it also happened in the version from earlier this month but if I roll back to the 2021 plugin it works.

MusicBee v3.4.8033.18564D

System.ArgumentException: Parameter is not valid.
   at System.Drawing.Bitmap..ctor(String filename)
   at MusicBeePlugin.LibraryReportsCommand.initializeForm()
   at MusicBeePlugin.LibraryReportsCommand..ctor(Plugin tagToolsPluginParam)
   at MusicBeePlugin.Plugin.libraryReportsEventHandler(Object sender, EventArgs e)
   at #=ztdEURO9iLJryE.#=za3znDkU=(Object #=z09rm0$E=, EventArgs #=z5EKpxKY=)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
working fine here. first check that unzipped all files from plugin package, especially "Missing Artwork.png". also, what version of mb are you using (installer, portable, store) and how you have installed plugin (manually copying to <mb folder>\plugins\ or using "add plugin" button in edit> prefs> plugins)?

bkev

  • Jr. Member
  • **
  • Posts: 41
The only other thing I've noticed is that in the newer version I now get an error if I try and load "Library Reports". I know it's unrelated and it also happened in the version from earlier this month but if I roll back to the 2021 plugin it works.

MusicBee v3.4.8033.18564D

System.ArgumentException: Parameter is not valid.
   at System.Drawing.Bitmap..ctor(String filename)
   at MusicBeePlugin.LibraryReportsCommand.initializeForm()
   at MusicBeePlugin.LibraryReportsCommand..ctor(Plugin tagToolsPluginParam)
   at MusicBeePlugin.Plugin.libraryReportsEventHandler(Object sender, EventArgs e)
   at #=ztdEURO9iLJryE.#=za3znDkU=(Object #=z09rm0$E=, EventArgs #=z5EKpxKY=)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
working fine here. first check that unzipped all files from plugin package, especially "Missing Artwork.png". also, what version of mb are you using (installer, portable, store) and how you have installed plugin (manually copying to <mb folder>\plugins\ or using "add plugin" button in edit> prefs> plugins)?


I've tried deleting the files from AppData\Roaming\MusicBee\Plugins

Closed Musicbee

Opened Musicbee

Added the new zip via the preferences and still get the same.

MusicBee version 3.4.8033 which is the installed version.


bkev

  • Jr. Member
  • **
  • Posts: 41
So it is doing something a little strange.

It seems that it does want to change the names of titles where the album begins with a T. It also looks like it does it where there is a comma (,) in the title and what happens is that

So for example:

Track = 1-1. Artist - Album beginning with T - Song name
Original Title = Song Name

New title tag then = Song name$If($TagContainsAnyString(<file path>)

But in the file path, the separator \ between Artist and Album has been replaced and the "T" at the beginning of the album is $he

So, if the path was \artist\Thealbum

The script adds this to the title and changes it to \artist$healbum

If that makes sense?

It also looks like it is trying to replace T in the Artist name too?

Could it be that the script is getting confused?
I can see that
$TagContainsAnyString(<URL>,TagName,string1|string2|etc.): returns "T" if tag
  contains any of the strings separated by |, otherwise returns "F".
  TagName must be written without angle brackets.

I think it is getting mixed up when a "T" already exists in the URL?

boroda

  • Sr. Member
  • ****
  • Posts: 4657
I've tried deleting the files from AppData\Roaming\MusicBee\Plugins
it was a bug, plugin was always looking for "Missing Artwork.png" in "<mb installation path>\Plugins" folder. this didn't work if users install plugin by ''add plugin"  button in prefs (because plugin is installed to "<AppData>\Plugins" folder in this case). i've embedded "MissingArtwork.png" into plugin .dll, so this must be fixed now.

Could it be that the script is getting confused?
I can see that
$TagContainsAnyString(<URL>,TagName,string1|string2|etc.): returns "T" if tag
  contains any of the strings separated by |, otherwise returns "F".
  TagName must be written without angle brackets.

I think it is getting mixed up when a "T" already exists in the URL?

no, it's another bug. seems to be just legacy and buggy part of code. its fixed. also i've changed $1 to "$1" for URL in presets to take into account commas in file paths (commas also delimit function parameters).

fixed plugin:

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

updated presets:

https://www.mediafire.com/file/0z4dorrpvc0myhg/Add_text_%2527%2527%255BExplicit%255D%2527%2527_to_track_title_if_lyrics_contain_all_words_entered_in_%255BCustom_text_1%255D_and_separated_by_%2523.ASR_Preset.xml/file

https://www.mediafire.com/file/xjg0u3hhblp554h/Add_text_%2527%2527%255BExplicit%255D%2527%2527_to_track_title_if_lyrics_contain_any_of_the_words_entered_in_%255BCustom_text_1%255D_and_separated_by_%2523.ASR_Preset.xml/file

delete old 2 presets before importing new ones to avoid preset duplicating.

bkev

  • Jr. Member
  • **
  • Posts: 41
I've tried deleting the files from AppData\Roaming\MusicBee\Plugins
it was a bug, plugin was always looking for "Missing Artwork.png" in "<mb installation path>\Plugins" folder. this didn't work if users install plugin by ''add plugin"  button in prefs (because plugin is installed to "<AppData>\Plugins" folder in this case). i've embedded "MissingArtwork.png" into plugin .dll, so this must be fixed now.

Could it be that the script is getting confused?
I can see that
$TagContainsAnyString(<URL>,TagName,string1|string2|etc.): returns "T" if tag
  contains any of the strings separated by |, otherwise returns "F".
  TagName must be written without angle brackets.

I think it is getting mixed up when a "T" already exists in the URL?

no, it's another bug. seems to be just legacy and buggy part of code. its fixed. also i've changed $1 to "$1" for URL in presets to take into account commas in file paths (commas also delimit function parameters).

fixed plugin:

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

updated presets:

https://www.mediafire.com/file/0z4dorrpvc0myhg/Add_text_%2527%2527%255BExplicit%255D%2527%2527_to_track_title_if_lyrics_contain_all_words_entered_in_%255BCustom_text_1%255D_and_separated_by_%2523.ASR_Preset.xml/file

https://www.mediafire.com/file/xjg0u3hhblp554h/Add_text_%2527%2527%255BExplicit%255D%2527%2527_to_track_title_if_lyrics_contain_any_of_the_words_entered_in_%255BCustom_text_1%255D_and_separated_by_%2523.ASR_Preset.xml/file

delete old 2 presets before importing new ones to avoid preset duplicating.


That. Is FANTASTIC!

I've given it a test and the library menu now loads and the presets work too!

One last thing I've found. Is there anyway that when the explicit preset is scanning the files, if the word "Explicit" already exists in the title, it skips it?

At the moment, everytime it is run, an additional "Explicit" is added to the title. I'd really like to set this preset to auto run everytime MusicBee is loaded so any new files can be tagged, but at the moment the files would just build up with "Explicit" on the end  :)

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1282
also, i've added 2 new functions to plugin:

Code
$TagContainsAnyString("<URL>",tag_name,string1|string2|etc.): returns "T" if tag
  contains any of the strings separated by |, otherwise returns "F".
  tag_name must be written without angle brackets,
  e.g. $TagContainsAnyString("<URL>",Title,a|an|the)

$TagContainsAllStrings("<URL>",tag_name,string1|string2|etc.): returns "T" if tag
  contains all strings separated by |, otherwise returns "F".

Are these new functions supposed to work in Virtual Tags too? I cannot get them to do anything.

boroda

  • Sr. Member
  • ****
  • Posts: 4657
yes, but i've mistaken, quotes around <URL> tag must not be used, they don't work at all, and all is working just fine without them.

boroda

  • Sr. Member
  • ****
  • Posts: 4657
One last thing I've found. Is there anyway that when the explicit preset is scanning the files, if the word "Explicit" already exists in the title, it skips it?
presets already skips " [Explicit]" at the end of title (notice a space before "[Explicit]"). maybe this space is the problem? or do you want to skip [Explicit] in the middle of the title?

bkev

  • Jr. Member
  • **
  • Posts: 41
One last thing I've found. Is there anyway that when the explicit preset is scanning the files, if the word "Explicit" already exists in the title, it skips it?
presets already skips " [Explicit]" at the end of title (notice a space before "[Explicit]"). maybe this space is the problem? or do you want to skip [Explicit] in the middle of the title?

No it's [Explicit] at the end of the title as you say.

So, for example

On the first run if lyrics doesn't have a word it's skipped, so that works. If lyrics do contain the word, change "Title" to "Title [Explicit]"

So far so good.

If I run the script again, on the same songs;

If lyrics don't contain the word, it's skipped. Again that's great. If lyrics do contain the words, what happens for me is that "Title [Explicit]" is change to "Title [Explicit] [Explicit]". It doesn't seem to skip it for me, just adds it on again.


bkev

  • Jr. Member
  • **
  • Posts: 41
yes, it's another serious bug in ASR, which even is not directly related to your ASR presets.

fixed plugin:

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

fixed presets (delete old 2 presets before importing new presets):

https://www.mediafire.com/file/vb7re29q060oaed/Add_text_%2527%2527%255BExplicit%255D%2527%2527_to_%255BTag_1%255D_if_lyrics_contain_all_words_entered_in_%255BCustom_text_1%255D_and_separated_by_%2523.ASR_Preset.xml/file

https://www.mediafire.com/file/gmd3v3fzgv06zs0/Add_text_%2527%2527%255BExplicit%255D%2527%2527_to_%255BTag_1%255D_if_lyrics_contain_any_of_the_words_entered_in_%255BCustom_text_1%255D_and_separated_by_%2523.ASR_Preset.xml/file


Yes! That looks like it works, but I may have come across another bug (so sorry!)

If I set "Auto apply present only if track is contained in playlist" to a smart playlist and I also set "Autoapply ticked presets at startup" and tick this present, it seems that the plug in crashes? I think it is still there at start up, as some auto library stats I use still show, but it doesn't appear in the menu and it doesn't seem to change the tags.

I'm not sure if this is because it takes a bit of time for Musicbee to generate the auto playlist and it's maybe not ready before the preset tries to access the files?

But thanks so much so far :)

Edit:
If I set it to just "Autoapply ticked presets on startup" the "Additional tagging tools" option disappears from the menu and to get it back I have to edit the mb_TagTools.Settings file and change   <autoapplyTickedPresetsOnStartup>true</autoapplyTickedPresetsOnStartup> to false
Last Edit: August 25, 2022, 01:35:38 PM by bkev

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1282
yes, but i've mistaken, quotes around <URL> tag must not be used, they don't work at all, and all is working just fine without them.

Sorry, I had not updated properly. It works!

boroda

  • Sr. Member
  • ****
  • Posts: 4657
but I may have come across another bug (so sorry!)

If I set "Auto apply present only if track is contained in playlist" to a smart playlist and I also set "Autoapply ticked presets at startup" and tick this present, it seems that the plug in crashes? I think it is still there at start up, as some auto library stats I use still show, but it doesn't appear in the menu and it doesn't seem to change the tags.
i cant reproduce plugin crashes using these settings. try to: close mb, delete mb_TagTools.Settings, start mb again, and adjust ASR settings from scratch.

bkev

  • Jr. Member
  • **
  • Posts: 41
but I may have come across another bug (so sorry!)

If I set "Auto apply present only if track is contained in playlist" to a smart playlist and I also set "Autoapply ticked presets at startup" and tick this present, it seems that the plug in crashes? I think it is still there at start up, as some auto library stats I use still show, but it doesn't appear in the menu and it doesn't seem to change the tags.
i cant reproduce plugin crashes using these settings. try to: close mb, delete mb_TagTools.Settings, start mb again, and adjust ASR settings from scratch.

Still happens for me I'm afraid.

I've closed mb, deleted the file. Opened mb. Deleted all the presets. Closed mb. Open mb. Import any word explicit preset. Add the word. Tick the preset and tick the box for "Autoapply ticked presets at startup". Click Apply and "Save all and close"

Close mb

Open mb and the option for "Advanced Tagging Tools" no longer appears in the mb menu.