Skip to content

Commit

Permalink
Added configure option to disable scraping of mamedb.com
Browse files Browse the repository at this point in the history
  • Loading branch information
mickelson committed Nov 5, 2016
1 parent c3f73b5 commit 0e4455d
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/language/de.msg
Original file line number Diff line number Diff line change
Expand Up @@ -386,5 +386,6 @@ _help_generator_opt;Set whether this emulator is to be included in the generated
_help_input_default_action;Set the default behaviour for this control
_help_language;Select the language to use in Attract-Mode's user interface
_help_multiple_monitors;Enable the use of multiple monitors by Attract-Mode
_help_scrape_mamedb;Set whether mame snaps and marquees should be scraped from mamedb.com
_help_startup_mode;Set what should happen when Attract-Mode first starts up
_help_video_decoder;Configure the decoder to use for video playback (if multiple decoders are available)
1 change: 1 addition & 0 deletions config/language/en.msg
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ _help_rule_target;The game information attribute that you wish to filter based o
_help_rule_value;The regular expression value to filter to. For example, if the filter target is "Year" and comparison is "equals", a value of "1984" will match the year of 1984, "198." will match any year in the 80s, and "(198.)|(199.)" will match any year in the 80s or 90s
_help_scrape_fanart;Set whether game fanart should be downloaded when scraping
_help_scrape_flyers;Set whether game flyers and box covers should be downloaded when scraping
_help_scrape_mamedb;Set whether mame snaps and marquees should be scraped from mamedb.com
_help_scrape_marquees;Set whether game marquees and banners should be downloaded when scraping
_help_scrape_snaps;Set whether game snapshots should be downloaded when scraping
_help_scrape_vids;Set whether game videos should be downloaded when scraping
Expand Down
1 change: 1 addition & 0 deletions config/language/es.msg
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@ _help_generator_opt;Set whether this emulator is to be included in the generated
_help_input_default_action;Set the default behaviour for this control
_help_language;Select the language to use in Attract-Mode's user interface
_help_multiple_monitors;Enable the use of multiple monitors by Attract-Mode
_help_scrape_mamedb;Set whether mame snaps and marquees should be scraped from mamedb.com
_help_startup_mode;Set what should happen when Attract-Mode first starts up
_help_video_decoder;Configure the decoder to use for video playback (if multiple decoders are available)
1 change: 1 addition & 0 deletions config/language/fr.msg
Original file line number Diff line number Diff line change
Expand Up @@ -390,5 +390,6 @@ _help_generator_opt;Set whether this emulator is to be included in the generated
_help_input_action;
_help_input_default_action;Set the default behaviour for this control
_help_multiple_monitors;Enable the use of multiple monitors by Attract-Mode
_help_scrape_mamedb;Set whether mame snaps and marquees should be scraped from mamedb.com
_help_startup_mode;Set what should happen when Attract-Mode first starts up
_help_video_decoder;Configure the decoder to use for video playback (if multiple decoders are available)
1 change: 1 addition & 0 deletions config/language/it.msg
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,4 @@ _help_displays_menu_prompt;The 'Displays Menu' prompt (i.e. "Select System")
_help_emu_sel_gen_romlist;Generate a Collection/Romlist containing games for multiple emulators
_help_generator_build;Generate romlist with the selected emulator(s)
_help_generator_opt;Set whether this emulator is to be included in the generated romlist
_help_scrape_mamedb;Set whether mame snaps and marquees should be scraped from mamedb.com
1 change: 1 addition & 0 deletions config/language/jp.msg
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ _help_input_action;
_help_input_default_action;Set the default behaviour for this control
_help_intro;Configure intro
_help_multiple_monitors;Enable the use of multiple monitors by Attract-Mode
_help_scrape_mamedb;Set whether mame snaps and marquees should be scraped from mamedb.com
_help_scrape_vids;Set whether game videos should be downloaded when scraping
_help_startup_mode;Set what should happen when Attract-Mode first starts up
_help_video_decoder;Configure the decoder to use for video playback (if multiple decoders are available)
1 change: 1 addition & 0 deletions config/language/kr.msg
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ _help_input_action;
_help_input_default_action;Set the default behaviour for this control
_help_intro;Configure intro
_help_multiple_monitors;Enable the use of multiple monitors by Attract-Mode
_help_scrape_mamedb;Set whether mame snaps and marquees should be scraped from mamedb.com
_help_scrape_vids;Set whether game videos should be downloaded when scraping
_help_startup_mode;Set what should happen when Attract-Mode first starts up
_help_video_decoder;Configure the decoder to use for video playback (if multiple decoders are available)
1 change: 1 addition & 0 deletions config/language/msg_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ _help_rule_target;The game information attribute that you wish to filter based o
_help_rule_value;The regular expression value to filter to. For example, if the filter target is "Year" and comparison is "equals", a value of "1984" will match the year of 1984, "198." will match any year in the 80s, and "(198.)|(199.)" will match any year in the 80s or 90s
_help_scrape_fanart;Set whether game fanart should be downloaded when scraping
_help_scrape_flyers;Set whether game flyers and box covers should be downloaded when scraping
_help_scrape_mamedb;Set whether mame snaps and marquees should be scraped from mamedb.com
_help_scrape_marquees;Set whether game marquees and banners should be downloaded when scraping
_help_scrape_snaps;Set whether game snapshots should be downloaded when scraping
_help_scrape_vids;Set whether game videos should be downloaded when scraping
Expand Down
9 changes: 9 additions & 0 deletions src/fe_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,12 @@ void FeScraperMenu::get_options( FeConfigContext &ctx )
"_help_scrape_vids" );
ctx.back_opt().append_vlist( bool_opts );

