@@ -13,6 +13,7 @@ const db = new MySQLConnector(config.db.scanner);
1313const dbManual = new MySQLConnector ( config . db . manualdb ) ;
1414
1515const masterfile = require ( '../../static/data/masterfile.json' ) ;
16+ const arScanEligible = config . db . scanner . arScanColumn ? ', ar_scan_eligible' : '' ;
1617
1718const dbSelection = ( category ) => {
1819 let dbSelection ;
@@ -383,7 +384,7 @@ const getGyms = async (minLat, maxLat, minLon, maxLon, updated = 0, showRaids =
383384 raid_spawn_timestamp, raid_battle_timestamp, raid_pokemon_id, enabled, availble_slots, updated,
384385 raid_level, ex_raid_eligible, in_battle, raid_pokemon_move_1, raid_pokemon_move_2, raid_pokemon_form,
385386 raid_pokemon_cp, raid_pokemon_gender, raid_is_exclusive, cell_id, total_cp, sponsor_id,
386- raid_pokemon_evolution, raid_pokemon_costume
387+ raid_pokemon_evolution, raid_pokemon_costume${ arScanEligible }
387388 FROM gym
388389 WHERE lat >= ? AND lat <= ? AND lon >= ? AND lon <= ? AND updated > ? AND deleted = false
389390 ${ excludeLevelSQL } AND (
@@ -423,6 +424,12 @@ const getGyms = async (minLat, maxLat, minLon, maxLon, updated = 0, showRaids =
423424 raidBattleTimestamp = null ;
424425 raidPokemonId = null ;
425426 }
427+
428+ let arScanEligible = null ;
429+ if ( config . db . scanner . arScanColumn ) {
430+ arScanEligible = result . ar_scan_eligible ;
431+ }
432+
426433 gyms . push ( {
427434 id : result . id ,
428435 lat : result . lat ,
@@ -453,6 +460,7 @@ const getGyms = async (minLat, maxLat, minLon, maxLon, updated = 0, showRaids =
453460 sponsor_id : result . sponsor_id ,
454461 raid_pokemon_evolution : result . raid_pokemon_evolution ,
455462 raid_pokemon_costume : result . raid_pokemon_costume ,
463+ ar_scan_eligible : arScanEligible ,
456464 } ) ;
457465 }
458466 }
@@ -666,7 +674,7 @@ const getPokestops = async (minLat, maxLat, minLon, maxLon, updated = 0, showPok
666674 SELECT id, lat, lon, name, url, enabled, lure_expire_timestamp, last_modified_timestamp, updated,
667675 quest_type, quest_timestamp, quest_target, CAST(quest_conditions AS CHAR) AS quest_conditions,
668676 CAST(quest_rewards AS CHAR) AS quest_rewards, quest_template, cell_id, lure_id, pokestop_display,
669- incident_expire_timestamp, grunt_type, sponsor_id
677+ incident_expire_timestamp, grunt_type, sponsor_id${ arScanEligible }
670678 FROM pokestop
671679 WHERE lat >= ? AND lat <= ? AND lon >= ? AND lon <= ? AND updated > ? AND deleted = false AND
672680 (false ${ excludeTypeSQL } ${ excludePokemonSQL } ${ excludeEvolutionSQL } ${ excludeItemSQL } ${ excludePokestopSQL } ${ excludeInvasionSQL } )
@@ -723,6 +731,11 @@ const getPokestops = async (minLat, maxLat, minLon, maxLon, updated = 0, showPok
723731 gruntType = null ;
724732 }
725733
734+ let arScanEligible = null ;
735+ if ( config . db . scanner . arScanColumn ) {
736+ arScanEligible = result . ar_scan_eligible ;
737+ }
738+
726739 pokestops . push ( {
727740 id : result . id ,
728741 lat : result . lat ,
@@ -744,7 +757,8 @@ const getPokestops = async (minLat, maxLat, minLon, maxLon, updated = 0, showPok
744757 pokestop_display : pokestopDisplay ,
745758 incident_expire_timestamp : incidentExpireTimestamp ,
746759 grunt_type : gruntType ,
747- sponsor_id : result . sponsor_id
760+ sponsor_id : result . sponsor_id ,
761+ ar_scan_eligible : arScanEligible ,
748762 } ) ;
749763 }
750764 }
0 commit comments