Skip to content

Commit

Permalink
Merge pull request #21 from nebulabroadcast/develop
Browse files Browse the repository at this point in the history
Firefly 6.0.1
  • Loading branch information
martastain authored May 15, 2023
2 parents 6ab9dbb + 5b2adfe commit f66cea4
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 75 deletions.
98 changes: 49 additions & 49 deletions firefly.windows.spec
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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'],
)
2 changes: 1 addition & 1 deletion firefly/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "6.0.0"
__version__ = "6.0.1"

from firefly.config import config
from firefly.settings import Settings
Expand Down
5 changes: 4 additions & 1 deletion firefly/components/input_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion firefly/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
25 changes: 13 additions & 12 deletions firefly/modules/detail/__init__.py
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -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)
Expand Down
33 changes: 24 additions & 9 deletions firefly/modules/rundown/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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"]:
Expand Down
3 changes: 2 additions & 1 deletion firefly/modules/rundown/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
21 changes: 21 additions & 0 deletions firefly/modules/rundown/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions firefly/modules/scheduler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions firefly/objects/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <info@nebulabroadcast.com>"]

Expand Down

0 comments on commit f66cea4

Please sign in to comment.