| 32 | } |
| 33 | |
| 34 | bool save_dlcs(AppId_t app_id, const std::vector<DLC>& dlcs) noexcept { |
| 35 | static std::mutex section; |
| 36 | const std::lock_guard lock(section); |
| 37 | |
| 38 | try { |
| 39 | LOG_DEBUG("Caching DLC IDs for the app: {}", app_id); |
| 40 | |
| 41 | auto apps = get_cached_apps(); |
| 42 | |
| 43 | apps[std::to_string(app_id)] = App{.dlcs = DLC::get_dlc_map_from_vector(dlcs)}; |
| 44 | |
| 45 | return koalabox::cache::put(KEY_APPS, nlohmann::json(apps)); |
| 46 | } catch(const std::exception& e) { |
| 47 | LOG_ERROR("Error saving DLCs to disk cache: {}", e.what()); |
| 48 | |
| 49 | return false; |
| 50 | } |
| 51 | } |
| 52 | } |
no test coverage detected