| 263 | |
| 264 | |
| 265 | void Manager::cleanAutosave() { |
| 266 | // Remove files and directories in the `autosave/modules` directory that doesn't match a module in the rack. |
| 267 | std::string modulesDir = system::join(autosavePath, "modules"); |
| 268 | if (system::isDirectory(modulesDir)) { |
| 269 | for (const std::string& entry : system::getEntries(modulesDir)) { |
| 270 | try { |
| 271 | int64_t moduleId = std::stoll(system::getFilename(entry)); |
| 272 | // Ignore modules that exist in the rack |
| 273 | if (APP->engine->getModule(moduleId)) |
| 274 | continue; |
| 275 | } |
| 276 | catch (std::invalid_argument& e) {} |
| 277 | catch (std::out_of_range& e) {} |
| 278 | // Remove the entry. |
| 279 | system::removeRecursively(entry); |
| 280 | } |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | |
| 285 | static bool isPatchLegacyV1(std::string path) { |
nothing calls this directly
no test coverage detected