Page 2 of 9

Case Sensitive

Posted: Sat Aug 11, 2007 6:13 am
by Skywave
Hi TrixMoto

Again... Awesome script!!!

But I have come across the problem of Case Sensitivity. I am happy to modify the script to ignore case... but I haven't a clue as to where you do your comparison. :(

I have tried UCase-ing the following line in the CountMatches procedure:

Code: Select all

      If UCase(arr1(i)) = UCase(arr2(j)) Then
But that didn't work.

Then I tried UCase-ing as in the following example

Code: Select all

  'process list
  For i = 0 To list.Count-1
    Call progtext("Stage 1/5: Item "&(i+1)&" of "&(list.Count)&"...",1)
    Set itm = list.Item(i)
    If done.Item(itm.ID) = "" Then
      done.Item(itm.ID) = "done"
      grp = UCase(itm.Title)
      If MatchTitle Then
        If Right(grp,1) = ")" Then
          Dim pos : pos = InStrRev(grp,"(")
          If pos > 0 Then
            temp = Mid(grp,pos+1,Len(grp)-pos-1)
            If IsNumeric(temp) Then
              grp = Left(grp,pos-1)
            End If
          End If
        End If
      End If
      Select Case MatchMode
        Case 1
          grp = UCase(grp&"+"&itm.ArtistName)
        Case 2
          grp = UCase(grp&"+"&itm.ArtistName&"+"&itm.AlbumName)
      End Select
      temp = grps.Item(grp)
      If temp = "" Then
        grps.Item(grp) = itm.ID
      Else
        grps.Item(grp) = temp&","&itm.ID
      End If
    End If
    If Progress.Terminate Then 
      Exit Sub
    End If
  Next
But that didn't work either... :(

If you could tell me where you do your comparison on Artist, Title and Album, I will modify my script for that and probably post it so that other users can use it until you have V3 (which I am sure will be A LOT better) when MM3 is released (or BETA).

Your help would be appreciated.

Skywave

Posted: Sun Aug 12, 2007 12:04 pm
by some1
I use this alot!

Posted: Mon Aug 20, 2007 10:36 am
by trixmoto
@some1 - glad you like! :)

@Skywave - there's some rather unconventional coding in here, but I blame the datatypes available in VBScript! I think the line you want to amend is line 235...

Code: Select all

temp = grps.Item(grp)
This is where the comparison string "grp" has been built and is checked against the list. So immediately before this line you'll want to do...

Code: Select all

grp = UCase(grp)
temp = grps.Item(grp)

UCase-ing

Posted: Mon Aug 20, 2007 10:41 am
by Skywave
Thanx trix. Works like a charm... :lol:

Problem with 'Left' in script

Posted: Fri Aug 31, 2007 10:17 am
by Guest
When I run this script I get an error:

Error #5 - Microsoft VBScript runtime error
Invalid procedure call or argument: 'Left'
File: "C:\Program files\MediaMonkey\Scripts\DuplicateReport.vbs", Line:580, Column:6

Left seems to be a valid call I think, any idea on why it doesn't like it? I'm pretty lame when it comes to VBScript, but to me your code looks right.

Posted: Mon Sep 03, 2007 3:24 am
by trixmoto
The only "Left" call in this line is that of DateAdded - have you blanked out these values for any reason?

Posted: Sun Oct 14, 2007 10:15 am
by trixmoto
Psyker7 wrote:Any chance of getting it to ignore blank titles? (ie unknown titles)
I'm not sure why you'd want to do this. You'd get any tracks in the album, or by the artist (depending on your settings) which have the same length. Maybe adding an option to use track instead of title would be better?

Posted: Mon Oct 15, 2007 5:14 pm
by trixmoto
New version (2.1) is now available to download from my website. Changes include...

- Added option to ignore case
- Added match mode of track number, artist and album
- Added option to merge dupes with keeps before deleting

The merge feature will check and if selected, then for any group which has dupes it will try to select a "recipient" track to merge with. If there is a single track in the group with "KEEP" then this will be selected, else if there's no KEEP tracks and a single "AUTO" track then this will be selected. If neither of these is true then a popup box will be displayed with a list of tracks to select.

All fields which are populated on the DUPE but not on the "recipient" will be copied across during the merge. The ratings will be averaged (if not unknown) and the playcounts will be summed. The play history and playlist entries will also be updated to the "recipient" track.

Posted: Sun Oct 21, 2007 7:55 am
by jury01
I'm not quite sure how this V2.1 works in case of merging!? What I need is an option to keep a selected track and to replace the DUPEs with this selected track but to keep the Tags of the DUPEs. Is this already realized? If not, is it possible?

Idea behind: Keep identical tracks for seperate Album Information..

Posted: Mon Oct 22, 2007 5:49 am
by trixmoto
Well this script does everything except replace the dupe tracks. It can leave them in place if you select "Flag" instead of "Delete" but it cannot replace them so that you have multiple copies.

Posted: Tue Dec 04, 2007 4:17 pm
by sommo
Thanks for this!

Remove the Dupe Flag

Posted: Fri Dec 21, 2007 9:56 am
by Lon
If I flagged some files as "Dupe". How would I remove the flag from the "Custom1" field?

Posted: Fri Dec 21, 2007 10:52 am
by trixmoto
Well if you don't want to do this manually then you could try my Clear Field script.

Thank You

Posted: Fri Dec 21, 2007 6:17 pm
by Lon
Thanks for the pointer to the "Clear field" script. Merry Christmas!!!!

script fail... errors sent to . wherever the email sends it

Posted: Sat Dec 22, 2007 7:01 pm
by Kevinowpb
but... wondering if anyone is getting them.

My dup report script ALWAYS crashes..
I get the same error, and the same debug/choose to send error via email.. etc..

Does anyone receive those? Is someone working on the errors that have been sent?

Should I post here?

Using MM 3.0 RC4 1120.. on XP and 2000 same externally networked shared drive with all the same mp3/music. about 18k songs/mp3s.. with a rather large report. It crashes whenever I click on FLAG or DELETE dups button after the report is generated (the bottom of the htm).