Skip to content

Commit

Permalink
Verion 4.9.3 (#340)
Browse files Browse the repository at this point in the history
* Fixing #339 After cancelling queue button stay as cancel (thanks to wynterca)
* Fixing internal error that after_done_action could not be set
  • Loading branch information
cdgriffith authored Apr 29, 2022
1 parent d8cb9d8 commit 232a592
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Lint and Tests

on: [push, pull_request]
on:
push:
branches-ignore:
- master
- main
pull_request:

jobs:
lint:
Expand Down
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Version 4.9.3

* Fixing #339 After cancelling queue button stay as cancel (thanks to wynterca)
* Fixing internal error that after_done_action could not be set

## Version 4.9.2

* Fixing #334 machine now sleeps during encoding (thanks to Don Gafford)
Expand Down
2 changes: 1 addition & 1 deletion fastflix/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__version__ = "4.9.2"
__version__ = "4.9.3"
__author__ = "Chris Griffith"
18 changes: 10 additions & 8 deletions fastflix/widgets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1778,8 +1778,8 @@ def encoding_checks(self):
return False
return True

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

self.app.fastflix.currently_encoding = True
prevent_sleep_mode()
self.set_convert_button(False)
self.set_convert_button()
self.send_video_request_to_worker_queue(video_to_send)
self.disable_all()
self.video_options.show_status()
Expand Down Expand Up @@ -1890,9 +1890,6 @@ def conversion_complete(self, success: bool):
#
# @reusables.log_exception("fastflix", show_traceback=False)
def conversion_cancelled(self, video: Video):
self.app.fastflix.worker_queue.put(Request("cancel"))
self.app.fastflix.currently_encoding = False
allow_sleep_mode()
self.set_convert_button()

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

if response.status == "cancelled":
video.status.cancelled = True
self.app.fastflix.currently_encoding = False
allow_sleep_mode()
self.end_encoding()
self.conversion_cancelled(video)
self.video_options.update_queue()
return

Expand Down Expand Up @@ -2009,6 +2006,7 @@ def end_encoding(self):
allow_sleep_mode()
self.video_options.queue.run_after_done()
self.video_options.update_queue()
self.set_convert_button()

def send_next_video(self) -> bool:
if not self.app.fastflix.currently_encoding:
Expand All @@ -2018,7 +2016,11 @@ def send_next_video(self) -> bool:
self.send_video_request_to_worker_queue(video)
self.app.fastflix.currently_encoding = True
prevent_sleep_mode()
self.set_convert_button()
return True
self.app.fastflix.currently_encoding = False
allow_sleep_mode()
self.set_convert_button()
return False

def send_video_request_to_worker_queue(self, video: Video):
Expand Down
4 changes: 1 addition & 3 deletions fastflix/widgets/panels/queue_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def __init__(self, parent, video: Video, index, first=False):
self.last = False
self.video = video.copy()
self.setFixedHeight(60)
self.after_done_action = None

self.widgets = Box(
up_button=QtWidgets.QPushButton(
Expand Down Expand Up @@ -200,6 +199,7 @@ def __init__(self, parent, app: FastFlixApp):
self.app = app
self.encode_paused = False
self.encoding = False
self.after_done_action = None
top_layout = QtWidgets.QHBoxLayout()

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

0 comments on commit 232a592

Please sign in to comment.