Skip to content

Commit 232a592

Browse files
authored
Verion 4.9.3 (#340)
* Fixing #339 After cancelling queue button stay as cancel (thanks to wynterca) * Fixing internal error that after_done_action could not be set
1 parent d8cb9d8 commit 232a592

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

.github/workflows/test.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Lint and Tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
7+
- main
8+
pull_request:
49

510
jobs:
611
lint:

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## Version 4.9.3
4+
5+
* Fixing #339 After cancelling queue button stay as cancel (thanks to wynterca)
6+
* Fixing internal error that after_done_action could not be set
7+
38
## Version 4.9.2
49

510
* Fixing #334 machine now sleeps during encoding (thanks to Don Gafford)

fastflix/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
__version__ = "4.9.2"
3+
__version__ = "4.9.3"
44
__author__ = "Chris Griffith"

fastflix/widgets/main.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,8 +1778,8 @@ def encoding_checks(self):
17781778
return False
17791779
return True
17801780

1781-
def set_convert_button(self, convert=True):
1782-
if convert:
1781+
def set_convert_button(self):
1782+
if not self.app.fastflix.currently_encoding:
17831783
self.widgets.convert_button.setText(f"{t('Convert')} ")
17841784
self.widgets.convert_button.setIcon(QtGui.QIcon(self.get_icon("play-round")))
17851785
self.widgets.convert_button.setIconSize(QtCore.QSize(22, 20))
@@ -1826,7 +1826,7 @@ def encode_video(self):
18261826

18271827
self.app.fastflix.currently_encoding = True
18281828
prevent_sleep_mode()
1829-
self.set_convert_button(False)
1829+
self.set_convert_button()
18301830
self.send_video_request_to_worker_queue(video_to_send)
18311831
self.disable_all()
18321832
self.video_options.show_status()
@@ -1890,9 +1890,6 @@ def conversion_complete(self, success: bool):
18901890
#
18911891
# @reusables.log_exception("fastflix", show_traceback=False)
18921892
def conversion_cancelled(self, video: Video):
1893-
self.app.fastflix.worker_queue.put(Request("cancel"))
1894-
self.app.fastflix.currently_encoding = False
1895-
allow_sleep_mode()
18961893
self.set_convert_button()
18971894

18981895
exists = video.video_settings.output_path.exists()
@@ -1962,8 +1959,8 @@ def status_update(self, status_response):
19621959

19631960
if response.status == "cancelled":
19641961
video.status.cancelled = True
1965-
self.app.fastflix.currently_encoding = False
1966-
allow_sleep_mode()
1962+
self.end_encoding()
1963+
self.conversion_cancelled(video)
19671964
self.video_options.update_queue()
19681965
return
19691966

@@ -2009,6 +2006,7 @@ def end_encoding(self):
20092006
allow_sleep_mode()
20102007
self.video_options.queue.run_after_done()
20112008
self.video_options.update_queue()
2009+
self.set_convert_button()
20122010

20132011
def send_next_video(self) -> bool:
20142012
if not self.app.fastflix.currently_encoding:
@@ -2018,7 +2016,11 @@ def send_next_video(self) -> bool:
20182016
self.send_video_request_to_worker_queue(video)
20192017
self.app.fastflix.currently_encoding = True
20202018
prevent_sleep_mode()
2019+
self.set_convert_button()
20212020
return True
2021+
self.app.fastflix.currently_encoding = False
2022+
allow_sleep_mode()
2023+
self.set_convert_button()
20222024
return False
20232025

20242026
def send_video_request_to_worker_queue(self, video: Video):

fastflix/widgets/panels/queue_panel.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def __init__(self, parent, video: Video, index, first=False):
5454
self.last = False
5555
self.video = video.copy()
5656
self.setFixedHeight(60)
57-
self.after_done_action = None
5857

5958
self.widgets = Box(
6059
up_button=QtWidgets.QPushButton(
@@ -200,6 +199,7 @@ def __init__(self, parent, app: FastFlixApp):
200199
self.app = app
201200
self.encode_paused = False
202201
self.encoding = False
202+
self.after_done_action = None
203203
top_layout = QtWidgets.QHBoxLayout()
204204

205205
top_layout.addWidget(QtWidgets.QLabel(t("Queue")))
@@ -407,8 +407,6 @@ def pause_resume_queue(self):
407407
self.pause_queue.setText(t("Pause Queue"))
408408
self.pause_queue.setIcon(QtGui.QIcon(get_icon("onyx-pause", self.app.fastflix.config.theme)))
409409
send_next = self.main.send_next_video()
410-
if send_next:
411-
self.main.set_convert_button(False)
412410
logger.debug(f"queue resumed, will I send next? {send_next}")
413411
else:
414412
self.pause_queue.setText(t("Resume Queue"))

0 commit comments

Comments
 (0)