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
Improvement Suggestions
IMDBFetcher
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="toertchn" data-source="post: 382583" data-attributes="member: 63984"><p>This code works for me. Not sure if runs anytime...anywhere.</p><p></p><p>[CODE]</p><p>private void _fetchDetails()</p><p>{</p><p> try</p><p> {</p><p> disableCancel = false;</p><p> if (movieDetails == null)</p><p> {</p><p> movieDetails = new IMDBMovie();</p><p> }</p><p> if (url == null)</p><p> {</p><p> return;</p><p> }</p><p> if (_imdb.GetDetails(this.url, ref movieDetails))</p><p> {</p><p> string line1;</p><p></p><p> // try get local artwork</p><p> string strImageURL = Util.Utils.GetCoverArt(movieDetails.Path, Path.GetFileNameWithoutExtension(movieDetails.File));</p><p></p><p> if (!String.IsNullOrEmpty(strImageURL))</p><p> {</p><p> string largeCoverArt = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, movieDetails.Title);</p><p> string coverArt = Util.Utils.GetCoverArtName(Thumbs.MovieTitle, movieDetails.Title);</p><p> Util.Utils.FileDelete(largeCoverArt);</p><p> Util.Utils.FileDelete(coverArt);</p><p> line1 = "Import local Artwork";</p><p> OnProgress(line1, movieDetails.Title, string.Empty, -1);</p><p> //Only get actors if we really want to.</p><p> if (getActors)</p><p> {</p><p> _fetchActorsInMovie();</p><p> }</p><p> OnDisableCancel(this);</p><p></p><p> if (Util.Picture.CreateThumbnail(strImageURL, largeCoverArt, (int)Thumbs.ThumbLargeResolution,</p><p> (int)Thumbs.ThumbLargeResolution, 0, Thumbs.SpeedThumbsSmall))</p><p> {</p><p> Util.Picture.CreateThumbnail(strImageURL, coverArt, (int)Thumbs.ThumbResolution,</p><p> (int)Thumbs.ThumbResolution, 0, Thumbs.SpeedThumbsLarge);</p><p> }</p><p> VideoDatabase.SetMovieInfoById(movieDetails.ID, ref movieDetails);</p><p> VideoDatabase.SetThumbURL(movieDetails.ID, strImageURL);</p><p> }</p><p> else</p><p> {</p><p> if (movieDetails.ThumbURL == string.Empty)</p><p> {</p><p> line1 = GUILocalizeStrings.Get(928) + ":IMP Awards";</p><p> OnProgress(line1, movieDetails.Title, string.Empty, -1);</p><p> IMPawardsSearch impSearch = new IMPawardsSearch();</p><p> impSearch.Search(movieDetails.Title);</p><p> if ((impSearch.Count > 0) && (impSearch[0] != string.Empty))</p><p> {</p><p> movieDetails.ThumbURL = impSearch[0];</p><p> }</p><p> else</p><p> {</p><p> line1 = GUILocalizeStrings.Get(928) + ":Amazon";</p><p> OnProgress(line1, movieDetails.Title, string.Empty, -1);</p><p> AmazonImageSearch search = new AmazonImageSearch();</p><p> search.Search(movieDetails.Title);</p><p> if (search.Count > 0)</p><p> {</p><p> movieDetails.ThumbURL = search[0];</p><p> }</p><p> }</p><p> }</p><p></p><p> string largeCoverArt = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, movieDetails.Title);</p><p> string coverArt = Util.Utils.GetCoverArtName(Thumbs.MovieTitle, movieDetails.Title);</p><p> Util.Utils.FileDelete(largeCoverArt);</p><p> Util.Utils.FileDelete(coverArt);</p><p> line1 = GUILocalizeStrings.Get(1009);</p><p> OnProgress(line1, movieDetails.Title, string.Empty, -1);</p><p> //Only get actors if we really want to.</p><p> if (getActors)</p><p> {</p><p> _fetchActorsInMovie();</p><p> }</p><p> OnDisableCancel(this);</p><p> DownloadCoverArt(Thumbs.MovieTitle, movieDetails.ThumbURL, movieDetails.Title);</p><p> VideoDatabase.SetMovieInfoById(movieDetails.ID, ref movieDetails);</p><p> }</p><p> }</p><p> else</p><p> {</p><p> movieDetails = null;</p><p> }</p><p> }</p><p> catch (ThreadAbortException)</p><p> {</p><p> }</p><p> finally</p><p> {</p><p> OnDetailsEnd(this);</p><p> disableCancel = false;</p><p> //Log.Info("Ending Thread for Fetching movie details:{0}", detailsThread.ManagedThreadId);</p><p> detailsThread = null;</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>Yet another sugestion. In IMDB.Find(string strMovie) you should leave the strMovie as it.</p><p></p><p>Also remove the UrlEncode of because you can't know if the Grabber use it in URL Format or not.</p><p></p><p>Its ugly to convert it back to original string in Grabber.</p></blockquote><p></p>
[QUOTE="toertchn, post: 382583, member: 63984"] This code works for me. Not sure if runs anytime...anywhere. [CODE] private void _fetchDetails() { try { disableCancel = false; if (movieDetails == null) { movieDetails = new IMDBMovie(); } if (url == null) { return; } if (_imdb.GetDetails(this.url, ref movieDetails)) { string line1; // try get local artwork string strImageURL = Util.Utils.GetCoverArt(movieDetails.Path, Path.GetFileNameWithoutExtension(movieDetails.File)); if (!String.IsNullOrEmpty(strImageURL)) { string largeCoverArt = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, movieDetails.Title); string coverArt = Util.Utils.GetCoverArtName(Thumbs.MovieTitle, movieDetails.Title); Util.Utils.FileDelete(largeCoverArt); Util.Utils.FileDelete(coverArt); line1 = "Import local Artwork"; OnProgress(line1, movieDetails.Title, string.Empty, -1); //Only get actors if we really want to. if (getActors) { _fetchActorsInMovie(); } OnDisableCancel(this); if (Util.Picture.CreateThumbnail(strImageURL, largeCoverArt, (int)Thumbs.ThumbLargeResolution, (int)Thumbs.ThumbLargeResolution, 0, Thumbs.SpeedThumbsSmall)) { Util.Picture.CreateThumbnail(strImageURL, coverArt, (int)Thumbs.ThumbResolution, (int)Thumbs.ThumbResolution, 0, Thumbs.SpeedThumbsLarge); } VideoDatabase.SetMovieInfoById(movieDetails.ID, ref movieDetails); VideoDatabase.SetThumbURL(movieDetails.ID, strImageURL); } else { if (movieDetails.ThumbURL == string.Empty) { line1 = GUILocalizeStrings.Get(928) + ":IMP Awards"; OnProgress(line1, movieDetails.Title, string.Empty, -1); IMPawardsSearch impSearch = new IMPawardsSearch(); impSearch.Search(movieDetails.Title); if ((impSearch.Count > 0) && (impSearch[0] != string.Empty)) { movieDetails.ThumbURL = impSearch[0]; } else { line1 = GUILocalizeStrings.Get(928) + ":Amazon"; OnProgress(line1, movieDetails.Title, string.Empty, -1); AmazonImageSearch search = new AmazonImageSearch(); search.Search(movieDetails.Title); if (search.Count > 0) { movieDetails.ThumbURL = search[0]; } } } string largeCoverArt = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, movieDetails.Title); string coverArt = Util.Utils.GetCoverArtName(Thumbs.MovieTitle, movieDetails.Title); Util.Utils.FileDelete(largeCoverArt); Util.Utils.FileDelete(coverArt); line1 = GUILocalizeStrings.Get(1009); OnProgress(line1, movieDetails.Title, string.Empty, -1); //Only get actors if we really want to. if (getActors) { _fetchActorsInMovie(); } OnDisableCancel(this); DownloadCoverArt(Thumbs.MovieTitle, movieDetails.ThumbURL, movieDetails.Title); VideoDatabase.SetMovieInfoById(movieDetails.ID, ref movieDetails); } } else { movieDetails = null; } } catch (ThreadAbortException) { } finally { OnDetailsEnd(this); disableCancel = false; //Log.Info("Ending Thread for Fetching movie details:{0}", detailsThread.ManagedThreadId); detailsThread = null; } } [/CODE] Yet another sugestion. In IMDB.Find(string strMovie) you should leave the strMovie as it. Also remove the UrlEncode of because you can't know if the Grabber use it in URL Format or not. Its ugly to convert it back to original string in Grabber. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
Improvement Suggestions
IMDBFetcher
Contact us
RSS
Top
Bottom