From fd3dec4deea8dcbcea814d939e1ed4f8b8d71ecd Mon Sep 17 00:00:00 2001 From: Florian Spiess Date: Tue, 26 Oct 2021 13:05:35 +0200 Subject: [PATCH] Renamed Metadata variables to be more backwards compatible. --- .../CineastApi/Model/Data/ObjectData.cs | 12 ++++++------ .../CineastApi/Model/Data/SegmentData.cs | 12 ++++++------ .../CineastApi/Model/Registries/ObjectRegistry.cs | 4 ++-- package.json | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Data/ObjectData.cs b/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Data/ObjectData.cs index e6f16a9..76b283e 100644 --- a/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Data/ObjectData.cs +++ b/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Data/ObjectData.cs @@ -31,7 +31,7 @@ public class ObjectData /// private List _segments; - public ObjectMetadataStore ObjectMetadata { get; private set; } + public ObjectMetadataStore Metadata { get; private set; } /// /// Constructs a new instance with the given id, for lazy loading. @@ -39,7 +39,7 @@ public class ObjectData public ObjectData(string id) { _id = id; - ObjectMetadata = new ObjectMetadataStore(_id); + Metadata = new ObjectMetadataStore(_id); } /// @@ -48,7 +48,7 @@ public ObjectData(string id) public ObjectData(MediaObjectDescriptor descriptor) { _id = descriptor.ObjectId; - ObjectMetadata = new ObjectMetadataStore(_id); + Metadata = new ObjectMetadataStore(_id); Initialize(descriptor); } @@ -89,7 +89,7 @@ private async Task InitializeAsync(bool withMetadata = true) if (withMetadata) { - await ObjectMetadata.InitializeAsync(); + await Metadata.InitializeAsync(); } } finally @@ -122,14 +122,14 @@ public void Initialize(MediaObjectDescriptor descriptor) public void InitializeMeta(MediaObjectMetadataQueryResult meta) { - if (ObjectMetadata.Initialized) + if (Metadata.Initialized) { Debug.LogWarning("Attempt to initialize already initialized object metadata for media object with id " + $"\"{Id}\". Using cached data."); return; } - ObjectMetadata.Initialize(meta); + Metadata.Initialize(meta); } /// diff --git a/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Data/SegmentData.cs b/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Data/SegmentData.cs index 65d7b57..deb4f3e 100644 --- a/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Data/SegmentData.cs +++ b/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Data/SegmentData.cs @@ -27,20 +27,20 @@ public class SegmentData // TODO: Consider combining lazy loading requests into batch requests every x seconds to reduce request overhead private static readonly SemaphoreSlim InitLock = new SemaphoreSlim(1, 1); - public SegmentMetadataStore SegmentMetadata { get; private set; } + public SegmentMetadataStore Metadata { get; private set; } public SegmentData(string id) { _id = id; - SegmentMetadata = new SegmentMetadataStore(_id); + Metadata = new SegmentMetadataStore(_id); } public SegmentData(MediaSegmentDescriptor descriptor) { _descriptor = descriptor; _id = descriptor.SegmentId; - SegmentMetadata = new SegmentMetadataStore(_id); + Metadata = new SegmentMetadataStore(_id); Initialized = true; } @@ -70,7 +70,7 @@ private async Task InitializeAsync(bool withMetadata = true) if (withMetadata) { - await SegmentMetadata.InitializeAsync(); + await Metadata.InitializeAsync(); } } finally @@ -105,14 +105,14 @@ public void Initialize(MediaSegmentDescriptor data) public void InitializeMeta(MediaSegmentMetadataQueryResult meta) { - if (SegmentMetadata.Initialized) + if (Metadata.Initialized) { Debug.LogWarning("Attempt to initialize already initialized segment metadata for media object with " + $"id \"{Id}\". Using cached data."); return; } - SegmentMetadata.Initialize(meta); + Metadata.Initialize(meta); } /// diff --git a/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Registries/ObjectRegistry.cs b/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Registries/ObjectRegistry.cs index a9daaf9..aab3bca 100644 --- a/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Registries/ObjectRegistry.cs +++ b/Runtime/Vitrivr/UnityInterface/CineastApi/Model/Registries/ObjectRegistry.cs @@ -93,14 +93,14 @@ public static async Task BatchFetchObjectDataWithMeta(List objects) public static async Task BatchFetchObjectMetadata(IEnumerable objects) { - var toInitObj = objects.Where(obj => !obj.ObjectMetadata.Initialized).ToList(); + var toInitObj = objects.Where(obj => !obj.Metadata.Initialized).ToList(); var toInit = toInitObj.Select(obj => obj.Id).ToList(); Debug.Log($"Having to initialise {toInit.Count} obj's metadata"); var result = await Task.Run(() => CineastWrapper.MetadataApi.FindMetadataForObjectIdBatchedAsync(new OptionallyFilteredIdList(ids: toInit))); foreach (var obj in toInitObj) { - obj.ObjectMetadata.Initialize(result); + obj.Metadata.Initialize(result); } Debug.Log("Finished fetching obj"); } diff --git a/package.json b/package.json index 15f407f..ba1ffbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "org.vitrivr.unityinterface.cineastapi", - "version": "1.0.0-SNAPSHOT", + "version": "0.0.1", "displayName": "Cineast Unity Interface", "description": "An all-unity client for [Cineast](https://github.com/vitrivr/cineast/).", "unity": "2019.4",