Playlists are scanned to Library - thus dublicating songs/albums
#1
When updating the music libraries, all the playlists are also being scanned. This creates duplicates in my library since the playlist are songs from the library.  How are scanning the playlists to library stopped or removed from scan action?

I believe the action that started the scanning of all the playlists to the music library occurred was my action (accidentally) in the music playlist menu, selecting "+newplaylist", holding down selection key on remote, then the option appeared"scan to library". So now, the libraries are always scanned during an update.

Environment
Platform : Android TV
Skin: Estuary
Reply
#2
I am a bit amazed that it is scanning inside .m3u files and adding items to the library, is that what you mean?

I know that it isn't as easy on Android, but could you possibly upload your music database (MyMusicXX.db in userdata/ldatabase) to the cloud and PM me a link to it so I can have a look at what you have done.
Reply
#3
Well, well, well. Isn't that a strange bug.

I was able to reproduce that.

@buddiemac No need to supply any information. We are able to reproduce it easily. It is strange no-one has stumbled across this before.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki) || Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#4
(2020-11-21, 21:37)Karellen Wrote: Well, well, well. Isn't that a strange bug.

I was able to reproduce that.

@buddiemac No need to supply any information. We are able to reproduce it easily. It is strange no-one has stumbled across this before.
Karellen -

What I did to resolve my issue:
1) backed up the music database,
2) opened the database in database viewer editor,
3) then, I made a view for albums and then deleted the high numbered Album IDs that were duplicated.
4) restored my database (backup addon) to Kodi,
5) Within Kodi cleaned Library and updated library.

All was good after that. The trick was to know the lowest number Album ID that contained a duplicate and then delete all ID => than that ID.

Just note, the menu selection for newplaylist or newsmartplaylist, when selecting these, and then selecting add to library, those actions will add ALL PLAYLIST to the library! And that is what I did!
Reply
#5
Dave,

Thanks for your reply - please see the following posts. I believe is has been duplicated by another community member. I am not sure if Kodi uses .m3u files for playlists.
Reply
#6
(2020-11-21, 22:09)buddiemac Wrote: What I did to resolve my issue:
1) backed up the music database,
2) opened the database in database viewer editor,
3) then, I made a view for albums and then deleted the high numbered Album IDs that were duplicated.
4) restored my database (backup addon) to Kodi,
5) Within Kodi cleaned Library and updated library.
Great that you were able to resolve that, but that is not a method I would recommend at all. There are too many relationships for that simple approach to work correctly. I imagine that will cause you other problems at some stage.

Having tested a bit more, the following is the safest method:
1. Export your Song playback history to a Single File using Kodi's built in Export feature.
2. Music>Files - remove all your sources and answer Yes to "Do you want to remove all items within this path from your library"
3. At this point you have removed all your music including the duplicates, but the Playlist paths are still in the database and will still cause you problems
4. Run a Clean Library - This is what will prevent the future duplication, otherwise the problem will continue
5. Add back your Sources and import the playback history.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki) || Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#7
(2020-11-21, 22:23)Karellen Wrote:
(2020-11-21, 22:09)buddiemac Wrote: What I did to resolve my issue:
1) backed up the music database,
2) opened the database in database viewer editor,
3) then, I made a view for albums and then deleted the high numbered Album IDs that were duplicated.
4) restored my database (backup addon) to Kodi,
5) Within Kodi cleaned Library and updated library.
Great that you were able to resolve that, but that is not a method I would recommend at all. There are too many relationships for that simple approach to work correctly. I imagine that will cause you other problems at some stage.

Having tested a bit more, the following is the safest method:
1. Export your Song playback history to a Single File using Kodi's built in Export feature.
2. Music>Files - remove all your sources and answer Yes to "Do you want to remove all items within this path from your library"
3. At this point you have removed all your music including the duplicates, but the Playlist paths are still in the database and will still cause you problems
4. Run a Clean Library - This is what will prevent the future duplication, otherwise the problem will continue
5. Add back your Sources and import the playback history.
Karellan,

When performing your suggested method, will the song ratings be preserved that I have added within Kodi? Are the song ratings (not the rating within ID tag meta data) which are added with Kodi added into the database? The song playback history, is this data separate from the database or is part of the database? Can you please elaborate on what is the source of "song play back history"? Thank you for your help.
Reply
#8
@buddiemac Karellen and I work together (allowing for a big time zone difference) so you can talk to us in together.

