For some reason Windows Media Player does a very bad job of keeping unique files unique in their automatic playlists, as the image in the link shows. WMP snapshot showing 8 dupes of Bronski Beat - Small town boy:

The file is not duplicated in the library as the next image shows:

Finally, these are the criteria used to create the automatic playlist taken from the wpl file, since the app freezes if I try to bring up the playlist creation wizard.
<?wpl version="1.0"?>
<smil>
<head>
<meta name="Generator" content="Microsoft Windows Media Player -- 12.0.19041.3570"/>
<title>Favorites</title>
</head>
<body>
<seq>
<smartPlaylist title="Favorites">
<querySet>
<sourceFilter id="{4202947A-A563-4B05-A754-A1B4B5989849}" name="Music in my library">
<fragment name="Genre">
<argument name="condition">Contains</argument>
<argument name="value">Favorite</argument>
</fragment>
<fragment name="Keyword Search">
<argument name="condition">Does Not Contain</argument>
<argument name="value">Favorite\Easy</argument>
</fragment>
<fragment name="Keyword Search">
<argument name="condition">Does Not Contain</argument>
<argument name="value">iPhone</argument>
</fragment>
</sourceFilter>
</querySet>
</smartPlaylist>
</seq>
</body>
</smil>
I tried a few ways to delete these dupes with Python using the WMP API but none worked (deleting the files and readding doesn't work, they become duplicated again). I've tried a bunch of other approaches with no luck. Recreating the music library is not good at all, it takes too long (large music collection) and the problem comes back. Any ideas?