Commit 05f52bbd authored by Joel Collins's avatar Joel Collins
Browse files

Process all initial tags in one call

parent 340b3dda
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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)

+7 −5
Original line number Diff line number Diff line
@@ -264,15 +264,17 @@ 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
        """
        for tag in tags:
            if not tag in self.tags:
                self.tags.append(tag)

        self.save_metadata()

    def delete_tag(self, tag: str):