ctx.add_optl( Opt::LIST,
"Scrape mamedb.com (MAME only)",
ctx.fe_settings.get_info_bool( FeSettings::ScrapeMameDB ) ? bool_opts[0] : bool_opts[1],
"_help_scrape_mamedb" );
ctx.back_opt().append_vlist( bool_opts );

FeBaseConfigMenu::get_options( ctx );
}

Expand All @@ -1735,6 +1741,9 @@ bool FeScraperMenu::save( FeConfigContext &ctx )
ctx.fe_settings.set_info( FeSettings::ScrapeVids,
ctx.opt_list[5].get_vindex() == 0 ? FE_CFG_YES_STR : FE_CFG_NO_STR );

ctx.fe_settings.set_info( FeSettings::ScrapeMameDB,
ctx.opt_list[6].get_vindex() == 0 ? FE_CFG_YES_STR : FE_CFG_NO_STR );

return true;
}

Expand Down
8 changes: 8 additions & 0 deletions src/fe_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ FeSettings::FeSettings( const std::string &config_path,
m_scrape_wheels( true ),
m_scrape_fanart( false ),
m_scrape_vids( false ),
m_scrape_mamedb( true ),
#ifdef SFML_SYSTEM_WINDOWS
m_hide_console( false ),
#endif
Expand Down Expand Up @@ -427,6 +428,7 @@ const char *FeSettings::configSettingStrings[] =
"scrape_wheels",
"scrape_fanart",
"scrape_videos",
"scrape_mamedb",
#ifdef SFML_SYSTEM_WINDOWS
"hide_console",
#endif
Expand Down Expand Up @@ -2521,6 +2523,8 @@ bool FeSettings::get_info_bool( int index ) const
return m_scrape_fanart;
case ScrapeVids:
return m_scrape_vids;
case ScrapeMameDB:
return m_scrape_mamedb;
#ifdef SFML_SYSTEM_WINDOWS
case HideConsole:
return m_hide_console;
Expand Down Expand Up @@ -2692,6 +2696,10 @@ bool FeSettings::set_info( int index, const std::string &value )
m_scrape_vids = config_str_to_bool( value );
break;

case ScrapeMameDB:
m_scrape_mamedb = config_str_to_bool( value );
break;

#ifdef SFML_SYSTEM_WINDOWS
case HideConsole:
m_hide_console = config_str_to_bool( value );
Expand Down
2 changes: 2 additions & 0 deletions src/fe_settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class FeSettings : public FeBaseConfigurable
ScrapeWheels,
ScrapeFanArt,
ScrapeVids,
ScrapeMameDB,
#ifdef SFML_SYSTEM_WINDOWS
HideConsole,
#endif
Expand Down Expand Up @@ -196,6 +197,7 @@ class FeSettings : public FeBaseConfigurable
bool m_scrape_wheels;
bool m_scrape_fanart;
bool m_scrape_vids;
bool m_scrape_mamedb;
#ifdef SFML_SYSTEM_WINDOWS
bool m_hide_console;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/scraper_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ bool FeSettings::mameps_scraper( FeImporterContext &c )
bool FeSettings::mamedb_scraper( FeImporterContext &c )
{
#ifndef NO_NET
if ( !c.emulator.is_mame() || ( !m_scrape_snaps && !m_scrape_marquees ))
if ( !c.emulator.is_mame() || !m_scrape_mamedb || ( !m_scrape_snaps && !m_scrape_marquees ))
return true;

//
Expand Down

0 comments on commit 0e4455d

Please sign in to comment.