/** * Execute the console command. * * @return mixed */ public function handle() { $action = $this->argument('action'); switch ($action) { case 'load': if ($this->option('gameid')) { $this->info('Load game with id: ' . $this->option('gameid') . ' to db'); $this->steamApi->loadGame($this->option('gameid')); $this->info('Done loading game with id: ' . $this->option('gameid') . ' to db'); break; } $this->info('Load all games to db'); $this->steamApi->loadGames(); $this->info('Done loading all games to db'); break; case 'update': if ($this->option('rpg')) { $this->info('Updating games'); $this->steamApi->updateRecentlyPlayedGames(); $this->info('Done updating games'); break; } $this->info('Updating games'); $this->steamApi->updateGames(); $this->info('Done updating games'); break; default: echo 'Use load or update'; } }
/** * Execute the console command. * * @return mixed */ public function handle() { $action = $this->argument('action'); switch ($action) { case 'movie': $this->info('Sync 10 latest movies to db'); $this->traktTv->setType('movies'); $this->traktTv->setExtended('full,images'); $this->traktTv->syncWatched($this); $this->info('Done syncing 10 latest movies to db'); break; default: echo 'Use movie'; } }
/** * Execute the console command. * * @return mixed */ public function handle() { $action = $this->argument('action'); switch ($action) { case 'movie': $this->info('Load all movies to db'); $this->traktTv->setType('movies'); $this->traktTv->setExtended('full,images'); $this->traktTv->loadWatched(); $this->info('Done loading all movies to db'); break; default: echo 'Use movie'; } }
/** * SteamAPIGameSchema constructor. * * @param SteamGame $SteamGame */ public function __construct(SteamGame $SteamGame) { parent::__construct(); if (!$SteamGame->id || in_array($SteamGame->id, SteamGame::getGamesWithNoStats())) { return false; } $this->localfile = 'SteamApi/GetSchemaForGame/' . $SteamGame->id . '.json'; $SteamGameSchemaFromAPI = $this->getSchemaForGameFromApi($SteamGame->id); if (empty($SteamGameSchemaFromAPI)) { return false; } if (!empty($SteamGameSchemaFromAPI->achievements)) { $this->parseAndSaveAchievementSchema($SteamGame->id, $SteamGameSchemaFromAPI->achievements); } if (!empty($SteamGameSchemaFromAPI->stats)) { $this->parseAndSaveStatSchema($SteamGame->id, $SteamGameSchemaFromAPI->stats); } if (!empty($SteamGameSchemaFromAPI->achievements) || !empty($SteamGameSchemaFromAPI->stats)) { $this->success = $this->setGameTimestampForSchema($SteamGame->id); } if ($this->success === true) { Log::info('Schema was updated for ' . $SteamGame->name . ' : ' . $SteamGame->id); } else { Log::error('Schema was NOT updated for ' . $SteamGame->name . ' : ' . $SteamGame->id); } return true; }
/** * SteamAPIGameDescription constructor. * * @param SteamGame $SteamGame */ public function __construct(SteamGame $SteamGame) { parent::__construct(); $this->SteamGame = $SteamGame; $this->localfile = 'SteamApi/SteamApiAppDetails/' . $this->SteamGame->id . '.json'; $this->GameDescriptionJson = $this->getSteamGameDescriptionFromUrl($this->SteamGame->id); $this->success = $this->updateSteamGameWithNewDescription($this->SteamGame, $this->GameDescriptionJson); if ($this->success === true) { Log::info('Description was updated for ' . $this->SteamGame->name . ' : ' . $this->SteamGame->id); } else { Log::error('Description was NOT updated for ' . $this->SteamGame->name . ' : ' . $this->SteamGame->id); } return true; }