Skip to content

Commit

Permalink
Merge pull request #24 from nebulabroadcast/develop
Browse files Browse the repository at this point in the history
6.0.2
  • Loading branch information
martastain authored Mar 13, 2024
2 parents e3d5368 + 4adb270 commit 4bc7ba1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Firefly
=======

![GitHub release (latest by date)](https://img.shields.io/github/v/release/nebulabroadcast/firefly?style=for-the-badge)
![Maintenance](https://img.shields.io/maintenance/yes/2023?style=for-the-badge)
![Maintenance](https://img.shields.io/maintenance/yes/2024?style=for-the-badge)
![Last commit](https://img.shields.io/github/last-commit/nebulabroadcast/firefly?style=for-the-badge)
![Python version](https://img.shields.io/badge/python-3.10-blue?style=for-the-badge)

Expand Down
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.1"
__version__ = "6.0.2"

from firefly.config import config
from firefly.settings import Settings
Expand Down
14 changes: 7 additions & 7 deletions firefly/modules/scheduler/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def drawBlock(self, qp, event, end):

TEXT_SIZE = 9
base_t = self.ts2pos(event["start"])
base_h = self.min_size * (event["duration"] / 60)
base_h = self.min_size * (event.duration / 60)
evt_h = self.ts2pos(end) - base_t

if event["color"]:
Expand Down Expand Up @@ -223,7 +223,7 @@ def draw_dragging(self, qp):
if type(self.calendar.dragging) == Asset:
exp_dur = suggested_duration(self.calendar.dragging.duration)
elif type(self.calendar.dragging) == Event:
exp_dur = self.calendar.dragging["duration"]
exp_dur = self.calendar.dragging.duration
else:
return

Expand Down Expand Up @@ -251,7 +251,7 @@ def mouseMoveEvent(self, e):

if end >= ts > event["start"] >= self.start_time:
self.cursor_event = event
diff = event["start"] + event["duration"] - end
diff = event["start"] + event.duration - end
if diff < 0:
diff = "Remaining: " + s2tc(abs(diff))
else:
Expand All @@ -274,8 +274,8 @@ def mouseMoveEvent(self, e):
return

self.calendar.drag_offset = ts - event["start"]
if self.calendar.drag_offset > event["duration"]:
self.calendar.drag_offset = event["duration"]
if self.calendar.drag_offset > event.duration:
self.calendar.drag_offset = event.duration

encodedData = json.dumps([event.meta])
mimeData = QMimeData()
Expand Down Expand Up @@ -375,7 +375,7 @@ def dropEvent(self, evt):
elif type(self.calendar.dragging) == Asset:
for event in self.calendar.events:
if event["start"] == drop_ts:
if event["duration"]:
if event.duration:
ret = QMessageBox.question(
self,
"Overwrite",
Expand Down Expand Up @@ -427,7 +427,7 @@ def dropEvent(self, evt):
ret = QMessageBox.question(
self,
"Move event",
f"Do you really want to move {self.cursor_event}?"
f"Do you really want to move {event}?"
f"\n\nFrom: {format_time(event['start'])}"
f"\nTo: {format_time(drop_ts)}",
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No,
Expand Down
4 changes: 4 additions & 0 deletions firefly/objects/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
class Event(BaseObject):
object_type_id = 3
required = ["start", "id_channel"]

@property
def duration(self):
return self.meta.get("duration", 0) or 0

0 comments on commit 4bc7ba1

Please sign in to comment.