RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

MMuser2011
Posts: 1305
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by MMuser2011 » Thu Feb 09, 2012 7:08 am

I would like to fill the ALBUM ARTIST tag with more useful/logical content and a controllable way.
How can I replace the actual or empty content in this tag:
a) If the entire album has the same artist -> copy it to the ALBUM ARTIST tag
b) If the album has two artists (Split Albums) -> copy the one half of the album with the one artist, the second half with the other one
c) if the album has 3 or more artists (Compilations) -> copy 'VARIOUS ARTIST' to ALBUM ARTIST tag
It would not be a problem to do that in 3 single steps. But I don't even know, how to 'count' the number of different artists or recognize a full album.
Thanks for your help in advance!
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version

ZvezdanD
Posts: 3098
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by ZvezdanD » Fri Feb 10, 2012 5:11 am

MMuser2011 wrote:I would like to fill the ALBUM ARTIST tag with more useful/logical content and a controllable way.
How can I replace the actual or empty content in this tag:
a) If the entire album has the same artist -> copy it to the ALBUM ARTIST tag
b) If the album has two artists (Split Albums) -> copy the one half of the album with the one artist, the second half with the other one
c) if the album has 3 or more artists (Compilations) -> copy 'VARIOUS ARTIST' to ALBUM ARTIST tag
I don't understand the b) condition, but I suppose you could try this preset:
Preset: Assign "Various Artists" to Album Artist if Album has 3 or more Artists, else assign Artist(s)
Find what: ^.*
Into: Album Artist
Regular expression 1: checked
Replace with: IIf(IfNull(SQLQuery("SELECT IDAlbum FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " GROUP BY IDAlbum HAVING Count(TrackNumber) = Max(Cast(TrackNumber As integer)) AND Count(TrackNumber) > 3"), 0) > 0, IIf(IfNull(SQLQuery("SELECT IDAlbum FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " GROUP BY IDAlbum HAVING Count(DISTINCT Artist) > 2"), 0) > 0, "Various Artist", oSongData.ArtistName), "$&")
VBScript expression: checked
MMuser2011 wrote:It would not be a problem to do that in 3 single steps. But I don't even know, how to 'count' the number of different artists or recognize a full album.
There are "Complete Albums" and "Albums with multiple Genres" masks for Magic Nodes which could be customized to display what you want. For example:

Code: Select all

<Group|Name:Albums...|Show tracks:No>\Complete Albums with multiple Artists|Icon:Bottom level|Filter:Songs.IDAlbum IN (SELECT IDAlbum FROM Songs WHERE IDAlbum > 0 GROUP BY IDAlbum HAVING Count(TrackNumber) = Max(Cast(TrackNumber As integer)) AND Count(TrackNumber) > 3 AND Count(DISTINCT Artist) > 1)\<Album with album artist|Statistic:Count(Artist)>\<Artist|Statistic:Count(Tracks)>
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

ZvezdanD
Posts: 3098
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by ZvezdanD » Fri Feb 10, 2012 5:24 am

BionicRooster wrote:I finally figured it out on my own. It is a five step process.
Glad you did it on your own. However, four of your steps could be done with just one preset, or at least with two predefined ones: "Assign (the end) of Title to <Into Field> (only if exists)..." and "Replace specified string with another one in <Original Artist>...". If you want just one preset instead of those two, modify the Replace with string of the first mentioned preset to:
IIf(Len(SetVar(0, RegExp(oSongData.Title, "[^\(]*(?= Cover\)$)", 0))) > 0, GetVar(0), "$&")
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

MMuser2011
Posts: 1305
Joined: Mon Oct 17, 2011 8:28 am
Location: Central Europe

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by MMuser2011 » Fri Feb 10, 2012 5:53 am

Works great, thank you, ZvezdanD!

Just to let you know:
There is a (very) small problem with extremely unusal artist names like '!!!'
I can replace this few cases manually.
Magic Nodes v4.3.3 (2018-10-03) last free version SQL Viewer v2.4 (2009-10-25)
ExternalTools v1.4 (2011-05-09) iTunesMonkey 1.0 + Acoustid
Calculate Cover Size v1.7 (2012-10-23) RegExp Find & Replace v4.4.9 (2018-10-03) last free version

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by nynaevelan » Wed Feb 22, 2012 12:49 pm

