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

boroda

  • Sr. Member
  • ****
  • Posts: 4659
The "Always preserve these tag values" list is invaluable, to be sure.  If you decide to keep this <All Tags> option permanently, there might need to be a similar list where it's "only apply to" instead, as sometimes the "all" in "all tags" is a bit too many.  :)

this can be done by unchecking undesirable lines of preview. maybe this unchecking can be automated, but i'm not sure how this "automation" can be implemented in UI.

Also, unrelated observation, in the description for "Always preserve" it says to separate the values with ";;" but using two semi-colons actually breaks the list (as in only the first item is preserved, the rest are applied).  It only works as described when using a single semi-colon to separate the list.

i can't reproduce this, but i've found another much more important bug related to "always preserve" field. it's fixed, but could you recheck your issues using updated version?

i'm going to completely disable auto-applying of such presets, explicitly disable hotkeys for them, and disable applying of them without explicitly generating preview at first.

it's done.

also, numerous bug introduced by new <all tags> functionality are fixed:

https://www.mediafire.com/file/ycdl10fo8cgfwns/mb_TagTools_beta.zip/file
Last Edit: July 23, 2023, 04:40:26 PM by boroda

calderino

  • Jr. Member
  • **
  • Posts: 48
Hello,
I want to know if this is possible to do with the plugin:

I have my Japanese artist defined as "Translated Name [Original Name]", for example "Hashimoto Yukari [橋本 由香利]".
I want to find typos in the artist names by comparing the Japanese part of the tag and then comparing the English part.

Example:
Let's say I have a file with artist="Hashimoto Yukari [橋本 由香利]" and another one with artist="Hashimoto Yukaro [橋本 由香利]"
I want to check which artists have the same Japanese artist (in this case both match with 橋本 由香利).
Then, I want to compare the English part and have a result if they do not match (Hashimoto Yukari != Hashimoto Yukaro)

boroda

  • Sr. Member
  • ****
  • Posts: 4659
hello, calderino. yes, it's possible. i'm not sure if you mean "artist" or "album artist" tag, i will suggest using "artist" tag. also, you can use any virtual tags instead of <virtual3> and <virtual4> in my example.

1. define <virtual3> as:
Code
$If($RxReplace(<Artist>,".*\[(.*)\]$","$1")=<Artist>,,$RxReplace(<Artist>,"(.*)\[.*\]$","$1"))

<virtual3> will show translated part of artist name if Japanese part is present (otherwise <virtual3> will be empty).

2. define <virtual4> as:
Code
$If($RxReplace(<Artist>,".*\[(.*)\]$","$1")=<Artist>,,$RxReplace(<Artist>,".*\[(.*)\]$","$1"))

<virtual4> will show Japanese part of artist name if it's present (otherwise <virtual4> will be empty).

3. create Library Reports preset: define 2 groupings: virtual4, virtual3.

this preset will show every unique combination of Japanese artist name and translated artist name, sorted by Japanese name, so you will be able to easily see if there are several translated names for every Japanese name. 1st line of report wil be empty, ignore it, it corresponds to all artists which don't have brackets in their names.

calderino

  • Jr. Member
  • **
  • Posts: 48
hello, calderino. yes, it's possible. i'm not sure if you mean "artist" or "album artist" tag, i will suggest using "artist" tag. also, you can use any virtual tags instead of <virtual3> and <virtual4> in my example.

1. define <virtual3> as:
Code
$If($RxReplace(<Artist>,".*\[(.*)\]$","$1")=<Artist>,,$RxReplace(<Artist>,"(.*)\[.*\]$","$1"))

<virtual3> will show translated part of artist name if Japanese part is present (otherwise <virtual3> will be empty).

2. define <virtual4> as:
Code
$If($RxReplace(<Artist>,".*\[(.*)\]$","$1")=<Artist>,,$RxReplace(<Artist>,".*\[(.*)\]$","$1"))

<virtual4> will show Japanese part of artist name if it's present (otherwise <virtual4> will be empty).

3. create Library Reports preset: define 2 groupings: virtual4, virtual3.

this preset will show every unique combination of Japanese artist name and translated artist name, sorted by Japanese name, so you will be able to easily see if there are several translated names for every Japanese name. 1st line of report wil be empty, ignore it, it corresponds to all artists which don't have brackets in their names.

