diff --git a/openflexure_microscope/api/v1/blueprints/camera/capture.py b/openflexure_microscope/api/v1/blueprints/camera/capture.py index 56557f07..80ebed34 100644 --- a/openflexure_microscope/api/v1/blueprints/camera/capture.py +++ b/openflexure_microscope/api/v1/blueprints/camera/capture.py @@ -128,9 +128,7 @@ class ListAPI(MicroscopeView): bayer=bayer) output.put_metadata(metadata) - - for tag in tags: - output.put_tag(str(tag)) + output.put_tags(tags) return jsonify(output.state) diff --git a/openflexure_microscope/camera/capture.py b/openflexure_microscope/camera/capture.py index 45f0d50d..77cac513 100644 --- a/openflexure_microscope/camera/capture.py +++ b/openflexure_microscope/camera/capture.py @@ -264,16 +264,18 @@ class CaptureObject(object): return False # HANDLE TAGS - def put_tag(self, tag: str): + def put_tags(self, tags: list): """ Add a new tag to the ``tags`` list attribute. Args: - tag (str): Tag to be added + tag (list): List of tags to be added """ - if not tag in self.tags: - self.tags.append(tag) - self.save_metadata() + for tag in tags: + if not tag in self.tags: + self.tags.append(tag) + + self.save_metadata() def delete_tag(self, tag: str): """