Hi Z:

I am trying to create a regex to set the Playback position back to zero but of course I have no idea how to do this, can you help me? I tried to change #22 but I couldn't get it work.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files

ZvezdanD
Posts: 3098
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by ZvezdanD » Wed Feb 22, 2012 1:27 pm

nynaevelan wrote:I am trying to create a regex to set the Playback position back to zero but of course I have no idea how to do this, can you help me? I tried to change #22 but I couldn't get it work.
The setting of the Playback position is possible only for audiobooks by MM design: select track(s), choose Edit | Tags Manipulation Presets | Assign specified value to Playback position (%)... and specify 0.

EDIT: By the way, if you are trying to set the starting position to 0, then you could use the "Assign specified string to <Into Field>..." preset with the "Start Time" destination field and 0 as "String to assign".
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

Butt_Chunx
Posts: 8
Joined: Sun Oct 09, 2011 3:58 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by Butt_Chunx » Sun Feb 26, 2012 8:50 pm

I have some preset requests and please don't ask me to write these myself because I just can't understand how to use Regular Expressions.

Fill Album artist field with primary artist even if an artist and featuring artists are specified and even if Album Artist field is empty. Primary Artist is usually the first Artist specified. Album Artist "Lady GaGa; Colby O'Donis" > Album Artist "Lady GaGa".

Remove Producer credit from end of Title and add it to involved people "Room Service (Prod. by Jim Jonsin)".

Remove featuring artist from end of Tile field and add it to Artist field either as "feat. <Artist>" or as I prefer it "; <Artist>". Example: "Lady GaGa - Just Dance Feat. Colby O'Donis" or "Just Dance (Ft. Colby O'Donis)" > Lady GaGa; Colby O'Donis - Just Dance.

Replace every "," with ";" example "Lady GaGa, Colby O'Donis" > "Lady GaGa; Colby O'Donis".

Replace "Rmx" with "Remix".

Remove spaces at the end and beginning of any field if present. Example " I Will Be Here (Radio Edit)", "Trance "

Remove spaces between punctuation marks, parentheses and brackets, example "How Are You ?" or " I Will Be Here ( Radio Edit )".

Fix how certain artist are spelled example Pink > P!NK, Kesha > Ke$ha, Sophie Ellis Bextor > Sophie Ellis-Bextor, atb > ATB, Spencer and Hill > Spencer & Hill, Tiesto > DJ Tiësto, Beyonce > Beyoncé etc..

Backup album art to a specific folder and remove it if it is not square such as 600x598 or if at all possible resize it.

If it is possible, it would nice to be able to use multiple presets at the same time.

If it is possible, it would nice if RegEx had a logging feature to keep track of every change made to every item so if something is changed by mistake it can be undone.

soundsxtreme

Find and Replace... waste of time

Post by soundsxtreme » Sun Mar 04, 2012 12:00 pm

Why the heck not delete the entire field, instead of 'find and replace'?

Takes hours to find and replace ALL tags in a specific field, when it should be instant to delete the field.

It would be so easy to save us hours.
Last edited by Lowlander on Sun Mar 04, 2012 4:39 pm, edited 1 time in total.
Reason: Merged with existing topic

nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Find and Replace... waste of time

Post by nohitter151 » Sun Mar 04, 2012 12:21 pm

What are you talking about?
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.

ed.j
Posts: 78
Joined: Thu May 19, 2011 1:44 pm

Re: Find and Replace... waste of time

Post by ed.j » Sun Mar 04, 2012 12:27 pm

not entirely sure what you're on about but this may help: selecting multiple files and putting a tick next to an blank tag empties that tag for all the selected files

soundsxtreme

Deleted ALBUM ARTIST and LOST ARTIST as well!

Post by soundsxtreme » Sun Mar 04, 2012 1:26 pm

