how to delete duplicated songs all at one time?
I would like to get help deleting duplicated songs, I do not know how they got their in the first place.
Windows 7
I would like to get help deleting duplicated songs, I do not know how they got their in the first place.
Windows 7
iTunes has two modes for displaying duplicates. The first is accessed via File > Display Duplicates and lists all tracks in the current playlist where the same track title occurs more than once. This is, more often than not, a rather loose definition of the term and can bring back obviously different songs, e.g. studio and live versions of the same song, the same song recorded by different artists, or by the same artist but on different albums, or completely different songs that have nothing in common but their title.
A more useful feature can be found if you hold down the SHIFT key and then select File > Display Exact Duplicates. This gives a list of all tracks where more than one track has essentially the same metadata, name, track no., artist, album, etc. (I'm not sure what the exact criteria are for an exact duplicate as far as iTunes is concerned, but it's good enough for most needs).
There are three types of files that can show up as exact duplicates:
Note you could also have files which have the same audio data but different metadata, e.g. the same album ripped twice but with a slightly altered album title, however there isn't an obvious way to highlight these within iTunes.
Once you have used the Show Exact Duplicates feature you can set about deleting all but one copy of each duplicate file. If all the duplicates have recently been added into your library then you could sort the list on the date added column, select a range of tracks with SHIFT-click and delete all the recent entries. If the duplicates have been added into the library at various times then sort the list by album or track name, select all but one of each group of matching tracks with CTRL-click and delete the selection. Probably best to work one screenful at a time.
Of course the issue isn't quite as simple as it seems. If the duplicates are of type 1 then you want to delete the tracks from the library, but not delete or send the underlying files to the recycle bin as there is only one copy of each file referenced by the duplicate entries. For tracks of type 2 you do want to delete the duplicate physical copies leaving one remaining version. For files of type 3 you probably want to decide which of the two or more copies you want to keep, the smallest to take up less room, the largest because it is the best quality, the MP3 version because it is the most portable or more than one because each has their uses for you.
By now you should have some idea of why deduping is not a trivial issue. Of the three types I have described it turns out that cleaning up type 1 duplicates is quite easy to automate. I've written a script called DeDuper which can go through a selection of tracks, spot those with the same path and remove the redundant entries. As a bonus it retains the entry with the earliest date added value, adds in the play & skip counts from the deleted entries and sets the last played/skipped dates to their most recent values. Although the script would work on the whole library it will be much more efficient to use the iTunes Show Exact Duplicates tool before running the script. You should also backup your library or, at the very least, the iTunes database iTunes Library.itl before running the script. Chances are you have type 2 duplicates and the script is of no use to you in its present form...
I hope to extend the script over the next few days to cope with type 2 and type 3 duplicates, ideally making the distinction between the two types, handling type 2 automatically (hopefully moving the removed files to somewhere they could still be restored from if required) and prompting for the user to choose which file to keep in the case of type 3. Again metadata would be merged. Hmm, just realized I need to do something about rating too.
tt2
I haven't managed to get the archiving routine working yet, but something clicked while I was thinking about the problem. I've a feeling I solved it before for someone else by changing the way the file is deleted. The attempt to delete files into the recycle bin essentially emulates deleting a file via Windows Explorer, but it we're not interested in saving them then a straight file system delete command should go through unchallenged. I've added a new control variable UseTrash which is currently set to true so that most users get the protection that it provides. Download a fresh copy of the script and change the line (currently line 137) that reads:
UseTrash=True ' Attempt to send local deleted files to trash
to
UseTrash=False ' Attempt to send local deleted files to trash
Then save the edited script and run that... Usual caveats about having a backup and testing on a small group first.
tt2
Chris1955 wrote:
Thanks for your script. It helped me get out of the mess I had created. You are a genius ! Is there a similar script or Program that works in Mac ?
Try Dupin or Dupin Lite from Doug's Scripts.
tt2
DeDuper took forever (days) because of the massive number of duplicates I had, but it worked like a charm - still no progress bar but not complaining. Thanks for your time, expertise and the new control variable! It's people like you who share their talent on the net that makes the lives of people like me a little easier.
I owe you a beer but it may have to be a virtual one.
Take care!
Hello all.
I'm having the same issue reported back in 2011, and have had trouble figuring out which is the original file after several backups; many of the file in my Itunes media library effectively do not exist - they have no physical location on my hard drive, but Itunes thinks they are there. It sounds like dedupe is the anwer, but i'm not tech savvy enough to know how to use a script, and can't find anywhere that's not a spamming site, or one that wants to charge you $30 for the privelege of using free software.
So how do I use a script, or where can I download dedupe for a reasonable amount?
This has been a problem i've been trying to solve for years through painstaking song by song deletion, so help is much appreciated.
I don't see a Kind column, and my library has only music and a few podcasts. With your explanation, I need to look at my NAS and find out how permissions are controlled. I just noticed that the iTunes folder doesn't have the usual Windows folder Properties | Security tab. However, I have full access to the NAS share, and I can add to the iTunes library, so I wouldn't have thought security permissions was a problem.
Regards,
TomQA
The script runs without a progress bar which doesn't bother me but when I go to delete the files it only deletes 997 at a time. I then have to run the script again and the same result happens...
Any help would greatly be appreciated...
TT2,
Sorry my whole question didn't post.
As far as the error, the script would run just fine and show me all of the duplicates. However when it went to send them to the recycling bin it would only send 997 items. I just ran the script multiple times until the duplicates were under 997 items, still made it a lot easier. Thanks for being so quick to respond...
OK, I've been struggling with this for ages, if someone posted a solution or a similar solution, i apologize, but I didn't want to read the whole post, i just wanted to share this solution for any who struggled with duplicates as i have.
THIS SOLUTION WORKS, IS EASY AND COST NOTHING.
1) First up, back up all your audio to a separate folder (not necessary, but always safe).
* If you have multiple locations where you added songs from, you can consolidate iTunes media to get them all in one folder then back the music in the iTunes Audio Folder, or manually cut and paste all music into one single library (easy to find location of your choice, I'm on PC so I stuck with my music) as i did*
2) Download iTunesDSM which can be found here, http://itunesduplicatesongmanager.blogspot.ca/
3) Open iTunes, go to edit, preferences, advanced, and under iTunes media folder, change location to an empty folder anywhere (create one if need be)
4) In iTunes, click on songs, select all, delete. (this will delete the song from iTunes but not from the save location)
5) Close and open iTunes, (not necessary, but recommended)
6) Go to edit, preferences, advanced, and under iTunes media folder, change the folder to your library (sometimes this won't work, if this doesn't work here's a workaround, Go to File, add folder to library, and once all the songs are added, you can change the folder in preferences) wait till all songs are added.
*These above steps ensure that you do not have any duplicated media due to the date added duplicating issue*
7) Open iTunesDSM.
8) Click on options, add directory, and locate the music library you are using for iTunes.
9) Click Select All, enable the options of "backup selected duplicates to a folder" (make a temp folder on the desktop and use that, this is not necessary, but just to be safe) and the option "delete selected duplicates from music folder.
10) Click Clean Duplicates. (This may take several minutes if you are backing up the duplicates.
11) Once that is complete, Click Remove Orphaned Track. (gets rid of all those annoying songs with an exclamation next to it.
12) Close and open iTunes, then hold shift and click view, show exact duplicates. There should now be none, if there are any, it should be the odd few that you can manually delete.
*If any duplicates re-appear you can repeat steps 7-12 since and just save the back up of the library if you have the space*
The DeDuper script solution being discussed in this thread also works, costs nothing, is easier to use, and unlike the one you suggest preserves/merges ratings, played/skipped counts/dates, playlist membership and original date added values.
But then I'm slightly biased since I wrote it. 😉
tt2
Hi,
I'm getting an error when I run the DeDuper script;
Pass 3, processing 16,701 of 26,729
Scanning for physical duplicates
Script: M:\<folder name>\DeDuper.vbs
Line: 614
Char: 18
Error: The track is not modifiable.
Code: A0040203
Source: (null)
My song files are on a NAS, and I'm getting the error when I selected ALL on the Exact Duplicates list. I tried the script on a much smaller group and it worked fine. I moved the .vbs file off the NAS before running it, but same error.
Any ideas?
many thanks for your work.
Not sure what that is about, but I've added a little error trapping code around that statement. Should you get an error again it may become clear which track is being processed when it occurs. With luck there will some feature of the file which will explain the cause.
tt2
Thanks for the response.
I don't know if you updated the script where we can download it (http://samsoft.org.uk/itunes/DeDuper.vbs still shows 1.0.2.5 - June 29th 2014 as the latest version) but I ploughed on anyway.
the problem track is somewhere in the "J"s; given that the error appeared at "243 of 345" I guessed that it had to be the 243rd song title beginning with J. But even after deleting +/- 10 tracks either side of the suspect, I get the same error running the script; no new information than in my original post BTW.
Does the script examine tracks in alphabetical order?
Clear your browser's cache and try again. It should be labelled Version 1.0.2.6 - October 7th 2014.
Processing order in my scripts is normally in reverse order of the tracks as shown in the display (this prevents certain kinds of errors) but one should not assume that iTunes will give them to the script in precisely that order.
tt2
Had the same problem as tomQA. Fixed permissions and unchecked read-only boxes and it worked perfectly!
You sir are my hero! thank you very much. I made an an account for apple support just to tell you how grateful I am 🙂 quest
just one question (I had 2 but already forgot the details of one)
During the deletion process it asked me around 5 times or so whether I would like to delete a song permanently, not sure why it did, but it didn't make a difference for me.
Thanks again for you're great work!
Hi tt2,
I'm not sure if you remember me from a few months back, but would like to seek your help again.
I downloaded the latest version of DeDuper and changed the line "UseTrash=True" to "UseTrash=False" to avoid having to click "ok" for each deletion request. However, I received the following runtime error during the scripts deletion phase.
---------------------------
Windows Script Host
---------------------------
Script: C:\Users\johng_000\Downloads\DeDuper (1).vbs
Line: 687
Char: 5
Error: File not found
Code: 800A0035
Source: Microsoft VBScript runtime error
---------------------------
OK
---------------------------
Can you help?
how to delete duplicated songs all at one time?