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
MediaPortal 1 Plugins
Popular Plugins
Moving Pictures
IMDb tt-ID expansion
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="RoChess" data-source="post: 1264952" data-attributes="member: 18896"><p>After I posted it I figured it out.</p><p></p><p>I think in a dark old past IMDb uses title1234567 format, before moving to tt1234567 and now tt12345678</p><p></p><p>If it was me, I would just purge that entire block as Amazon is never going to reintroduce it, and every entry in their system has been converted.</p><p></p><p>The following should work fine:</p><p></p><p>[code]</p><p> public static string parseFile(string filePath) {</p><p> logger.Info("Parsing NFO file: {0}", filePath);</p><p> // Read the nfo file content into a string</p><p> string s = File.ReadAllText(filePath);</p><p> // Check for the existance of a imdb id</p><p> Match match = Regex.Match(s, @"tt\d{7,8}", RegexOptions.IgnoreCase);</p><p> // If success return the id, on failure return empty.</p><p> if (match.Success) {</p><p> s = match.Value;</p><p> logger.Debug("ImdbID Found: {0}", s);</p><p> }</p><p> else {</p><p> s = null;</p><p> logger.Debug("No ImdbID Found.");</p><p> }</p><p> // return the string</p><p> return s;</p><p> }</p><p>[/code]</p><p></p><p>Another solution would be to adjust the RegExp capture group and do a RegExp replace, where "title" is replaced by "tt", so it has the same results and then RegExp sorts out the 7 or 8 character length.</p><p></p><p>My vote is to purge it, cleaner code and time to dump legacy <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite24" alt="(y)" title="Thumbs Up (y)" loading="lazy" data-shortname="(y)" /></p></blockquote><p></p>
[QUOTE="RoChess, post: 1264952, member: 18896"] After I posted it I figured it out. I think in a dark old past IMDb uses title1234567 format, before moving to tt1234567 and now tt12345678 If it was me, I would just purge that entire block as Amazon is never going to reintroduce it, and every entry in their system has been converted. The following should work fine: [code] public static string parseFile(string filePath) { logger.Info("Parsing NFO file: {0}", filePath); // Read the nfo file content into a string string s = File.ReadAllText(filePath); // Check for the existance of a imdb id Match match = Regex.Match(s, @"tt\d{7,8}", RegexOptions.IgnoreCase); // If success return the id, on failure return empty. if (match.Success) { s = match.Value; logger.Debug("ImdbID Found: {0}", s); } else { s = null; logger.Debug("No ImdbID Found."); } // return the string return s; } [/code] Another solution would be to adjust the RegExp capture group and do a RegExp replace, where "title" is replaced by "tt", so it has the same results and then RegExp sorts out the 7 or 8 character length. My vote is to purge it, cleaner code and time to dump legacy (y) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
Moving Pictures
IMDb tt-ID expansion
Contact us
RSS
Top
Bottom