I can't BELIEVE THIS! I just used advanced find and replace to clear the ALBUM ARTIST tags, and it WIPED THE ARTIST TAG as well!!!

NO God Damned WARNING! NO UNDO!

Not only does it take hours to do these find and replace, but it clears stuff I DIDN'T TELL IT TO!

I'm DON'T have ESP! If it's going to do things that aren't OBVIOUS AND APPARENT, then WHY DOESN'T IT WARN US?????

HOURS AND HOURS AND HOURS trying to clean up the database - this program should be in BETA until these 'features' are properly explained and protections put in place to prevent unintended side effects!

I planned to backup my database as soon as I finished erasing these tags I didn't need... now I have to spend DAYS to get the artists back!

The problem is, when I do that, it seems to fill in other crap too - crap I don't want!

Anybody paying attention to these problems?

1. Should be way to delete entire FIELDS, which would obviously clear the tags. For example, in Access you would simply delete the table, then recreate it - all records would be lost for that field. This would save HOURS instead of find-replace to EMPTY every single record (tag)
2. Should be UNDO list - ability to go back to last SAVE point or similar.
3. Should be WARNINGS - BIG WARNINGS that can't be ignored, when ADDITIONAL records will be effected (e.g. clearing ALBUM ARTIST will clear ARTIST tags as well - PROCEED? WARNING, you will lost ARTIST tags!!!! <--- WARNING!!!!)

I'm pissed off because I've lost HOURS of my time because the program deleted records I did not want it to delete.

It seems some people know which fields will be affected by another field... I DON'T, so you HAVE TO TELL ME before I up another field I didn't want changed! Is that too much to ask???
Last edited by Lowlander on Sun Mar 04, 2012 4:39 pm, edited 1 time in total.
Reason: Merged with existing topic, removed cursing

nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Deleted ALBUM ARTIST and LOST ARTIST as well!

Post by nohitter151 » Sun Mar 04, 2012 1:50 pm

You can easily clear a single field for multiple tracks without any addon.

Just select all the files you want to change, right click > Properties > Delete the contents of the field and make sure the check box next to the field is checked, then hit OK.

If you have an issue with a particular add-on, you should post it in that thread.
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.

Lowlander
Posts: 46648
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by Lowlander » Sun Mar 04, 2012 4:42 pm

It seems from your previous posts that you should take your time to understand tools before using them and getting results you weren't looking for. Always make sure you understand what you're doing and test on a few files to make sure the desired results are achieved. It would save you some aggravation and not have you rant against people who provided tools for free.
Lowlander (MediaMonkey user since 2003)

ZvezdanD
Posts: 3098
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by ZvezdanD » Sun Mar 04, 2012 5:36 pm

Lowlander, I agree with everything that you wrote, but why did you move those posts to this thread? I cannot find in OP's posts any reference to this add-on except mentioning of some advanced find and replace thing. The OP is definitely not using this add-on since this add-on does not clear the Artist field when the Album Artist is specified, I just tested it and it works as expected. The only way to modify several fields at once using this add-on is if you specify "All Text Fields" in the Destination field, but I suppose that everyone should know what that means. Here is the excerpt from the What is new section of the first post about that option: "v4.2 - 2011-06-21
* Added: All Text Fields item to Into and From dropdown lists which allows assigning the same value to the several fields at once (with MM 3.1 or higher it could be specified which fields you want to modify using settings in the Search sheet of the Options dialog box; please be careful with that option, especially with the specified Path field!);"

If OP is really using this add-on, he/she obviously did not read the first post of this thread or would find this as well: "Beside of searching for some specific string, this add-on could be used to change data, so please be very careful. Make a backup of the database before any serious modification.".
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

gggirlgeek
Posts: 67
Joined: Mon Feb 11, 2008 4:24 pm
Location: Seattle, WA

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by gggirlgeek » Tue Mar 06, 2012 11:36 am

Just found the Quick Reference button. You're the best, ZvezdanD!

(For others - It's in the custom presets dialog box -- the button with a question mark.)
My current favorite software: MediaMonkey Gold!

Post Reply