"Scan Item To Library" should not be appearing on the context menu for any items on the music playlists node, and is something I will fix. It just happens you are the first person to report what happens when you click on it, well done!

Since you are happy meddling in your db then deletion of records from album table as you have done will clear up most of what was added (ondelete triggers fire to remove related records in other tables). However that path table will still hold entries. The cleaning that you then did within Kodi from system > settings > media > library should have sorted that out, but it could be worth looking at the path table.

So I think what you did was succesfull, and no need to follow the steps Karellen gave you, although generally I would not advocate users mess with their data unless they have some idea what they are doing.

You then ask about song playback history, and I will answer just for your knowledge.

(2020-11-22, 05:59)buddiemac Wrote: When performing your suggested method, will the song ratings be preserved that I have added within Kodi? Are the song ratings (not the rating within ID tag meta data) which are added with Kodi added into the database? The song playback history, is this data separate from the database or is part of the database? Can you please elaborate on what is the source of "song play back history"?
From v18 it is possible to export the "song playback history", that is the transient song data - user rating (added via Kodi UI), last played date, play count - that is not stored in the music files themselves and would otherwise be lost when a music source is removed from the library and related records deleted from the database. It is also a way to transfer that transient data from one Kodi installation to another where for one reason or another you have not been able to copy the database itself.

Unlike video, exporting the music library is about making a copy of the additional artist and album data that was fetched by scrapers or edited by addons, and the transient song data. It is not a backup, just copy the MyMusicXX.db file for that. But having the export means that you can then recreate your library, by scanning the music files, and then apply the additional data without remote scraping and restore the song playback history.
Reply
#9
(2020-11-22, 12:30)DaveBlake Wrote: @buddiemac Karellen and I work together (allowing for a big time zone difference) so you can talk to us in together.

"Scan Item To Library" should not be appearing on the context menu for any items on the music playlists node, and is something I will fix. It just happens you are the first person to report what happens when you click on it, well done!

Since you are happy meddling in your db then deletion of records from album table as you have done will clear up most of what was added (ondelete triggers fire to remove related records in other tables). However that path table will still hold entries. The cleaning that you then did within Kodi from system > settings > media > library should have sorted that out, but it could be worth looking at the path table.

So I think what you did was succesfull, and no need to follow the steps Karellen gave you, although generally I would not advocate users mess with their data unless they have some idea what they are doing.

You then ask about song playback history, and I will answer just for your knowledge.
(2020-11-22, 05:59)buddiemac Wrote: When performing your suggested method, will the song ratings be preserved that I have added within Kodi? Are the song ratings (not the rating within ID tag meta data) which are added with Kodi added into the database? The song playback history, is this data separate from the database or is part of the database? Can you please elaborate on what is the source of "song play back history"?
From v18 it is possible to export the "song playback history", that is the transient song data - user rating (added via Kodi UI), last played date, play count - that is not stored in the music files themselves and would otherwise be lost when a music source is removed from the library and related records deleted from the database. It is also a way to transfer that transient data from one Kodi installation to another where for one reason or another you have not been able to copy the database itself.

Unlike video, exporting the music library is about making a copy of the additional artist and album data that was fetched by scrapers or edited by addons, and the transient song data. It is not a backup, just copy the MyMusicXX.db file for that. But having the export means that you can then recreate your library, by scanning the music files, and then apply the additional data without remote scraping and restore the song playback history.
Dave - Thanks for the update - I actually do not like messing with the db, but since I have spent so much time on adding ratings and scrapping, I did not want to lose that effort over the months. I depend on rating for my smart playlists which I believe is one of the best features in Kodi. Modifying db was my last resort!

So now I understand, the scanning the file sources will recreate or update the library with the music embedded meta-data tags and the importing of the "song playback data" will add the scrapper and user rating (transient data) to the library database - got it - thanks.

Just to note on another post, I posted an issue with Kodi and IPV4 for network credentials for the gateway address when the network has IPV6 enabled. In the post, I believe I have the possible "why". Possibly, you know the right persons that handle the networking reporting within Kodi?

So now I understand, the scanning will recreate or update the library with the music embedded meta-data tags and the importing of the "song playback data" will add the scarpper and user rating to the library database - got it.
Reply



Logout Mark Read Team Forum Stats Members Help
Playlists are scanned to Library - thus dublicating songs/albums0
This forum uses Lukasz Tkacz MyBB addons.