User55263 0 Posted July 17, 2015 Share Posted July 17, 2015 (edited) Hi, I updated my dev environment to try to get IMDB Id found in filename working (http://emby.media/community/index.php?/topic/8018-naming-convention-using-idmb-id/page-2) .. and I realise I can't see where the override SetInitialItemValues functions (especially Movies one) are being called. According to https://github.com/MediaBrowser/Emby/search?utf8=%E2%9C%93&q=SetInitialItemValues&type=Code .. it is never called ? Only ResolverHelper's SetInitialItemValues is called ? Or I'm missing something ? Thanks, Edited June 9, 2021 by User55263 Link to comment Share on other sites More sharing options...
Luke 37994 Posted July 17, 2015 Share Posted July 17, 2015 see ItemResolver.ResovlePath Link to comment Share on other sites More sharing options...
User55263 0 Posted July 17, 2015 Author Share Posted July 17, 2015 I added some debug code, like StreamWriter sw = new StreamWriter(@"D:\Stuffs\Emby\logs\LibraryManager.log", true); sw.WriteLine("Alex:LibraryManager.ResolvePaths"); sw.Flush(); sw.Close(); (because logger doesn't seems to be visible from MovieResolver/PathExtensions ?) in LibraryManager.cs:ResolvePaths(), MovieResolver.cs:Resolve(), PathExtensions.cs:GetAttributeValue() .. and I only get output from LibraryManager, is it normal ? Is it the way MovieResolver.cs:Resolve() is called that is disallowing output, or simply that the code is never called ? Or my code is invalid maybe ? Link to comment Share on other sites More sharing options...
Luke 37994 Posted July 17, 2015 Share Posted July 17, 2015 just put the debugger on, and put a breakpoint at line 280. works fine. Link to comment Share on other sites More sharing options...
User55263 0 Posted July 18, 2015 Author Share Posted July 18, 2015 (edited) Version 3.0.5667.6, breakpoint on : LibraryManager l 662 : ok, caugth MovieResolver l.280 (the one you're talking about, right ?) : never caugth PathExtention.cs l.16 & 36 : never caugth Am I doing something wrong ? Btw, Emby is not able to start without internet, wanted to do offline debugging, had to setup an hotspot, and found nothing about this in the logs (only a popup after a few minutes with an unrelated message) Edited June 9, 2021 by User55263 Link to comment Share on other sites More sharing options...
Luke 37994 Posted July 18, 2015 Share Posted July 18, 2015 make sure your movies are setup in a library of content type movies Link to comment Share on other sites More sharing options...
User55263 0 Posted July 18, 2015 Author Share Posted July 18, 2015 (edited) Yes, they are, I could see that in the LibraryManager breakpoint Edit: collectionType : "movie" files : Count = 3 (my 3 test files not correctly recognized while they have [imdbid] in the filename, the bug I'm tracking) Edit2, trace: LibraryManager.cs:ResolvePaths >MovieResolver.cs:ResolveVideos<Movie>(parent, files, directoryService, collectionType, true) (l.88) >l.120 resolver=MediaBrowser.Naming.Video.VideoListResolver No MetadataProviders property set while scanning file list, SetInitialItemValues never called Edited June 9, 2021 by User55263 Link to comment Share on other sites More sharing options...
User55263 0 Posted July 21, 2015 Author Share Posted July 21, 2015 So, is it the normal behaviour ? If so, where should I add support to parse file title for provider id ? Would you accept a such patch ? Link to comment Share on other sites More sharing options...
Luke 37994 Posted July 21, 2015 Share Posted July 21, 2015 right now i can't reproduce the problem so i'm not sure. Link to comment Share on other sites More sharing options...
User55263 0 Posted July 21, 2015 Author Share Posted July 21, 2015 (edited) Repro steps : - Have a folder (let's say D:\Stuffs\Emby\test\) with 3 media files having imdb id in title, like : (500) jours ensemble (2009) [tt1022603].avi 1984 (1984) [tt0087803].avi Diversion (2015) [tt2381941].mkv - Install Emby server (3.0.5667.6 or latest 3.0.5675.1, it does the same) - Follow first launch wizard with default settings, adding a library of type Movie with 1 location (D:\Stuffs\Emby\test\), finish the wizard. - See that 2 of the 3 files doesn't have the good meta data, imdb id is different, the one from the file name is not used (and putting a breakpoint on the functions that should be called does nothing) Edit : is there any other information I can send you to help identifying what's wrong ? Edited June 9, 2021 by User55263 Link to comment Share on other sites More sharing options...
Luke 37994 Posted July 21, 2015 Share Posted July 21, 2015 for testing purposes, try adding D:\Stuffs\Emby instead Link to comment Share on other sites More sharing options...
User55263 0 Posted July 21, 2015 Author Share Posted July 21, 2015 Still the same. Link to comment Share on other sites More sharing options...
ebr 15186 Posted July 21, 2015 Share Posted July 21, 2015 Repro steps : - Have a folder (let's say D:\Stuffs\Emby\test\) with 3 media files having imdb id in title, like : (500) jours ensemble (2009) [tt1022603].avi 1984 (1984) [tt0087803].avi Diversion (2015) [tt2381941].mkv - Install Emby server (3.0.5667.6 or latest 3.0.5675.1, it does the same) - Follow first launch wizard with default settings, adding a library of type Movie with 1 location (D:\Stuffs\Emby\test\), finish the wizard. - See that 2 of the 3 files doesn't have the good meta data, imdb id is different, the one from the file name is not used (and putting a breakpoint on the functions that should be called does nothing) Edit : is there any other information I can send you to help identifying what's wrong ? That isn't the proper format. It needs to be: [imdbid=tt1022603] Or, at least, that's how it used to work. Link to comment Share on other sites More sharing options...
User55263 0 Posted July 22, 2015 Author Share Posted July 22, 2015 That isn't the proper format. It needs to be: [imdbid=tt1022603] Or, at least, that's how it used to work. https://github.com/MediaBrowser/Emby/blob/master/MediaBrowser.Server.Implementations/Library/PathExtensions.cs#L35 : nop, not needed But .. Is this code still used ? From what I can see in my debug, it seems not (but I don't know the whole architecture ..) and I heard about extracting the file recognition part in another project, https://github.com/MediaBrowser/MediaBrowser.Naming .. Should this lib be in charge of getting IMDB Id ? Link to comment Share on other sites More sharing options...
Luke 37994 Posted July 22, 2015 Share Posted July 22, 2015 You're not even getting that far. Try one more per folder. Maybe there's an issue there Link to comment Share on other sites More sharing options...
ebr 15186 Posted July 22, 2015 Share Posted July 22, 2015 https://github.com/MediaBrowser/Emby/blob/master/MediaBrowser.Server.Implementations/Library/PathExtensions.cs#L35 : nop, not needed Okay, so that's new code. Does the format I suggested still work though? Link to comment Share on other sites More sharing options...
User55263 0 Posted July 22, 2015 Author Share Posted July 22, 2015 (edited) I though is was working without any change tonight .. but it's just that OMDB Api is a bit down (and its results are the bad I can see, while TMDB is giving the good results ; but while it tells me that TMDB seems to be better, that's not resolving the issue). From your questions, here's the naming I tried : >dir /S /B D:\Stuffs\Emby\test\(500) jours ensemble (2009) [tt1022603].avi D:\Stuffs\Emby\test\1984 (1984) [imdbid=tt0087803].avi D:\Stuffs\Emby\test\Diversion (2015) [tt2381941] D:\Stuffs\Emby\test\Diversion (2015) [tt2381941]\Diversion (2015) [tt2381941].mkv and I put a breakpoint on the SetProviderIdsFromPath / GetAttributeValue function. On 7/22/2015 at 2:41 AM, Luke said: You're not even getting that far. Try one more per folder. Maybe there's an issue there You're right, with Diversion, breakpoint is working, so it seems applied to folder name only, but not filename ? So real issue ? On 7/22/2015 at 2:30 PM, ebr said: Okay, so that's new code. Does the format I suggested still work though? No luck neither with tag like [imdbid=tt1234567] (and I wouldn't put that in my filename, adding the id is long enough ) Edited June 9, 2021 by User55263 Link to comment Share on other sites More sharing options...
MikePlanet 142 Posted July 22, 2015 Share Posted July 22, 2015 @ebr: IMDB id does not need any special format (other than e.g. tmdbid), it is parsed by pattern (https://github.com/M...rowser/pull/962) - so it only needs to be present - any naming would work. I made that pull request - but can't remember if the matching is applied only to the parent directory or also the filename - but I fully agree, that it should match on either of them, as that would make sure to grab it also, if it is part of the filename. @Alex131089: While you're digging into it and obviously have a debugging environment up and running (which I currently do not have) - could you simply test, what string is pattern checked (only parent dir or including the filename)? Once the imdb id is pulled and set there, it indeed should use that one for the OMDB and TMDB lookups and get proper matching (TMDB of course only, if the corresponding imdb movie is present). @Luke: There is one more property, that I think we can only grab from the media item: that is the "edition" (example: 'special edition', 'directors cut', etc.). internet DBs never can know, what edition the local movie acutally is. I solved that in another project by grabbing the edition from the media item path/filename. Is it worth, adding that to emby too? Link to comment Share on other sites More sharing options...
Luke 37994 Posted July 23, 2015 Share Posted July 23, 2015 I've fixed it for the next release. You made a nice attempt, so i figured why let you keep struggling Link to comment Share on other sites More sharing options...
MikePlanet 142 Posted July 23, 2015 Share Posted July 23, 2015 Good finding - so it wasn't called, when there were multiple files in one directory... @Luke: any comment to that one? I'd be willing to code it if you could provide the property to load into (as I am not shure how it works with the properties)!? @Luke: There is one more property, that I think we can only grab from the media item: that is the "edition" (example: 'special edition', 'directors cut', etc.). internet DBs never can know, what edition the local movie acutally is. I solved that in another project by grabbing the edition from the media item path/filename. Is it worth, adding that to emby too? Link to comment Share on other sites More sharing options...
User55263 0 Posted August 4, 2015 Author Share Posted August 4, 2015 I've fixed it for the next release. You made a nice attempt, so i figured why let you keep struggling Thank you Applied your commit to 3.0.5675.1, seems to be ok 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