Advanced Duplicate Find & Fix 3.8.2 (2014-01-27)

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

Moderators: Peke, Gurus

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

Auto Deletion

Post by Skywave »

Bex wrote:I don't know HTML enough to solve the task... :oops:
As far as I know you don't need HTML for deleting tracks.

I could probably help, but I seriously don't want to go through your entire script to figure it out.

If you could have the same Duplicate Selection that TrixMoto has in Duplicate Report, then most of the work is done. Then all you have to do is press a button (probably) and delete/move the selected tracks.

You could probably have a Context menu command on your Duplicates nodes (the same place you have "Add to OK") to delete/move the dupe. At that point in time, you determine which is the dupe... AND NUKE IT!!!

Again... just a thought. :)
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

To find and delete them is not a problem. But to present a report displaying all tracks with various smart options on which you can do your selections is a bit over my head at the moment. I will of course also implement optionally transfer playstat and perhaps even copy tags/albumart from the tracks you delete to the one you keep since that's the most basic part of this script.

However, trixmoto and I have some collaboration plans regarding this. We'll see what we come up with and when. But it won't happen until MM3 has its database structure set since a rather big rework of the script has to be done then.

I like your "move to a playlist before delete"-idea so it'll be implemented as well! :D
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
TJOHO
Posts: 112
Joined: Tue Oct 31, 2006 8:00 pm
Location: A Norwegian in Seoul, Korea

Post by TJOHO »

Hi,
I've used both this script and Tagging Inconsistencies on another PC which died on me. Various circumstances meant it took me quite a few months to get MM up again on another computer.

I just tried installing the latest versions of your scripts, but they throw the same error on startup:

Error # - 2147467259 - Microsoft JET Database Engine
(something in Korean about the file not being accessible, not sure about the exact wording...)
File: (path to your script) Line: 109, Column: 2 for this script, Line: 31, Column: 2 for Tagging Inconsistencies

Ideas?
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

That line is about connecting to the database through ADO. I guess there is a problem with your MDAC-installation. What OS do you have?

Edit.
Actually, when googling your error it seems that it means that the database isn't accesible, as you clearly state in your post.
So, is the db set to read only or did you have it open or anything like that?
Did you try a simple reboot?
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
TJOHO
Posts: 112
Joined: Tue Oct 31, 2006 8:00 pm
Location: A Norwegian in Seoul, Korea

Post by TJOHO »

Er... not set to read-only, and not open.

I tried restarting MM a couple of times, but didn't think to reboot the pc. I'll try that when I get to the office again on Monday.

