Skip to content

Commit f451d21

Browse files
authored
Fix process priority (#708)
1 parent f4390eb commit f451d21

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

fastflix/command_runner.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from subprocess import PIPE
1010
from threading import Thread
1111
from typing import Literal
12+
import sys
1213

1314
from psutil import Popen
1415

@@ -23,12 +24,12 @@
2324
)
2425
except ImportError:
2526
priority_levels = {
26-
"Realtime": 20,
27-
"High": 10,
28-
"Above Normal": 5,
27+
"Realtime": -20,
28+
"High": -10,
29+
"Above Normal": -5,
2930
"Normal": 0,
30-
"Below Normal": -10,
31-
"Idle": -20,
31+
"Below Normal": 10,
32+
"Idle": 19 if sys.platform == "linux" else 20,
3233
}
3334
else:
3435
priority_levels = {

fastflix/widgets/panels/queue_panel.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,11 @@ def __init__(self, parent, app: FastFlixApp):
230230
self.load_queue_button.setFixedWidth(110)
231231

232232
self.priority_widget = QtWidgets.QComboBox()
233-
self.priority_widget.addItems(["Realtime", "High", "Above Normal", "Normal", "Below Normal", "Idle"])
234-
self.priority_widget.setCurrentIndex(3)
233+
self.priority_widget.addItems(
234+
([] if reusables.win_based else ["Realtime"])
235+
+ ["High", "Above Normal", "Normal", "Below Normal", "Idle"]
236+
)
237+
self.priority_widget.setCurrentText("Normal")
235238
self.priority_widget.currentIndexChanged.connect(self.set_priority)
236239

237240
self.clear_queue = QtWidgets.QPushButton(

0 commit comments

Comments
 (0)