Merge pull request #188 into master

98adf3d container: fetch: prices: crypto: mobula: isolate given year (Aaron Fiore)
This commit was merged in pull request #188.
This commit is contained in:
2025-03-25 11:15:12 -07:00

View File

@@ -200,8 +200,15 @@ namespace docker_finance\prices\internal\prices\crypto
$timestamp = $prices[$i][0] / 1000;
$date = date('Y/m/d', $timestamp);
$price = $prices[$i][1];
// Isolate given year
$given_year = $this->get_env()->get_env('API_FETCH_YEAR');
if ($given_year != 'all' && !preg_match('/^'.$given_year.'\//', $date)) {
utils\CLI::print_debug("skipping $date");
continue;
}
$price = $prices[$i][1];
$stack += [$date => $price];
}