Duplicate Report 3.0 [MM2+3]

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Excellent, I'm glad to hear that! :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Psyker7
Posts: 255
Joined: Sat Mar 03, 2007 8:00 am

Post by Psyker7 »

Wow... you weren't kidding with fuzzy matching slowing things down.

17k songs and well... looks OK to start with but about halfway it was chugging about about 5 songs a second still on Stage 1 :P

Thanks for updating this to MM3 :D
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Well the more tracks you go through the more titles there are to match with so it will get exponentially slower until it finishes. If I have any bright ideas I'll try to speed it up, but it's always going to be a slow process.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Shadrax
Posts: 3
Joined: Mon May 19, 2008 2:32 pm

Post by Shadrax »

Thank you Trixmoto for all your scripts and work. Many of them are a life/timesaver for handling huge libraries.

I have zilch programming skills. Is there something I can put in the script to list the path/directory of each track on the duplicate report?
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Thanks! :)

You can add this field by opening "DuplicateReport.vbs" in a text editor and amending lines 422 and 650 - you want to add a column for "itm.Path".
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Skywave
Posts: 22
Joined: Sun Oct 15, 2006 5:40 am

Adding SongPath

Post by Skywave »

@Shadrax

If you want to add the Path of the song to the report, change line 651(?) from this:

