mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-27 07:18:57 -06:00
Include the version number in the uid of the HttpSynchronization (closes #2081)
This commit is contained in:
@@ -495,14 +495,13 @@ void AssetManager::setUpAssetLuaTable(Asset* asset) {
|
||||
Asset* thisAsset = ghoul::lua::userData<Asset>(L, 2);
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::syncedResourceLua");
|
||||
ghoul::Dictionary d = ghoul::lua::value<ghoul::Dictionary>(L);
|
||||
|
||||
std::string uid = ResourceSynchronization::generateUid(d);
|
||||
std::unique_ptr<ResourceSynchronization> s =
|
||||
ResourceSynchronization::createFromDictionary(d);
|
||||
|
||||
std::string uid = d.value<std::string>("Type") + "/" + s->generateUid();
|
||||
SyncItem* syncItem = nullptr;
|
||||
auto it = manager->_synchronizations.find(uid);
|
||||
if (it == manager->_synchronizations.end()) {
|
||||
std::unique_ptr<ResourceSynchronization> s =
|
||||
ResourceSynchronization::createFromDictionary(d);
|
||||
|
||||
auto si = std::make_unique<SyncItem>();
|
||||
si->synchronization = std::move(s);
|
||||
si->assets.push_back(thisAsset);
|
||||
|
||||
@@ -68,11 +68,6 @@ std::unique_ptr<ResourceSynchronization> ResourceSynchronization::createFromDict
|
||||
return std::unique_ptr<ResourceSynchronization>(sync);
|
||||
}
|
||||
|
||||
std::string ResourceSynchronization::generateUid(const ghoul::Dictionary& dictionary) {
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
return fmt::format("{}/{}", p.type, p.identifier);
|
||||
}
|
||||
|
||||
ResourceSynchronization::ResourceSynchronization(
|
||||
std::filesystem::path synchronizationRoot)
|
||||
: _synchronizationRoot(std::move(synchronizationRoot))
|
||||
|
||||
Reference in New Issue
Block a user