Lyfesaver 139 Posted Sunday at 08:02 PM Posted Sunday at 08:02 PM I have been moving my numerous local drives over to a NAS raid box. I took my custom TV series "Dallas Cowboy Games" where I have all their wins from the 70s til now each in their own season folder from inside J:\TV1\NFL\ to \\NAS\Media\TV\NFL Because I have not removed the old J:\TV1\ path from my library Emby still sees it with all the custom work I did (images, dates. descriptions, etc) and it sees the \\NAS\Media\TV\NFL as "Inside the NFL" Is there anyway I can "Identify" the new location as my custom series without having to go through all that work again?
js28194 52 Posted Monday at 05:59 PM Posted Monday at 05:59 PM (edited) I could have sworn somewhere in the matrix they added the sportsdb.com as a metadata provider. My understanding was if you named the folders accordingly all would be well. I could be wrong. I was wrong once, but then my wife beat me. https://www.thesportsdb.com/browse.php?s=dallas+cowboys Ah, I C now... you have to add the sportsdb.com plugin and name the folders accordingly and life will be good. I'd back up the metadata stuff just in case. Alternatively, you need a custom script to (was SED?) to go through all your .nfo files update them with the new path. I don't imagine that would be too difficult for the linux programmer. For us mere mortals, claude maybe your friend if that is the route you wish to traverse. YMMV, use at your own PERIL!! Bash Script find /path/to/folder -name "*.nfo" -exec sed -i 's/OLD_STRING/NEW_STRING/g' {} + Breakdown: find /path/to/folder — searches recursively through all subdirectories -name "*.nfo" — targets only .nfo files -exec sed -i — runs an in-place edit on each file found 's/OLD_STRING/NEW_STRING/g' — replaces every occurrence of the old string with the new one {} + — passes all found files to the command efficiently Example — replacing "Director: Unknown" with "Director: John Doe": So in your case it "should" be: find /path/to/folder -name "*.nfo" -exec sed -i 's/J:\TV1\NFL\/\\NAS\Media\TV\NFL/g' {} + But again, YMMV. Also, I recommend to use an IP address instead of "NAS" in case you decided to do something different in the future and change again. It's just damn easier to assign a new device the old ip address and retire the old the one, but again, YMMV. Edited Monday at 06:12 PM by js28194 1
js28194 52 Posted Monday at 06:30 PM Posted Monday at 06:30 PM (edited) If you go the script route... those internal backslashes may become an issue.... find /path/to/folder -name "*.nfo" -exec perl -pi -e 's/J:\\TV\\NAS/\\NAS\\Media\\TV\NFL/g' {} + Again, encouraged to use IP Address instead of NAS. Would move a few folders over to a temp location for testing, but it seems the sportsdb.com metadata plugin seems a bit easier. Edited Monday at 06:30 PM by js28194 1
Lyfesaver 139 Posted Monday at 06:43 PM Author Posted Monday at 06:43 PM First of all, thank you so very much for trying to help and I think I understand what you are saying for the most part. I understand I can change the folder layout and let thesportsdb.com do their thing but that wont bring over all the work I did. The custom screen shots, the detailed info, etc... check this out: This is the level of data I have pianistically entered vs what thesportsdb.com has So you can see why I really dont want to use their metadata. Also, not sure what you meant by using a custom script for the nfo files. I dont have any nfo files all this is in the database
Lyfesaver 139 Posted Monday at 06:46 PM Author Posted Monday at 06:46 PM 15 minutes ago, js28194 said: If you go the script route... those internal backslashes may become an issue.... find /path/to/folder -name "*.nfo" -exec perl -pi -e 's/J:\\TV\\NAS/\\NAS\\Media\\TV\NFL/g' {} + Again, encouraged to use IP Address instead of NAS. Would move a few folders over to a temp location for testing, but it seems the sportsdb.com metadata plugin seems a bit easier. Ahh that follow up comment you made really helped me to understand about the script. I thought you were talking about a script to move nfo files into the database with the new location. Still not sure how to best do this tho.. I dont want to lose all my data
Lyfesaver 139 Posted Monday at 06:50 PM Author Posted Monday at 06:50 PM Keep in mind I went thru the same level of detail for the Mavericks, Stars and Rangers as well (just not as many games... only playoffs as there are so many more in a season) This is why I am hoping for a fix that I can reuse all my work
js28194 52 Posted Monday at 06:50 PM Posted Monday at 06:50 PM (edited) So my understanding (how puny my brain maybe) when EMBY first scan's the folder let's say for movies, it connects to the themoviedb.org website and downloads all the metadata into a local .nfo file along side your video file. It then reads or inserts it into the the database permanently. My suggestion was to update your .nfo files and let EMBY just read an update the database locally. My understanding of this process may be wrong, but I have to do this recently and did not see any issue. Was also helpful to lock the the folder(s) from updating metadata. The other part is that from what I have experienced, you updating the metadata in the web application "shoud have" updated the local .nfo file next to the video file. I think there is a solution in here buried for you but I shall wait for smarter men & women to chime in. One last comment... you say "season" and again, somebody should chime in, sports are events, not caterogized as seasons in the traditional terminology Emby uses for TV shows. Event's really fall under the "Movies" categories: Example: Folder Name: UFC 32- Showdown In The Meadowlands (2001) -> FileName: UFC 32- Showdown In The Meadowlands (2001).mkv Side note... don't know why I'm trying to help a Dallas fan (sigh) Edited Monday at 06:57 PM by js28194 1
Lyfesaver 139 Posted Monday at 07:06 PM Author Posted Monday at 07:06 PM (edited) "Side note... don't know why I'm trying to help a Dallas fan (sigh)" Because you are awesome. I believe Emby will do the local NFO saving if you turn that option on somewhere I was really hoping one of the admins would know how to use Swagger to just change the paths in the database Side note: Who's your team (city)? Edited Monday at 07:08 PM by Lyfesaver
js28194 52 Posted Tuesday at 05:25 PM Posted Tuesday at 05:25 PM There is a local swagger API builtin... I dare not mess with it. I'm infrastructure, not programming so I once again must defer to better minds than me. Server -> Settings -> Scroll all the way down to the bottom of the page. 1
Lyfesaver 139 Posted Tuesday at 10:04 PM Author Posted Tuesday at 10:04 PM Ya, I have used it before but ebr gave me the command to use I don't know what I am doing lol
Luke 42555 Posted Wednesday at 04:54 AM Posted Wednesday at 04:54 AM If you have nfo files then it should be pretty painless to make the changes in Emby library setup.
Lyfesaver 139 Posted Wednesday at 10:37 AM Author Posted Wednesday at 10:37 AM 5 hours ago, Luke said: If you have nfo files then it should be pretty painless to make the changes in Emby library setup. I have never used nfo files, just stored data in the database. Is it not possible to run a script that will edit the database? I am just really desperate to fix this as it is the last hurdle before I can move Emby off of Windows
Neminem 1741 Posted Wednesday at 04:45 PM Posted Wednesday at 04:45 PM @Lyfesavertry this plugin Never used it but @yockerwork is solid 1 1
Luke 42555 Posted Wednesday at 05:14 PM Posted Wednesday at 05:14 PM 6 hours ago, Lyfesaver said: I have never used nfo files, just stored data in the database. Is it not possible to run a script that will edit the database? Some have found tricks, and @Happy2Playmight be able to find them. But officially, no. 1
Lyfesaver 139 Posted Wednesday at 05:43 PM Author Posted Wednesday at 05:43 PM 57 minutes ago, Neminem said: @Lyfesavertry this plugin Never used it but @yockerwork is solid Will this work if the drive itself is no longer in the machine? I have moved the files over to the NAS and added the drive to the array which would have formatted it to XFS
js28194 52 Posted Wednesday at 05:47 PM Posted Wednesday at 05:47 PM So open library.db in dbrowser and do the whole *update * records where path is "X" TO "somehting XX" beyond my expertise. .nfo files would be awesome but I get it, you don't have 'em. Something to consider moving forward. I've done a bit SQL Ju Jit Sue in past life, but not here. 1
js28194 52 Posted 15 hours ago Posted 15 hours ago (edited) Shutdown EMBY. Make a copy of your library.db file.... then for good measure, copy your copy to another location then probably one more time to be on the safe side. Open library.db in dbbrowser for SQL Lite (free and open source) Navigate to Execute SQL tab and type the following: UPDATE MediaItems SET path = REPLACE(path, 'J:\TV1\NFL\', '\\NAS\Media\TV\NFL\'); Be mindful of the backslashes there and make sure they are correct. Again recommend change NAS to ip address but your call. (screenshots below) Click on Run (where you see the stop icon with X it should be a run icon instead) and be patient, be very patient until you see on the bottom the screen: Close DB Browser, it will ask you the save the project, you don't have to then it will prompt you save changes to the database itself. Hit Save and close. Cross your fingers and launch EMBY. Now the standard disclaimers and caveats that your are pretty much on your own with this method and it's obviously not approved by anyone, but worth a shot if you really to take the risk. Go check your paths at the library level and at check a few items directly in system metadata to confirm changes. Play a file or 5 to confirm. Edited 15 hours ago by js28194 1
Lyfesaver 139 Posted 15 hours ago Author Posted 15 hours ago That's above and beyond, bro Really... thank you very much for this. Will do it later today and let you know Truly appreciate it!!!!
js28194 52 Posted 15 hours ago Posted 15 hours ago (edited) Turns out there is one more table that has a path so you must update it also. You can just modify the above command and hit run again. It is the Images table. Also, make sure the case sensitivity as these functions are case sensitive UPDATE MediaItems SET path = REPLACE(Images, 'J:\TV1\NFL\', '\\NAS\Media\TV\NFL\'); Edited 14 hours ago by js28194 Fixing SQL Command 1
Lyfesaver 139 Posted 15 hours ago Author Posted 15 hours ago 9 minutes ago, js28194 said: Turns out there is one more table that has a path so you must update it also. You can just modify the above command and hit run again. It is the Images table. Also, make sure the case sensitivity as these functions are case sensitive UPDATE Images SET path = REPLACE(path, 'J:\TV1\NFL\', '\\NAS\Media\TV\NFL\'); Step one ran fine, step 2 gave me this
Lyfesaver 139 Posted 15 hours ago Author Posted 15 hours ago Only diff is I am using SQLite Expert but the table is not listed
js28194 52 Posted 14 hours ago Posted 14 hours ago (edited) My bad... my bad... my bad. UPDATE MediaItems SET path = REPLACE(Images, 'J:\TV1\NFL\', '\\NAS\Media\TV\NFL\'); I haven't done SQL in a very long time, my apologies. Luckily though, that command not running didn't break anything, just didn't update anything. Edited 14 hours ago by js28194 1
Lyfesaver 139 Posted 13 hours ago Author Posted 13 hours ago Got it, will try again after I am done with this meeting 1
Lyfesaver 139 Posted 7 hours ago Author Posted 7 hours ago So, I tried and when I loaded the edited db and booted Emby it said that my NFL games were in my appdata/roaming/emby-server/data directory
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now