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: 146261" data-attributes="member: 26620"><p>Hmm, I notice on further playing with the sources that the year and the (imdb) tag are added deliberately, rather than coming back from IMDB. Anyone know why? I can see that the year might appear in the file name (though if it doesn't it's better removed from the movie being tested), but the "(imdb)" surely can't do anything but confuse the matching process?</p><p></p><p>I've made a few changes to the routine:</p><p></p><p> private string StripNameAndIMDB(string title, string search)</p><p> {</p><p> if (title.Trim().EndsWith("(imdb)"))</p><p> title = title.Substring(0, title.LastIndexOf("(imdb)")).Trim();</p><p> Regex bracketedYear = new Regex("[(]\\d{4,4}[)]($|.)");</p><p> if (search.Trim().Length!=0 && bracketedYear.IsMatch(search)==false)</p><p> title = bracketedYear.Replace(title.Trim(), "");</p><p> return title.Trim();</p><p> }</p><p></p><p>I now pass search in to check whether or not the filename has a year in it, and to leave it in the comparison string if it does - pass an empty string in if I'm stripping the filename. I also needed to change the RegExp as it wasn't spotting the year in things like "Movie Name (2005).CD1.AVI", and was consequently removing it from the IMDB result, but leaving it in the filename.</p><p></p><p>Kev</p></blockquote><p></p>
[QUOTE="kev160967, post: 146261, member: 26620"] Hmm, I notice on further playing with the sources that the year and the (imdb) tag are added deliberately, rather than coming back from IMDB. Anyone know why? I can see that the year might appear in the file name (though if it doesn't it's better removed from the movie being tested), but the "(imdb)" surely can't do anything but confuse the matching process? I've made a few changes to the routine: private string StripNameAndIMDB(string title, string search) { if (title.Trim().EndsWith("(imdb)")) title = title.Substring(0, title.LastIndexOf("(imdb)")).Trim(); Regex bracketedYear = new Regex("[(]\\d{4,4}[)]($|.)"); if (search.Trim().Length!=0 && bracketedYear.IsMatch(search)==false) title = bracketedYear.Replace(title.Trim(), ""); return title.Trim(); } I now pass search in to check whether or not the filename has a year in it, and to leave it in the comparison string if it does - pass an empty string in if I'm stripping the filename. I also needed to change the RegExp as it wasn't spotting the year in things like "Movie Name (2005).CD1.AVI", and was consequently removing it from the IMDB result, but leaving it in the filename. Kev [/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