editing library paths without losing ratings/art
#16
I split because I felt they were good clear questions deserving of own threads, not geeky at all. Smile

When I mention you like this  @BatterPudding  I thought you would get an alert at the  top of the forum, at least I do. Maybe it is a notification setting?
Reply
#17
A "top of the forum" alert is why I didn't see it.  I get emails on replies and then come visit.  Or I just leave the thread open in a tab.  That little bell at the top corner gets ignored as it currently sits there with 232 lit up...  too much to trawl through.  Big Grin
Reply
#18
(2019-04-15, 19:54)BatterPudding Wrote: it currently sits there with 232 lit up...  too much to trawl through.  Big Grin
User CP > Delete All Alerts or click on the bell notification symbol and Delete All Alerts

Now you can start fresh and keep on top of them as they pop-up Smile
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
#19
(2019-04-07, 16:19)BatterPudding Wrote: @VelvetKevorkian Here be dragons...  use at own risk...  Backup before you start messing with anything...
Code:
UPDATE path SET strPath = REPLACE(strPath,"smb://OLD/Music/Roger Waters", "smb://NEW/Music/FLAC/Roger Waters");
UPDATE art SET url = REPLACE(url,"smb://OLD/Music/Roger Waters", "smb://NEW/Music/FLAC/Roger Waters");
I am often moving albums around on the hard disk.  I'll nip into that database using SQL Browser Lite and run the above commands on the Execute SQL page.  One updates the main path table, the other updates the relevant artwork.

Notice how I am pattern matching on part of the path.  I am actually moving a dozen albums at the same time on the hard disk, then these two commands mimic what I have just moved.

After manually moving my folders, I'll close KODI, open the database, run the command, do a visual check of the tables, write the changes to the database, restart KODI, and then do a "Update Library" in the Music section.  And just to be sure I haven't left any mess behind I often do a Clean Library too.

I think the fact that the hash is now wrong kicks KODI to rescan those files, which is often what I want it to do.

This hasn't yet broken anything.  Well, I haven't noticed any issues...

Personally, the idea of exporting everything and then importing it back in is scarier sounding to me Big Grin.  I don't like the idea that all the artwork gets exported in lower quality.  A step I don't really understand the logic of.

Edit: Just update this to add that this was originally cribbed from the Kodi KB with a few tweaks to better handle spaces.  (Use speech marks around the paths)
https://kodi.wiki/view/HOW-TO:Update_SQL...files_move

thx alot for that, i just saw your post.
will do some backups and try it out, time permitting
KODI Player: Nvidia Shield TV Pro [2019] | Receiver: Marantz SR6013 | TV: LG 55SJ800V | Toaster: Severin AT 2515

How to:
Create custom video nodes like Documentaries, Concerts, Kids etc
 
Reply
#20
(2019-05-04, 11:36)VelvetKevorkian Wrote: thx alot for that, i just saw your post.
will do some backups and try it out, time permitting 
Remember that the paths are Case Sensitive. So Make Sure You Match The Capitals Exactly - even if you are on Windows where Caps Don't Matter it still matters to KODI.

KODI will see smb://NEW/Music/FLAC/Roger Waters and smb://new/music/flac/roger waters as two different locations (because in the *nix world they are different). In Windows this points to the same place.

Anytime I do a manual edit to the database I always double check the path and art tables after my edits.
Reply
#21
I'm going to repeat that having edited the paths in the db and moved the music files, on the next library update everything will get rescanned (the hash values of folder timestamp and size will have changed).  This makes using export/import to save/restore the additional data is an easy approach.

Take an export of everything (including song playback history and ratings)  to a single xml file, drop the music sources, move the music files, clean the library. Then add new music source(s) and scan everything into the library (it is going to happens sooner or later with SQL edit approach anyway), finally import the single xml file to restore the additional album and artist information and the song play counts and ratings.

That is of course assuming you are using v18.2 - having added the facility to export/import song ratings it would be nice for users to use it!
Reply
#22
(2019-05-04, 12:22)DaveBlake Wrote: I'm going to repeat that having edited the paths in the db and moved the music files, on the next library update everything will get rescanned (the hash values of folder timestamp and size will have changed).  This makes using export/import to save/restore the additional data is an easy approach.

Take an export of everything (including song playback history and ratings)  to a single xml file, drop the music sources, move the music files, clean the library. Then add new music source(s) and scan everything into the library (it is going to happens sooner or later with SQL edit approach anyway), finally import the single xml file to restore the additional album and artist information and the song play counts and ratings.

That is of course assuming you are using v18.2 - having added the facility to export/import song ratings it would be nice for users to use it!
So the steps i should take are:
  1. make complete backup
  2. export to single xml incl. song playback history/ratings
  3. drop sources
  4. move files to new subdirectories
  5. clean library
  6. update SQL tables using commands from BatterPudding
  7. add same directory (with changed subdirectories) as new source
  8. scan library
  9. import xml

correct?


when i try to export to a single file, i only see these options, nothing about playback history/ratings:
Image
"xbmc_version": "18.2-RC1 Git:20190413-73b6095e7e"



edit

nvm, i just read it here:
https://kodi.wiki/view/Import-export_lib...ingle_File
KODI Player: Nvidia Shield TV Pro [2019] | Receiver: Marantz SR6013 | TV: LG 55SJ800V | Toaster: Severin AT 2515

How to:
Create custom video nodes like Documentaries, Concerts, Kids etc
 
Reply
#23
(2019-05-04, 12:22)DaveBlake Wrote: Take an export of everything...
I think you may be misunderstanding the aim of my little edits.  I am just moving a SINGLE release - not a whole source.  And I want that single release to get rescanned.

