| 58 | } |
| 59 | |
| 60 | void DirectoryAssetSource::setMetadata(JsonObject metadata) { |
| 61 | if (metadata != m_metadata) { |
| 62 | if (!m_metadataFile) |
| 63 | m_metadataFile = String("/_metadata"); |
| 64 | |
| 65 | m_metadata = std::move(metadata); |
| 66 | |
| 67 | if (m_metadata.empty()) |
| 68 | File::remove(toFilesystem(*m_metadataFile)); |
| 69 | else |
| 70 | File::writeFile(Json(m_metadata).printJson(2, true), toFilesystem(*m_metadataFile)); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | void DirectoryAssetSource::scanAll(String const& assetDirectory, StringList& output) const { |
| 75 | auto shouldIgnore = [this](String const& assetPath) { |