plugin work, page navigation, reticks

This commit is contained in:
Michal Courson
2026-02-26 20:02:22 -05:00
parent 8c83819a17
commit 69c9d80a82
11 changed files with 432 additions and 56 deletions

View File

@ -41,6 +41,8 @@ class MetaDataManager:
if collection is None:
raise ValueError(f"Collection '{collection_name}' does not exist.")
collection["clips"].append(clip_metadata)
if not self.socket is None:
self.socket.emit('collection_updated', collection)
self.save_metadata()
def remove_clip_from_collection(self, collection_name, clip_metadata):
@ -56,11 +58,18 @@ class MetaDataManager:
clip for clip in collection["clips"]
if clip.get("filename") != clip_metadata.get("filename")
]
if not self.socket is None:
self.socket.emit('collection_updated', collection)
self.save_metadata()
def move_clip_to_collection(self, source_collection, target_collection, clip_metadata):
self.remove_clip_from_collection(source_collection, clip_metadata)
self.add_clip_to_collection(target_collection, clip_metadata)
if not self.socket is None:
self.socket.emit('collection_updated', source_collection)
self.socket.emit('collection_updated', target_collection)
def edit_clip_in_collection(self, collection_name, new_clip_metadata):
collection = next((c for c in self.collections if c.get("name") == collection_name), None)
@ -72,6 +81,8 @@ class MetaDataManager:
raise ValueError(f"Clip with filename '{new_clip_metadata.get('filename')}' not found in collection '{collection_name}'.")
collection["clips"][index] = new_clip_metadata
if not self.socket is None:
self.socket.emit('collection_updated', collection)
self.save_metadata()
def get_collections(self):