Code: Select all

      Call fout.WriteLine("<tr id='"&itm.ID&"' name='grp"&i&"' class='"&temp&"'><td><a href='javascript://' onclick='play("&itm.ID&")'>"&MapXML(itm.Title)&"</a></td><td>"&MapXML(itm.ArtistName)&"</td><td>"&MapXML(itm.AlbumName)&"</td><td>"&gettime(itm.SongLength/1000)&"</td><td>"&Int(itm.Bitrate/1000)&"kbps</td><td>"&Left(itm.DateAdded,InStr(itm.DateAdded," ")-1)&"</td><td><a id=""a"&itm.ID&""" href=""javascript:toggle('"&itm.ID&"');"">"&temp&"</a><input id='i"&itm.ID&"' type='hidden' value='"&orig&"'></td></tr>") 
to this:

Code: Select all

      Call fout.WriteLine("<tr id='"&itm.ID&"' name='grp"&i&"' class='"&temp&"'><td><a href='javascript://' onclick='play("&itm.ID&")'>"&MapXML(itm.Title)&"</a></td><td>"&MapXML(itm.ArtistName)&"</td><td>"&MapXML(itm.AlbumName)&"</td><td>"&MapXML(itm.Path)&"</td><td>"&gettime(itm.SongLength/1000)&"</td><td>"&Int(itm.Bitrate/1000)&"kbps</td><td>"&Left(itm.DateAdded,InStr(itm.DateAdded," ")-1)&"</td><td><a id=""a"&itm.ID&""" href=""javascript:toggle('"&itm.ID&"');"">"&temp&"</a><input id='i"&itm.ID&"' type='hidden' value='"&orig&"'></td></tr>") 
Let me know if you need help with this :P

@trixmoto: maybe you could add this as an option for your next release?
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Thanks for your PM, I'll certainly put this option into the next version. :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Skywave
Posts: 22
Joined: Sun Oct 15, 2006 5:40 am

Some query open

Post by Skywave »

Hi trix

I tried running your script, but I got the 'some query open' error. I took out all my changes (thinking that I might have screwed it up), but it still gives the same problem...

And the offending line of code is.... (drum roll)
Line 773 (of the original release)

Code: Select all

Execute("itm."&KeepField&" = otr.className") 
Any ideas?
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Means SQL transactions are getting their wires crossed, I'll try to get it sorted in the next release. I think it's less likely to occur if you process a smaller number of tracks at a time.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Skywave
Posts: 22
Joined: Sun Oct 15, 2006 5:40 am

Post by Skywave »

I tried running it with only 4 selected tracks (wanting to delete 2 of them), but it still gives the error.

It says the running queries are "SELECT Id FROM Songs WHERE Id IN (82139, 72930, 49914) ORDER BY Bitrate DESC, DateAdded DESC"

I see that you have that specific query 3 times. Why is that?

Also, I've noticed that you never loop through the datasets returned from Database.OpenSQL, but only take the first record... Isn't there some function that should say "dbit.Close"? Alternatively, why not "SELECT TOP 1 Id FROM ...", and after getting your value, (and checking NOT dbit.EOF), do a dbit.Next? That should close the object...

I will try those, and see what happens.

Just thoughts
Skywave
Skywave
Posts: 22
Joined: Sun Oct 15, 2006 5:40 am

Post by Skywave »

Fixed it:

The script has to have the 'Set dbit = Nothing' after each of the OpenSQL statements, like below:

Code: Select all

'select best 
Set dbit = SDB.Database.OpenSQL("SELECT Id FROM Songs WHERE Id IN ("&mglist&") ORDER BY Bitrate DESC, DateAdded DESC") 
If Not dbit.EOF Then            
  best = dbit.StringByIndex(0) 
End If      
Set dbit = Nothing


'select best auto 
Set dbit = SDB.Database.OpenSQL("SELECT Id FROM Songs WHERE Id IN ("&aklist&") ORDER BY Bitrate DESC, DateAdded DESC") 
If Not dbit.EOF Then 
  aklist = dbit.StringByIndex(0) 
End If      
Set dbit = Nothing    


'select best from mode group 
Set dbit = SDB.Database.OpenSQL("SELECT Id FROM Songs WHERE Id IN ("&mglist&") ORDER BY Bitrate DESC, DateAdded DESC") 
If Not dbit.EOF Then 
  If Left(keep.Item(CStr(dbit.StringByIndex(0))),1) = "!" Then 
    keep.Item(CStr(dbit.StringByIndex(0))) = "!AUTO" 
  Else 
    keep.Item(CStr(dbit.StringByIndex(0))) = "AUTO" 
  End If              
End If          
Set dbit = Nothing
Sorry that I can't give line numbers, because my script has been modified. Although those lines should be in the high 600's, or low 700's...

[Edit]Correction. The lines would be high 500's to low 600's[/Edit]

PS. I still think it is an excellent script!!!

Reg'ds
Skywave.
Last edited by Skywave on Tue May 27, 2008 1:14 pm, edited 1 time in total.
Shadrax
Posts: 3
Joined: Mon May 19, 2008 2:32 pm

Post by Shadrax »

Thanks for both of your help, guys.
valessi

um . . .

Post by valessi »

I feel stupid saying this, but how do i run this script on MM?
drjboulder
Posts: 1119
Joined: Mon Apr 09, 2007 12:03 am
Location: Boulder, Colorado, USA

Post by drjboulder »

Well, I have not used this script for quite some time...
But, second sentence of first post in this thread:
trixmoto wrote: The idea is that you make sure all the tracks you want to process are in the main window, then click "File, Create Reports, Duplicate Report". You will be presented with an options screen...
Image
D Rock
Image
MediaMonkeyGoldv3.0.3.1183
Vista Home Basic|4thGen 20GPod
Zune Small Player Skin w/ Aqua 4 Player Mod
Backup | Last FM Node | Scrobbler DJ | TopTracks | StayInSameStyleDJ
RadioDJ | RadioFreeMonkey | PrettyPictures | MiniLyricsEmbedder
LyricsViewer | Lyricator | LyricsPlugin | VisualizationEmbedder | MonkeyRok
RightClickForWeb | WebSearchPanels | WebNodes | MagicNodes | FavoritesNodes
NowPlayingArtNode |AutoRateAccurate | TaggingInconsistencies
AdvancedDuplicateFind&Fix | CaseModify | PlayHistory&Stats | Etc...
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

New version (3.0) is now available to download from my website.

This script is now developed by Skywave!

Changes include...

- Added a menu item that will bypass the user interface and use the options from the last run
- Added header strip will change colour if you have clicked on any of the flags in that group
- Added user definable columns include songpath and filename
- Added option to look at duplicate content values instead of tags
- Fixed the 'some query open' error messages (in three places)
- Fixes the progress bar not disappearing after completion or cancellation
- Added option to use either the entire list or the user selection.

Thanks Skywave for all your hard work on this new version! :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Post Reply