I am certainly not dissing any of your excellent work.

Some of us just need a quick hack fix.  It is the time taken to do full exports that make it overkill for small tweaks.  Rescanning one single folder is actually a WANTED side effect of this edit.  I want KODI to re-look at all the files in the single folder I have just moved.  Usually because tags have been updated on that one album.  Or maybe I just updated six albums for one artist.

Isn't a full rescan going to happen after an import anyway - but now of all 25,000 tracks?

It is just not feasible to keep doing full database exports \ imports \ stand on my head of 25,000+ tracks every time I want to make a small change to just one release.

The reason for my hack of the database path for a single album is due to having a heap of badly tagged albums in one set of folders.  These are being cleaned up and moved to a different location on the same hard disk.  And I am doing this constantly album by album, artist by artist as I bring my whole collection up to a better standard.

So I only need that single folder rescanned - not a whole source.


I probably should get away from this thread now as we are clearly thinking about different issues here.  I didn't mean to cause this confusion and we are clearly confusing the OP as he is now trying to merge both of our advice into one.

@VelvetKevorkian - just ignore all my posts and advice as it is not of use to you in this situation.  Listen to the expert Wink
Reply
#24
@BatterPudding I have no issue with your posts, but for anyone reading later I wanted to be sure the options were clear. Also note that the op is about moving all the music files not just a single release.


(2019-05-04, 16:32)VelvetKevorkian Wrote: So the steps i should take are:
  1. make complete backup
  2. export to single xml incl. song playback history/ratings
  3. drop sources
  4. move files to new subdirectories
  5. clean library
  6. update SQL tables using commands from BatterPudding
  7. add same directory (with changed subdirectories) as new source
  8. scan library
  9. import xml

correct?
No, there is no need for any SQL updates, that is the point of export/import. But you would have noticed that when you tried to make them as dropping source and cleaning would give you an emty db and no paths to edit.

Also first step - make a backup by copying all the userdata files - always a good idea when trying something so major.
Reply
#25
This is off the original topic of "editing library paths without losing ratings/art"  and I may well split it later, but posted here so the op reads it.

@VelvetKevorkian I noticed on another thread you say
(2019-05-04, 11:35)VelvetKevorkian Wrote: Question regarding folder structure and artwork beef:
i want to change my library paths from
Music/Artist/Year - Album
to
Music/BEGINNING_NUMBER_OR_LETTER_OF_ARTIST/Artist/Year - Album

After i've done that, will AB automatically download art into the folder structure as is
or will it use the more common Music/Artist/-structure to dump files?
(2019-05-04, 12:39)VelvetKevorkian Wrote: I set the artist information folder to the same folder where the music is stored.
Right now, there are 5400 folders - that's why i want to change the folder structure.

So... if art is stored to just a specific folder location my problem will persist ( ._.)
It sounds like using your music folder as the Artist Information Folder has created lots of additional folders alongside those for containing music files. It has done what various posts and wiki warns users about.  You must also have exported a lot of artists (all of them including contributors?), guessing that you don't have 5400 album artists.

If that is the reason you want to move your music files, then I suggest that you approach this a different way. Put the local artist art and NFO files somewhere else by setting the Artist Information Folder to a separate location.

Also with a "Music/BEGINNING_NUMBER_OR_LETTER_OF_ARTIST/Artist/Year - Album" structure, and "Music/" as the Artist Information Folder Kodi will be looking for artist art and NFO files in "Music/<Artist name>". If you export to NFO + art again (what I assume you did to get 5400 folders) then you will get a new 5400 folders in "Muisc/"
 
Or maybe you used Artwork Beef which (uses the Artist Information Folder too) and that created the 5400 folders, not export? Whatever I fear you are misunderstanding how the Artist Information Folder works.

Say more about what you are trying to do and why, and I will help you.
Reply
#26
(2019-05-05, 00:08)DaveBlake Wrote: Also note that the op is about moving all the music files not just a single release.
My brain went into overload and was looking at the A, B, C splits being performed by code.  But that was too geeky - and plain bonkers. Wink
Reply
#27
(2019-03-08, 23:42)VelvetKevorkian Wrote: Hello,

i want to change my library paths from
Music/Artist/Year - Album
to
Music/BEGINNING_NUMBER_OR_LETTER_OF_ARTIST/Artist/Year - Album

Reason
I have now over 5000 artist folders (most of them art only from compilation artists) and it's messy.

This would be better:
Image



Now my question:
Using sth like DB browser for SQL lite to edit "path" in MyMusicXX.db like shown below,
is it possible to change paths and still keep my song ratings and art stuff... or will my database be messed up then?


Image


Any help is appreciated.

I’m not sure why you want to change the paths but assume it’s because you navigate the folder structure to play your music.

Why not use a skin that supports easier navigation like Aeon Nox Silvo. In the Artist view there’s a right side pop out menu with letters of the alphabet. Select a letter and the Artist view auto scrolls to the first artist name beginning with that letter.

Or use one of the Kodi remote control apps that support scrolling/searching your music collection on a tablet or smartphone which is even better than attempting that in the Kodi UI while playing music (or music videos). The other advantage over folder/file navigation is you only see Artists with music files, you don’t see artist information folders which you want to hide...
Reply
#28
Have split the recent question about moving music files to a new drive into own thread https://forum.kodi.tv/showthread.php?tid=356741

Gary you replied to the OP issue that was resolved over a year ago, the problem when users tack new a question onto old threads.
Reply



Logout Mark Read Team Forum Stats Members Help
editing library paths without losing ratings/art0
This forum uses Lukasz Tkacz MyBB addons.