Duplicate Content

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Mon Apr 24, 2006 5:30 pm

Ok, this looks like the OP acquired a library of songs from a friend (or an older backup) which contained a large amount of previously shared files (duplicates).

This isn't exactly what I need at this point, but would have been good in the past (and who knows maybe the future too).

I tried adding the tables/queries as indicated, and of course I changed the paths to my library but I could not get it to work properly, MN gives a bunch of odbc and other errors.

Basically what I want to accomplish is an improved 'duplicate content' node where it functions like a normal node where you select all files and expand out artist/albums etc and perform the normal rename/organize/tag operations.

Instead of the existing 'duplicate content' node which does not function in a worthwhile way, it by itself is not very helpful.

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

Post by Bex » Mon Apr 24, 2006 6:08 pm

Ok here we go!

This will give you a fast Magic Node which give you all your "Duplicate Content" tracks so you easy can access all of them in one go.

1. First create a select query by pasting this code into the sql view of an Access query:

Code: Select all

SELECT Songs.SignPart1, Songs.SignPart2, Songs.SignPart3, Songs.SignPart4
FROM Songs
GROUP BY Songs.SignPart1, Songs.SignPart2, Songs.SignPart3, Songs.SignPart4
HAVING (((Songs.SignPart1)<>0) AND ((Songs.SignPart2)<>0) AND ((Songs.SignPart3)<>0) AND ((Songs.SignPart4)<>0) AND ((Count(Songs.ID))>1));
Save it as DupContent1

2. Create a "make table" query from this code:

Code: Select all

SELECT Songs.ID INTO DupContent
FROM DupContent1 INNER JOIN Songs ON (DupContent1.SignPart4 = Songs.SignPart4) AND (DupContent1.SignPart3 = Songs.SignPart3) AND (DupContent1.SignPart2 = Songs.SignPart2) AND (DupContent1.SignPart1 = Songs.SignPart1)
GROUP BY Songs.ID;
Save it as DupContent3

3. Run the make table query (DupContent3). Close it and open up the newly created DupContent table in design view and add a key to the ID field.

4. Open the DupContent3 query in design view and change the query type to Append query. (Query -> Append Query, hit OK and save.)

5. Create a new delete query from this code:

Code: Select all

DELETE DupContent.*
FROM DupContent;
Save it as DupContent2

Now you will have three queries:
- DupContent1, which is nested into DupContent3
- DupContent2, which deletes all data in table DupContent
- DupContent3, which adds new data to table DupContent
And one new table:
- DupContent, which is indexed on field ID
(The reason for having one delete and one add query is that we want to keep the key in the table DupContent which wouldnt be the case if we only used one make table query instead.)

Create a new Magic Node:

Code: Select all

Duplicate Content|SQL filter: songs.id in (select id from DupContent)\<Artist>
This Magic Node is fast! 8)

The downside is that you MUST run the DupContent2 and DupContent3 queries everytime you add or delete tracks in MM.
This could however be simplified by creating an Access Macro:
- SetWarnings = no
- OpenQuery DupContent2
- OpenQuery DupContent3
Save it as MacroDupContent
The macro is executed in 3 sec!

Enjoy!
/Bex
Last edited by Bex on Tue Apr 25, 2006 4:45 am, edited 2 times in total.
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

Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Mon Apr 24, 2006 6:26 pm

Bex wrote:3. Run the make table query (DupContent3). Close it and open up the newly created DupContent table in design view and add a key to the ID field.
I kept getting an error about duplicates when attempting to save the table with the key.
4. Open the DupContent3 query in design view and change the query type to Append query.
Sorry I'm not quite SQL literate, how do I change the type to "Append"?


Now you will have three queries:
- DupContent1, which is nested into DupContent3
- DupContent2, which deletes all data in table DupContent
- DupContent3, which adds new data to table DupContent
And one new table:
- DupContent, which is indexed on field ID
I now have all that + the macro, but I am unable to set the KEY on the DupContent Table.

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

Post by Bex » Mon Apr 24, 2006 7:49 pm

I've updated the instructions so it should work now.
- Replace the the make table query with the updated code and run the query again. Say yes to delete the existing table.
- Add the key to the table. It should work now.
- Change query type. Goto Query -> Append Query, hit OK and save.
- Test the Magic Node.

It works now, doesnt it?

/Bex
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

Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Mon Apr 24, 2006 9:31 pm

Nope, I had deleted the table and 3 queries and re-did everything step by step as your post says.

Now I get 'could not find output table 'dup content'.

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

Post by Bex » Tue Apr 25, 2006 4:47 am

Oh sorry I did a miss. Now it should work.

/Bex
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

Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Tue Apr 25, 2006 10:08 am

Yay! Got it to work, Thanks Bex!

That works very fast!

Now, the only issue I see is when tracks are not named properly and show up as different artists... then you have single tracks under the artist node but not know which tracks are duplicates of each other.

Not sure how to view that unless there can be a 'signature' node.

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

Post by Bex » Tue Apr 25, 2006 11:18 am

Perhaps just click on the "Duplicat Content" node so you get all dups in the window and then sort on lenght?
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

Teknojnky
Posts: 5537
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Tue Apr 25, 2006 11:36 am

Yea that might work.

Another question (I know I'm full of them!)..

Is it possible for magicnodes to call a macro to update the query/table automatically?

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

Post by Bex » Tue Apr 25, 2006 12:33 pm

I'm not a scripter so I really dont know. But I think it's not.

One thing that should work though is to create a script that deletes the data and appends new data to an indexed table which you then use in a magic node. Psyxonova was in to that but never finnished it.

Perhaps some other good scripter can create such script.

Anyone?

/Bex
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

Post Reply