Edit:
OK, so I thought I might as well try on the computer I have at home rather than wait until Monday. Same problem, but at least the OS is in English (it's XP) so I can get the error message verbatim.
Error # - 2147467259 - Microsoft JET Database Engine
Could not use "; file already in use.
File: (path to script), LIne: 109, Column: 2
This time I did reboot several times, and noticed something odd:

Background:
I have the database and all my music on an external HDD so I can use it on two different computers and still get play counts etc. Sometimes, when I start the computer and then start MM it doesn't find the database right away. I start MM, it starts as if it's the first time, then I close and restart, and it's fine. The problem is intermittent, can't really say why it happens.

This time, after installing the script:
1. Started MM. It did not find the database, so it started fresh, BUT it started the script just fine!
2. This gave me hope, so I just closed MM and restarted it. This time it was the opposite (normal :cry: ): it threw the error described, and had found the database just fine.
3. Rebooted the computer, then started MM. Same as #2; found the database but threw the error.

It seems that there is some conflict between my database and your script - they cannot peacefully coexist! :-?
Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky »

I just want say, that the copy tags/paste tags is awesome.. I was doing a little of my library clean up today and used it a few times to update some re-ripped albums from mp3 to flac, very awesome.

Thanks again.
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

@TJOHO
I have the database and all my music on an external HDD so I can use it on two different computers and still get play counts etc. Sometimes, when I start the computer and then start MM it doesn't find the database right away. I start MM, it starts as if it's the first time, then I close and restart, and it's fine. The problem is intermittent, can't really say why it happens.
That should explain why the script doesn't find your database too. The line of code that gives you trouble is only there to prevent a rare SQL-error.
You can remove it and if you get "phntmpids already exists" -error simply press ignore.
1. Remove all code from line 101 to 150 but leave the four SDB.Database.ExecSQL intact.

2. Remove all code from line 1486 to 1511 but leave the six SDB.Database.ExecSQL intact.

@Teknojnky
Thanks for the nice word!
:D
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Diabolic-Destiny
Posts: 223
Joined: Sun Apr 29, 2007 9:45 pm

Post by Diabolic-Destiny »

im assuming this isn't yet compatible with MM3
Image
Image
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

Not yet. I'm waiting for MM3's database structure to be set.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
TJOHO
Posts: 112
Joined: Tue Oct 31, 2006 8:00 pm
Location: A Norwegian in Seoul, Korea

Post by TJOHO »

Thanks for your help (and patience!), but that didn't work - assuming I've trimmed the script correctly, that is.

If I understand the (Korean) error message right, it's something like:
Error #1024 VBScript compilation error.
End sub.
(path to script) Line: 284, Column: 0
The two places I trimmed now look like this (I included some of the surrounding code for context):

Code: Select all

'  - Displays folders containing tracks that are not analyzed for duplicate content
'///////////////////////////////////////////////////////////////////////////////////////////////////////////////
    SDB.Database.ExecSQL ("CREATE TABLE TmpAFF1 (Sign1 integer, Sign2 integer, Sign3 integer, Sign4 integer, "&_
                          "IdCount integer, CONSTRAINT Index1 UNIQUE(Sign1, Sign2, Sign3, Sign4))")
    SDB.Database.ExecSQL ("CREATE TABLE TmpAFF2 (tmpcount integer, tmpidartist integer, tmpTitle Text(200), "&_
                          "tmpAlbum Text(200), tmpFile Text(200), tmpLength Text(10), tmpSize double, "&_
                          "tmpBitrate integer, tmpFiletype Text(10), tmpAlbidartist integer, tmpBPM integer, "&_
                          "tmpYear integer, tmpGenre integer, tmpSongOrder integer, tmpAuthor Text(200), "&_
                          "CONSTRAINT Index1 UNIQUE(tmpidartist, tmpTitle, tmpAlbum, tmpLength, "&_
                          "tmpSize, tmpFile, tmpBitrate, tmpAlbidartist, tmpBPM, tmpAuthor))")

    SDB.Database.ExecSQL ("CREATE TABLE TmpAFFFile (tmpfid integer UNIQUE, tmpfname Text(200))")
    SDB.Database.ExecSQL ("CREATE TABLE SkipInDuplFind (SkipId integer, DupNodeID integer, S1 integer, S2 integer, "&_
                          "S3 integer, S4 integer, CONSTRAINT Index2 UNIQUE(SkipId, DupNodeID))")

  
  'Save Default Values to INI file
  Dim ini : Set ini = SDB.IniFile
and this

Code: Select all

End If
End Function

Sub PerformTasksOnShutdown
   SDB.Database.ExecSQL ("DELETE SkipInDuplFind.* FROM SkipInDuplFind LEFT JOIN Songs ON "&_
                         "SkipInDuplFind.SkipId = Songs.ID WHERE Songs.ID Is Null")
         SDB.Database.ExecSQL ("DROP TABLE TmpAFFFile")
         SDB.Database.ExecSQL ("DROP TABLE TmpAFF2")
         SDB.Database.ExecSQL ("DROP TABLE TmpAFF1")
         SDB.Database.ExecSQL ("DROP TABLE TmpAFFSedSongs")
         SDB.Database.ExecSQL ("DROP TABLE TmpAFFSearchRes")
End Sub

Sub FindMoreFromSame(x)
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

This should do it:

Code: Select all

'  - Displays folders containing tracks that are not analyzed for duplicate content
'///////////////////////////////////////////////////////////////////////////////////////////////////////////////
Option Explicit
Dim node3000Addsql,DropDownTxtFld1(3),DropDownTxtFld2(2),DropDownNrFld1(5)
Public styleOn
'Dim DDSelArtist(10)
Sub OnStartup
    SDB.Database.ExecSQL ("CREATE TABLE TmpAFF1 (Sign1 integer, Sign2 integer, Sign3 integer, Sign4 integer, "&_
                          "IdCount integer, CONSTRAINT Index1 UNIQUE(Sign1, Sign2, Sign3, Sign4))")
    SDB.Database.ExecSQL ("CREATE TABLE TmpAFF2 (tmpcount integer, tmpidartist integer, tmpTitle Text(200), "&_
                          "tmpAlbum Text(200), tmpFile Text(200), tmpLength Text(10), tmpSize double, "&_
                          "tmpBitrate integer, tmpFiletype Text(10), tmpAlbidartist integer, tmpBPM integer, "&_
                          "tmpYear integer, tmpGenre integer, tmpSongOrder integer, tmpAuthor Text(200), "&_
                          "CONSTRAINT Index1 UNIQUE(tmpidartist, tmpTitle, tmpAlbum, tmpLength, "&_
                          "tmpSize, tmpFile, tmpBitrate, tmpAlbidartist, tmpBPM, tmpAuthor))")

    SDB.Database.ExecSQL ("CREATE TABLE TmpAFFFile (tmpfid integer UNIQUE, tmpfname Text(200))")
    SDB.Database.ExecSQL ("CREATE TABLE SkipInDuplFind (SkipId integer, DupNodeID integer, S1 integer, S2 integer, "&_
                          "S3 integer, S4 integer, CONSTRAINT Index2 UNIQUE(SkipId, DupNodeID))")

 
  'Save Default Values to INI file
  Dim ini : Set ini = SDB.IniFile 
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
TJOHO
Posts: 112
Joined: Tue Oct 31, 2006 8:00 pm
Location: A Norwegian in Seoul, Korea

Post by TJOHO »

It did indeed do it! :lol: :lol:

Thank you so much, Bex, this script is so necessary it should be built in.
I had almost given up and dreaded going into the database to change play counts and do all the other stuff this script does, manually. :cry:

Now I'm a happy dupehunter again!
___
Edit:
All the new functionality throws database errors, but I don't mind. I'm just happy to have the old functionality, and this is probably too marginal a problem for you to waste time on.
TJOHO
Posts: 112
Joined: Tue Oct 31, 2006 8:00 pm
Location: A Norwegian in Seoul, Korea

Post by TJOHO »

I've been meaning to ask about a feature request for this script, though.

I often search for songs that are not true dupes (early demo version versus single version versus album version, live versions, etc.), so that I can consolidate their play counts and what playlists they belong to. I then use either the comment field or a custom field to mark the "non-standard version" as Live, Remix, etc., and use MagicNodes and autoplaylists to keep track of what's what.

This means that when I do a custom search, I get a lot of results I have already processed in this manner, because the custom search has to be pretty broad (same artist and title).

OK, that was a long backstory, now for the request: Is it possible to add an exclusion (or sets of exclusions) to the custom search?
For example: "Do not include tracks with this in the comment field: (input box where I can write "Live" to exclude all the live tracks)"
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

Glad you got it working!
To make the database errors go away, or at least keep them at a minimum, remove these lines:
In the first sub: (The code can be removed since you already have the table created.)

Code: Select all

    SDB.Database.ExecSQL ("CREATE TABLE SkipInDuplFind (SkipId integer, DupNodeID integer, S1 integer, S2 integer, "&_
                          "S3 integer, S4 integer, CONSTRAINT Index2 UNIQUE(SkipId, DupNodeID))") 
In the second sub: (These drop table statemants are redundant.)

Code: Select all

         SDB.Database.ExecSQL ("DROP TABLE TmpAFFSedSongs")
         SDB.Database.ExecSQL ("DROP TABLE TmpAFFSearchRes") 
In MM3 this error will vanish. SQLite has a built in function to check if a table exists before you create it. (CREATE TABLE IF NOT EXISTS)

Regarding your request. Will an OK-list solve the problem? I'm planning to add such function in the Custom search. (In MM3 that is.)
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
TJOHO
Posts: 112
Joined: Tue Oct 31, 2006 8:00 pm
Location: A Norwegian in Seoul, Korea

Post by TJOHO »

Yep, no errors! Great, thanks.

The OK list would do just fine, too. Looking forward to the MM3 version!
Post Reply