Thanks for this. I was not aware of what Library reports did!
One last question, if there are multiple artists in the tag, virtual4 only uses the last japanese name.
How can I adapt the virtual tag to take into account several artists?

boroda

  • Sr. Member
  • ****
  • Posts: 4659
firstly, there was a bug in library reports command related to "count" function. it's fixed, download latest plugin version to use my improved suggestion (read it below). latest plugin version is beta, but don't worry, beta status concerns only new advanced search & replace functionality.

https://www.mediafire.com/file/ycdl10fo8cgfwns/mb_TagTools_beta.zip/file

new suggestion:

create another LR preset (DON'T delete preset from my previous suggestion) containing 1 grouping "virtual4" and 1 function "Count(Virtual3)" (this function counts the number of unique virtual3 values per every virtual4 value). define condition "export only if Count(Virtual3) is greater than 1". export preset report to m3u playlist, and import this playlist to mb (file> playlists> import playlists).

select this playlist to see only tracks, which have more than 1 translated artist for every Japanese artist. then generate preview using preset from my previous post. now you will see only Japanese and translated artist names, but only for artists, which have both Japanese AND translated parts, AND only if there are MORE THAN ONE translated parts for Japanese part of artist name.

see screenshot as an example:



-------------------------------

One last question, if there are multiple artists in the tag, virtual4 only uses the last japanese name.
How can I adapt the virtual tag to take into account several artists?

i'm not sure if there is a workaround for this, i must think about this more, but firstly i need to know how Japanese artist names are formatted in <artist> tag, i.e. are they separated by comma, or by comma followed by space, or by semicolon, etc.?

Dizza17

  • Jr. Member
  • **
  • Posts: 69
Hi Boroda,
Thanks for this awesome plugin! I apologise if this has been asked before but I haven’t been able to find any information. There used to be a preset titled along the lines of “Copy tag 1 to tag 2 if tag 1 isn’t empty”. I haven’t been able to find it anywhere for a while now but it used to be in the list of presets supplied with the plugin. Do you still have this preset anywhere?
Cheers Aaron.

calderino

  • Jr. Member
  • **
  • Posts: 48
Quote
i'm not sure if there is a workaround for this, i must think about this more, but firstly i need to know how Japanese artist names are formatted in <artist> tag, i.e. are they separated by comma, or by comma followed by space, or by semicolon, etc.?

They are multiple artist entries, but in the Display Artist they are separated by a semicolon:
ex. : displayArtist="My Artist [JAPANESE]; My Other Artist [OTHER JAPANESE]"

boroda

  • Sr. Member
  • ****
  • Posts: 4659
There used to be a preset titled along the lines of “Copy tag 1 to tag 2 if tag 1 isn’t empty”. I haven’t been able to find it anywhere for a while now but it used to be in the list of presets supplied with the plugin. Do you still have this preset anywhere?

sorry, i'm not aware of such preset. dedicated "copy tag" command (not ASR preset) has the option "copy only if destination tag is empty", but it's not what you are looking for.

boroda

  • Sr. Member
  • ****
  • Posts: 4659
They are multiple artist entries, but in the Display Artist they are separated by a semicolon:
ex. : displayArtist="My Artist [JAPANESE]; My Other Artist [OTHER JAPANESE]"

no, there is no solution for multiple entries per tag right now. but you gave me an idea how i can improve LR (also, to take into account your case). though, not sure when i make this improvement.

boroda

  • Sr. Member
  • ****
  • Posts: 4659
new beta seems to be stable, but it would be great if somebody else has tested it. all changes relate to 5 things:

1. "copy tags to clipboard" window is now used not only for copying tags to clipboard, but also to simply select tags from some other commands (ASR, tag history, compare tracks). this window will look slightly different depending on context.

2. ASR support for <ALL TAGS> pseudo-tag is completed. preset support for this pseudo-tag must be enabled in preset editor 1st, i.e. this support can be added either to new user presets, or to user copies of predefined presets. either all tags, or only specified tags, or all tags except for the list of preserved tags will be processed, when using <ALL TAGS>.

3. now, LR presets can use another LR preset as the source of track list. of course, this makes sense only if the source preset uses conditional filtering (option "export/save tags only if..."). report itself generated by source preset is not used in this case, only filtered track list is used - all tracks (maybe even not displayed in source preset report), which satisfy source preset condition.

* LR presets can be chained to take advantage of multiple conditions.  

4. LR preset report preview can be interactively filtered, according to specified condition, by clicking "Filter" button.

5. plugin settings are extended. simplified quick settings can be opened from some commands.







--------------------------------------------------------

if somebody has ideas, for which ASR presets it might be useful to allow using <ALL TAGS> (along with generic tags, and considering possible restrictions to what to treat as "all tags"), post your suggestions!

download link:
https://www.mediafire.com/file/ycdl10fo8cgfwns/mb_TagTools_beta.zip/file

calderino

  • Jr. Member
  • **
  • Posts: 48
They are multiple artist entries, but in the Display Artist they are separated by a semicolon:
ex. : displayArtist="My Artist [JAPANESE]; My Other Artist [OTHER JAPANESE]"

no, there is no solution for multiple entries per tag right now. but you gave me an idea how i can improve LR (also, to take into account your case). though, not sure when i make this improvement.

Thanks, no worries, it's not like it's urgent  ;)

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1070
  • Heal The World
