home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Possible Improvement when scanning video database
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="kev160967" data-source="post: 145969" data-attributes="member: 26620"><p>Hi,</p><p>I'd noticed that the IMDB scan was having trouble with a lot of my movies, so I took a look at what was going on. One thing I spotted was that FuzzyMatch in IMDBFetcher.cs was being asked to match files with titles like "Stuart Little 2.AVI" (hey, I have kids <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> ) against strings returned from IMDB like "Stuart Little 2 (1996) (imdb)". This was screwing up the matching results. It seemed daft to include the (imdb) in the match, and also I rarely had a year in my file names, so that threw things off as well. I added the following function and import:</p><p></p><p>using System.Text.RegularExpressions;</p><p></p><p> private string StripNameAndIMDB(string title)</p><p> {</p><p> if (title.Trim().EndsWith("(imdb)"))</p><p> title = title.Substring(0, title.LastIndexOf("(imdb)"));</p><p> Regex bracketedYear = new Regex("[(]\\d{4,4}[)]$");</p><p> title = bracketedYear.Replace(title.Trim(), "");</p><p> return title;</p><p> }</p><p></p><p>and used it to preprocess the strings being passed into Levenshtein.Match. I got a huge improvement in accuracy.</p><p></p><p>As it stands, this throws away the year even if it is included in the filename being matched, so it could do with a tweak to only lose the year if the filename doesn't include one. </p><p></p><p>Any comments?</p></blockquote><p></p>
[QUOTE="kev160967, post: 145969, member: 26620"] Hi, I'd noticed that the IMDB scan was having trouble with a lot of my movies, so I took a look at what was going on. One thing I spotted was that FuzzyMatch in IMDBFetcher.cs was being asked to match files with titles like "Stuart Little 2.AVI" (hey, I have kids :) ) against strings returned from IMDB like "Stuart Little 2 (1996) (imdb)". This was screwing up the matching results. It seemed daft to include the (imdb) in the match, and also I rarely had a year in my file names, so that threw things off as well. I added the following function and import: using System.Text.RegularExpressions; private string StripNameAndIMDB(string title) { if (title.Trim().EndsWith("(imdb)")) title = title.Substring(0, title.LastIndexOf("(imdb)")); Regex bracketedYear = new Regex("[(]\\d{4,4}[)]$"); title = bracketedYear.Replace(title.Trim(), ""); return title; } and used it to preprocess the strings being passed into Levenshtein.Match. I got a huge improvement in accuracy. As it stands, this throws away the year even if it is included in the filename being matched, so it could do with a tweak to only lose the year if the filename doesn't include one. Any comments? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Possible Improvement when scanning video database
Contact us
RSS
Top
Bottom