Page 5 of 9

Posted: Sat Apr 19, 2008 3:39 am
by trixmoto
Excellent, I'm glad to hear that! :)

Posted: Sun May 11, 2008 3:50 am
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

Posted: Sun May 11, 2008 5:49 am
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.

Posted: Mon May 19, 2008 2:39 pm
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?

Posted: Tue May 20, 2008 3:24 am
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".

Adding SongPath

Posted: Sat May 24, 2008 2:47 am
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?

Posted: Sat May 24, 2008 4:10 am
by trixmoto
Thanks for your PM, I'll certainly put this option into the next version. :)

Some query open

Posted: Sat May 24, 2008 5:11 am
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?

Posted: Sun May 25, 2008 4:53 am
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.

Posted: Sun May 25, 2008 5:46 am
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

Posted: Sun May 25, 2008 6:04 am
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.

Posted: Tue May 27, 2008 1:04 pm
by Shadrax
Thanks for both of your help, guys.

um . . .

Posted: Sat May 31, 2008 9:53 pm
by valessi
I feel stupid saying this, but how do i run this script on MM?

Posted: Sat May 31, 2008 11:21 pm
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

Posted: Sun Jun 01, 2008 3:46 am
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! :)