mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-16 04:54:42 +08:00
version: sunnypilot v2026.002.000 (dev)
date: 2026-06-09T06:39:10
master commit: 01a843e0ac
15 lines
491 B
C++
15 lines
491 B
C++
#include "tools/replay/filereader.h"
|
|
|
|
#include "common/util.h"
|
|
#include "tools/replay/py_downloader.h"
|
|
|
|
std::string FileReader::read(const std::string &file, std::atomic<bool> *abort) {
|
|
const bool is_remote = (file.find("https://") == 0) || (file.find("http://") == 0);
|
|
if (is_remote) {
|
|
std::string local_path = PyDownloader::download(file, cache_to_local_, abort);
|
|
if (local_path.empty()) return {};
|
|
return util::read_file(local_path);
|
|
}
|
|
return util::read_file(file);
|
|
}
|