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
Scraper support of backdrop loading
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="mitiok2008" data-source="post: 477962" data-attributes="member: 88086"><p>Thank for the link. I found there the following code (file <strong>ScriptableProvider.cs</strong>)</p><p>[CODE] public bool GetBackdrop(DBMovieInfo movie) {</p><p> if (scraper == null)</p><p> return false;</p><p></p><p></p><p> Dictionary<string, string> paramList = new Dictionary<string, string>();</p><p> Dictionary<string, string> results;</p><p></p><p></p><p> // if we already have a backdrop move on for now</p><p> if (movie.BackdropFullPath.Trim().Length > 0)</p><p> return true;</p><p></p><p></p><p> // try to load the id for the movie for this script</p><p> DBSourceMovieInfo idObj = movie.GetSourceMovieInfo(ScriptID);</p><p> if (idObj != null && idObj.Identifier != null)</p><p> paramList["movie.site_id"] = idObj.Identifier;</p><p></p><p></p><p> // load params for scraper</p><p> foreach (DBField currField in DBField.GetFieldList(typeof(DBMovieInfo)))</p><p> if (currField.GetValue(movie) != null)</p><p> paramList["movie." + currField.FieldName] = currField.GetValue(movie).ToString().Trim();</p><p></p><p></p><p> // run the scraper</p><p> results = scraper.Execute("get_backdrop", paramList);</p><p> if (results == null) {</p><p> logger.Error(Name + " scraper script failed to execute \"get_backdrop\" node.");</p><p> return false;</p><p> }</p><p></p><p></p><p> int count = 0;</p><p> string backdropURL = string.Empty;</p><p></p><p></p><p> // Loop through all the results until a valid backdrop is found</p><p> // todo: support multiple backdrops</p><p> while (results.ContainsKey("backdrop[" + count + "].url")) {</p><p> backdropURL = results["backdrop[" + count + "].url"]; </p><p> if (backdropURL.Trim().Length > 0)</p><p> if (movie.AddBackdropFromURL(backdropURL) == ArtworkLoadStatus.SUCCESS)</p><p> return true;</p><p></p><p></p><p> count++;</p><p> }</p><p> </p><p> // no valid backdrop found</p><p> return false;</p><p> }[/CODE]</p><p></p><p>Does it mean that I can load backdrops from a script?</p></blockquote><p></p>
[QUOTE="mitiok2008, post: 477962, member: 88086"] Thank for the link. I found there the following code (file [B]ScriptableProvider.cs[/B]) [CODE] public bool GetBackdrop(DBMovieInfo movie) { if (scraper == null) return false; Dictionary<string, string> paramList = new Dictionary<string, string>(); Dictionary<string, string> results; // if we already have a backdrop move on for now if (movie.BackdropFullPath.Trim().Length > 0) return true; // try to load the id for the movie for this script DBSourceMovieInfo idObj = movie.GetSourceMovieInfo(ScriptID); if (idObj != null && idObj.Identifier != null) paramList["movie.site_id"] = idObj.Identifier; // load params for scraper foreach (DBField currField in DBField.GetFieldList(typeof(DBMovieInfo))) if (currField.GetValue(movie) != null) paramList["movie." + currField.FieldName] = currField.GetValue(movie).ToString().Trim(); // run the scraper results = scraper.Execute("get_backdrop", paramList); if (results == null) { logger.Error(Name + " scraper script failed to execute \"get_backdrop\" node."); return false; } int count = 0; string backdropURL = string.Empty; // Loop through all the results until a valid backdrop is found // todo: support multiple backdrops while (results.ContainsKey("backdrop[" + count + "].url")) { backdropURL = results["backdrop[" + count + "].url"]; if (backdropURL.Trim().Length > 0) if (movie.AddBackdropFromURL(backdropURL) == ArtworkLoadStatus.SUCCESS) return true; count++; } // no valid backdrop found return false; }[/CODE] Does it mean that I can load backdrops from a script? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
Moving Pictures
Scraper support of backdrop loading
Contact us
RSS
Top
Bottom