diff --git a/firefly.windows.spec b/firefly.windows.spec old mode 100644 new mode 100755 index 7dd439a..0348f38 --- a/firefly.windows.spec +++ b/firefly.windows.spec @@ -1,49 +1,49 @@ -# -*- mode: python ; coding: utf-8 -*- - - -block_cipher = None - - -a = Analysis( - ['firefly\\__main__.py'], - pathex=[], - binaries=[], - hiddenimports=[], - hookspath=[], - hooksconfig={}, - runtime_hooks=[], - excludes=[], - datas=[ - ("images/*.png", "images"), - ("images/*.ico", "images"), - ("skin.css", "."), - ("mpv-1.dll", "."), - ], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False, -) -pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) - -exe = EXE( - pyz, - a.scripts, - a.binaries, - a.zipfiles, - a.datas, - [], - name='firefly', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - runtime_tmpdir=None, - console=True, - disable_windowed_traceback=False, - argv_emulation=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None, - icon=['images\\firefly.ico'], -) +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis( + ['firefly\\__main__.py'], + pathex=[], + binaries=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + datas=[ + ("images/*.png", "images"), + ("images/*.ico", "images"), + ("skin.css", "."), + ("mpv-1.dll", "."), + ], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='firefly', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon=['images\\firefly.ico'], +) diff --git a/firefly/__init__.py b/firefly/__init__.py index 1212848..018efa3 100644 --- a/firefly/__init__.py +++ b/firefly/__init__.py @@ -1,4 +1,4 @@ -__version__ = "6.0.0" +__version__ = "6.0.1" from firefly.config import config from firefly.settings import Settings diff --git a/firefly/components/input_datetime.py b/firefly/components/input_datetime.py index 48f4449..9577cd2 100644 --- a/firefly/components/input_datetime.py +++ b/firefly/components/input_datetime.py @@ -53,6 +53,8 @@ def __init__(self, parent, value=None, **kwargs): self.clear_button.setText("Clear") self.clear_button.clicked.connect(self.clear_value) layout.addWidget(self.clear_button, 0) + else: + self.clear_button = None self.setLayout(layout) self.set_value(value) @@ -91,4 +93,5 @@ def get_value(self): def setReadOnly(self, value): self._read_only = value self.end_edit() - self.clear_button.setEnabled(not value) + if self.clear_button: + self.clear_button.setEnabled(not value) diff --git a/firefly/main_window.py b/firefly/main_window.py index 0743a94..473713c 100644 --- a/firefly/main_window.py +++ b/firefly/main_window.py @@ -98,7 +98,7 @@ def __init__(self, main_window): self.switch_tab(current_tab) else: self.on_switch_tab() - + self.main_window.statusBar().showMessage("Firefly is ready") self.tabs.currentChanged.connect(self.on_switch_tab) def on_close(self): diff --git a/firefly/modules/detail/__init__.py b/firefly/modules/detail/__init__.py index 6ebf0af..7cfac5b 100644 --- a/firefly/modules/detail/__init__.py +++ b/firefly/modules/detail/__init__.py @@ -1,6 +1,3 @@ -import time - -from nxtools import format_time from PySide6.QtCore import Qt from PySide6.QtGui import QFontDatabase from PySide6.QtWidgets import ( @@ -325,17 +322,21 @@ def on_revert(self): self.focus(asset_cache[self.asset.id], silent=True) def on_set_qc(self, state): - state_name = {0: "New", 3: "Rejected", 4: "Approved"}[state] - report = ( - f"{format_time(time.time())} : {firefly.user} " - f"flagged the asset as {state_name}" - ) - - if self.asset["qc/report"]: - report = self.asset["qc/report"] + "\n" + report + # state_name = {0: "New", 3: "Rejected", 4: "Approved"}[state] + # report = ( + # f"{format_time(time.time())} : {firefly.user} " + # f"flagged the asset as {state_name}" + # ) + # + # if self.asset["qc/report"]: + # report = self.asset["qc/report"] + "\n" + report response = api.set( - id=self.asset.id, data={"qc/state": state, "qc/report": report} + id=self.asset.id, + data={ + "qc/state": state, + # "qc/report": report + }, ) if not response: log.error(response.message) diff --git a/firefly/modules/rundown/__init__.py b/firefly/modules/rundown/__init__.py index e93bc75..e85453f 100644 --- a/firefly/modules/rundown/__init__.py +++ b/firefly/modules/rundown/__init__.py @@ -178,7 +178,8 @@ def set_channel(self, id_channel): def on_channel_changed(self): self.load(do_update_header=True) - self.plugins.load() + if self.plugins: + self.plugins.load() if self.mcr: self.mcr.on_channel_changed() @@ -298,20 +299,34 @@ def seismic_handler(self, message): if message.data["id_channel"] != self.id_channel: return + affected_items = [ + self.current_item, + self.cued_item, + message.data["current_item"], + message.data["cued_item"], + ] + + do_refresh = False if message.data["current_item"] != self.current_item: self.current_item = message.data["current_item"] - self.view.model().refresh_items([self.current_item]) + self.cued_item = message.data["cued_item"] + do_refresh = True if message.data["cued_item"] != self.cued_item: model = self.view.model() + self.current_item = message.data["current_item"] self.cued_item = message.data["cued_item"] - for obj in model.object_data: - if obj.object_type == "item" and obj.id == self.cued_item: - if self.mcr and self.mcr.isVisible(): + + if self.mcr.isVisible(): + for obj in model.object_data: + if obj.object_type == "item" and obj.id == self.cued_item: self.load() - else: - self.view.model().refresh_items([self.current_item]) - break + break + else: + do_refresh = True + + if do_refresh: + self.view.model().refresh_items(affected_items) if self.mcr: self.mcr.seismic_handler(message) @@ -329,7 +344,7 @@ def seismic_handler(self, message): self.refresh_assets(*message.data["objects"]) elif message.topic == "job_progress": - if self.playout_config.send_action == message.data["id_action"]: + if self.playout_config.send_action == message.data.get("id_action", -1): model = self.view.model() for row, obj in enumerate(model.object_data): if obj["id_asset"] == message.data["id_asset"]: diff --git a/firefly/modules/rundown/model.py b/firefly/modules/rundown/model.py index 8a2fef9..f021cbc 100644 --- a/firefly/modules/rundown/model.py +++ b/firefly/modules/rundown/model.py @@ -105,6 +105,8 @@ def load_callback(self, response): item.id_channel = self.id_channel if row.get("id_asset"): item._asset = asset_cache.get(row["id_asset"]) + item._asset.meta.pop("mark_in", None) + item._asset.meta.pop("mark_out", None) required_assets.append([row["id_asset"], row["asset_mtime"]]) else: item._asset = None @@ -144,7 +146,6 @@ def refresh_items(self, items): self.dataChanged.emit( self.index(row, 0), self.index(row, len(self.header_data) - 1) ) - break def flags(self, index): flags = super(RundownModel, self).flags(index) diff --git a/firefly/modules/rundown/view.py b/firefly/modules/rundown/view.py index e093257..9132a41 100644 --- a/firefly/modules/rundown/view.py +++ b/firefly/modules/rundown/view.py @@ -125,6 +125,11 @@ def contextMenuEvent(self, event): action_split.triggered.connect(self.on_split) menu.addAction(action_split) + action_set_primary = QAction("Set as primary", self) + action_set_primary.setStatusTip("Set selected item as primary") + action_set_primary.triggered.connect(self.on_set_primary) + menu.addAction(action_set_primary) + if obj_set[0] == "item" and ( self.selected_objects[0]["id_asset"] or self.selected_objects[0]["item_role"] == "live" @@ -331,6 +336,22 @@ def on_split(self): ) self.model().load() + def on_set_primary(self): + item = self.selected_objects[0] + asset = item._asset + if not asset: + return + + emeta = {} + for field in self.playout_config.fields: + key = field.name + if key in asset.meta: + emeta[key] = asset.meta[key] + emeta["id_asset"] = asset.id + + api.set(object_type="event", id=item["id_event"], data=emeta) + self.model().load() + def on_solve(self, solver): QApplication.processEvents() QApplication.setOverrideCursor(Qt.CursorShape.WaitCursor) diff --git a/firefly/modules/scheduler/__init__.py b/firefly/modules/scheduler/__init__.py index 464a2d7..b974c24 100644 --- a/firefly/modules/scheduler/__init__.py +++ b/firefly/modules/scheduler/__init__.py @@ -59,6 +59,8 @@ def focus(self, objects): # self.calendar.update() def open_rundown(self, ts, event=False): + if not self.main_window.main_widget.rundown: + return self.main_window.main_widget.rundown.load(start_time=ts, event=event) self.main_window.main_widget.switch_tab( self.main_window.main_widget.rundown, perform_on_switch_tab=False diff --git a/firefly/objects/format.py b/firefly/objects/format.py index 5407bdc..a72bed4 100644 --- a/firefly/objects/format.py +++ b/firefly/objects/format.py @@ -300,6 +300,9 @@ def foreground(self, obj, **kwargs): def font(self, obj, **kwargs): if obj.object_type == "event": return "bold" + elif obj.object_type == "item": + if obj.get("is_primary"): + return "bold" format_helpers_list = [ diff --git a/pyproject.toml b/pyproject.toml index 5fa33cb..d6ce897 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "firefly" -version = "6.0.0" +version = "6.0.1" description = "Desktop client application for Nebula - Open source media asset management and broadcast automation system." authors = ["Nebula Broadcast "]