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
FilmInfo+ - A german movie details scraper with auto grouping
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: 1036294" data-attributes="member: 18896"><p>If you look at IMDb+ source, you will see I have the scraper-script option: "global_options_refresh_all_fields"</p><p> </p><p>This controls if all fields get updated, or just some. It is a simple a boolean flag (true/false), and then inside the rest of the script I check that value with simple <if test="${global_options_refresh_all_fields}=true"> check to decide if I allow that block of code to be executed. Because I also need to check if the existing value is empty (for a fresh import or when that info gets updated later) and there is no ADN/OR support for scraper-scripts, I came up with the following solution:</p><p> </p><p>[code] <!-- Verify conditional update. There is no AND or OR support, so this will have to do --></p><p> <if test="${movie.directors}="><set name="update_directors" value="true" /><set name="new_import" value="true" /></if></p><p> <if test="${global_options_refresh_all_fields}=true"><set name="update_directors" value="true" /></if></p><p> <if test="${update_directors}=true">..... (do the actual update of "Directors") ....</if>[/code]</p><p> </p><p>The "Directors" info does not exactly change much once you initially scraped this info, same with the remaining crew/title/etc. Fields I always want to update, such as certification (movie ratings do change over time), score+votes, etc, I just skip the check and use the old code as-is.</p><p> </p><p>The ${new_import} boolean flag is probably not needed for you, but it was needed to fix a bug for IMDb+.</p><p> </p><p>Keep in mind to document it properly. I made the mistake of making the default value of IMDb+ to not update all the fields (which is what I use myself), but this caused a lot of complaints from users that changed configuration options that should have caused a different title, but then the title field would not update.</p></blockquote><p></p>
[QUOTE="RoChess, post: 1036294, member: 18896"] If you look at IMDb+ source, you will see I have the scraper-script option: "global_options_refresh_all_fields" This controls if all fields get updated, or just some. It is a simple a boolean flag (true/false), and then inside the rest of the script I check that value with simple <if test="${global_options_refresh_all_fields}=true"> check to decide if I allow that block of code to be executed. Because I also need to check if the existing value is empty (for a fresh import or when that info gets updated later) and there is no ADN/OR support for scraper-scripts, I came up with the following solution: [code] <!-- Verify conditional update. There is no AND or OR support, so this will have to do --> <if test="${movie.directors}="><set name="update_directors" value="true" /><set name="new_import" value="true" /></if> <if test="${global_options_refresh_all_fields}=true"><set name="update_directors" value="true" /></if> <if test="${update_directors}=true">..... (do the actual update of "Directors") ....</if>[/code] The "Directors" info does not exactly change much once you initially scraped this info, same with the remaining crew/title/etc. Fields I always want to update, such as certification (movie ratings do change over time), score+votes, etc, I just skip the check and use the old code as-is. The ${new_import} boolean flag is probably not needed for you, but it was needed to fix a bug for IMDb+. Keep in mind to document it properly. I made the mistake of making the default value of IMDb+ to not update all the fields (which is what I use myself), but this caused a lot of complaints from users that changed configuration options that should have caused a different title, but then the title field would not update. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
Moving Pictures
FilmInfo+ - A german movie details scraper with auto grouping
Contact us
RSS
Top
Bottom