deepseth 10 Posted September 13, 2015 Share Posted September 13, 2015 Movies on this particular server are stored in folders like: Movies\0000_Batman\1989_Batman.1989.720p\Batman.mp4 Movies\0000_Batman\1992_Batman.2.1992.720p\Batman.2.mp4 After doing a library scan, the vast majority of titles aren't matched correctly. Fair enough. The naming scheme is utter gash. Unfortunately, there are too many directories involved in all sorts of weird and wonderful hierarchies, for various arcane reasons, which results in it not being an option to try and rename everything. That said, having done a scan, it looks like it's picked up all the different movies nicely, albeit without being able to identify them against IDMB / TheMovieDB / etc. So... my next thought was.. why not change the Name of the movie in the Emby database? So I shutdown Emby and fired up SQLiteStudio and am editting library.db (Windows7 x64) and have changed the value in the data column for the Name field, and changed the value in the Name field, in both cases, removing the year and underscore prefix. Example SQL for updating the Name column (the data column contains too much data so I didn't bother doing that with SQL, I used their graphical tool to edit that field): UPDATE TypedBaseItems SET Name = "Batman.2.1992.720p" where Name = "1992_Batman.2.1992.720p"; Closed SQLiteStudio and then restarted Emby. It doesn't like it at all. When I open the Metadata Manager and try to expand Movies, it just spins and doesn't give me any output. Any pointers for what I'm doing wrong and/or how I can do this differently without breaking it, or manually having to edit the metadata through the web interface? I was hoping to throw a little code at this to automatically update all movie names to strip out the leading "[12][0-9]{3}_" from all the names, and then fire off an advanced refresh, which should hopefully then successfully identify everything! Thanks in advance, deeps Link to comment Share on other sites More sharing options...
ebr 14939 Posted September 13, 2015 Share Posted September 13, 2015 There is no way we can support you manually modifying our internal database. I just can't imagine that ever ending well . Could you not use one of the file re-naming utilities to clean this up at the source much in the same way you are trying to do it with SQL? Link to comment Share on other sites More sharing options...
deepseth 10 Posted September 13, 2015 Author Share Posted September 13, 2015 (edited) Definitely not looking for long term support on this, and unfortunately I'm unable to rename the source directories (primary users on the system still navigate the media by the filesystem and need it sorted by year in this way) The goal here is to get an instance of Emby matching all the media, and then once it's matched, toggle writing nfos to be alongside the media and refreshing so that nfos are written to disk. At that point, it doesn't matter what the directory structure looks like, 95%+ of the media will be matched and the rest can be done manually. At that point, this Emby instance will be trashed and a new instance of Emby will be spun up, which will read the nfos and immediately match what the previous instance matched, without any database shenanigans My next thought was to try and use the API, but my browser is really struggling with reading the /swagger-ui/ docs Edited September 13, 2015 by deepseth Link to comment Share on other sites More sharing options...
ebr 14939 Posted September 13, 2015 Share Posted September 13, 2015 Well, just changing their names anywhere except the source file system isn't going to get you all the rest of the necessary metadata. What needs to happen is you have to get the proper tmdb or imdb id associated with the items so it can then go fetch all the rest of the information. Link to comment Share on other sites More sharing options...
deepseth 10 Posted September 13, 2015 Author Share Posted September 13, 2015 Yep, which an advanced refresh will then do, as the names will then be used in the search against imdb/tmdb and actually get results, unlike the current situation where it doesn't. At least, that's the theory... manually editing the name and then identifying does give me this behaviour, so that's the hope Link to comment Share on other sites More sharing options...
deepseth 10 Posted September 13, 2015 Author Share Posted September 13, 2015 And to further the point about not expecting support on any other strange issues that may come up, I've had to delete my %appdata%\emby-server\data and metadata folders multiple times so far today with this experimentation. Just trying to achieve this immediate goal. After which, it'll all be binned and restarted the correct way Link to comment Share on other sites More sharing options...
Solution deepseth 10 Posted September 15, 2015 Author Solution Share Posted September 15, 2015 I suppose what I should really do is use the API and Post {"Name":"Batman.2.1997.720p"} to: /Items/RemoteSearch/Movie?api_key=${APIKEY}&deviceid=curl&format=json Truncating the numerical bits from that search, and then follow up with POSTing the search results to: /Items/RemoteSearch/Apply/{Id}?api_key=${APIKEY}&deviceid=curl&format=json Looks like that works better! Link to comment Share on other sites More sharing options...
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