I want to know if this is possible to do with the plugin:

I have my Japanese artist defined as "Translated Name [Original Name]", for example "Hashimoto Yukari [橋本 由香利]".
I want to find typos in the artist names by comparing the Japanese part of the tag and then comparing the English part.
In the short time that I've been here, I have witnessed little to no requests that this plugin has failed to deliver a solution to.
I have yet to truly explore it in depth, but I've already seen enough to know it's an absolute gem.
Nevertheless, I went looking around for a solution within MusicBee's native features - simply because Steven is that amazing too :-)

Define the following virtual tags:

Japanese Artist   ---------   ​$RxReplace($RxMatch(<Artists>,"[^;]*\[.*\]"),"^\s","")
Translation           ---------   $RxReplace(<Japanese Artist>,"(.*?)\s\[.*?\](;\s)?","$1$2")
Original                 ---------   $RxReplace(<Japanese Artist>,".*?\[(.*?)\](;\s)?","$1$2")

Enable the Column Browser in View > Arrange Panels... like so:



Then whenever you click on a Japanese name in the Original column, MusicBee will filter all the corresponding different Translations.
And as far as my testing goes, the regular expressions in those virtual tags do take into account multiple artist entries.
I already spend hours on end on social media. Might as well spare a few of those to a greater purpose here.

northernlights

  • Newbie
  • *
  • Posts: 11
I'm using the plugins library report for adding some kind of calculated "album score" to a custom tag of each track belonging to the same album.

Given that, I would like to rank all albums depending on their "album score" and save this rank to a virtual/custom tag. The only way (I can think of so far) to achieve this in MusicBee seems to be $LR(<URL>,function_id) virtual function which is pretty cool already.  

Therefore I propose adding a ranking feature to "Function for new fields" that is able to rank an attribute based on all selected tracks.

boroda

  • Sr. Member
  • ****
  • Posts: 4659
I apologize, but I have no idea what an "album score" is or exactly how the "rank" function should work. should it be sum(album score) or average(album score)? and how it must be different from already available functions?

boroda

  • Sr. Member
  • ****
  • Posts: 4659
New beta, which seems to be stable, but I don't want to upload it as a stable release yet:

https://www.mediafire.com/file/ycdl10fo8cgfwns/mb_TagTools_beta.zip/file

---------------------

new features:

1. The LR UI is rewritten.

2. LR now supports multiple item splitters for grouping tags. For example, you can define splitter ; for "artist" or "'genre" tags to split multiple artists or genres.



3. if several tags are split (i.e. several tags for one track may have several values) then all possible combinations of split values for every tag will be included in LR report.



4. LR now supports virtual tag expressions (any expressions valid for virtual tags). you can refer to any tag in an LR expression using the MB generic <tag name>  construction or refer to the current grouping/function tag (which can already be split tag value, if splitter is defined for this tag) as \@.

LR expressions are mostly intended to be used for regexes, though they are not limited to them. expressions can save you virtual tags if you need some expressions to be used in LR only, but the main purpose of LR expressions is to use them together with multiple item splitters for grouping tags.

if 2 virtual tags are split into multiple values (e.g., separated by ; ) for a given track, then all combinations of these values will be included in the LR report. contrary to this, several expressions of one split grouping tag for a given track produce a single combination for every split tag value.

Last Edit: August 12, 2023, 05:03:15 AM by boroda