This commit is contained in:
tsi-billypom 2025-04-18 11:46:40 -04:00
parent 87af077527
commit d2992215f6
2 changed files with 11 additions and 10 deletions

View File

@ -689,8 +689,13 @@ class MusicTable(QTableView):
return
# Populate the model
row_count: int = 0
# TODO: total time of playlist
# but how do i want to do this if user doesn't choose to see length field?
# spawn new thread and calculate myself?
total_time: int = 0 # total time of all songs in seconds
for row_data in data:
print(row_data)
# if "length" in fields:
row_count += 1
id, *rest_of_data = row_data
# handle different datatypes

16
main.py
View File

@ -23,11 +23,13 @@ from PyQt5.QtWidgets import (
QGraphicsScene,
QGraphicsPixmapItem,
QMessageBox,
QPushButton,
QStatusBar,
QStyle,
)
from PyQt5.QtCore import (
QSize,
QThread,
QUrl,
QTimer,
Qt,
@ -140,29 +142,22 @@ class ApplicationWindow(QMainWindow, Ui_MainWindow):
def __init__(self, clipboard):
super(ApplicationWindow, self).__init__()
# clipboard good
self.clipboard = clipboard
# Config
self.config: ConfigParser = ConfigParser()
self.cfg_file = (
Path(user_config_dir(appname="musicpom", appauthor="billypom"))
/ "config.ini"
)
self.config.read(self.cfg_file)
# Multithreading stuff...
self.threadpool = QThreadPool()
self.threadpool: QThreadPool = QThreadPool()
# UI
self.setupUi(self)
self.setWindowTitle("musicpom")
self.setup_fonts()
# self.vLayoutAlbumArt.SetFixedSize()
self.status_bar = QStatusBar()
self.permanent_status_label = QLabel("")
self.status_bar: QStatusBar = QStatusBar()
self.permanent_status_label: QLabel = QLabel("")
self.status_bar.addPermanentWidget(self.permanent_status_label)
self.setStatusBar(self.status_bar)
@ -195,6 +190,7 @@ class ApplicationWindow(QMainWindow, Ui_MainWindow):
self.previousButton.setIcon(icon)
pixmapi = QStyle.StandardPixmap.SP_MediaPlay
icon = style.standardIcon(pixmapi)
self.playButton: QPushButton
self.playButton.setIcon(icon)
# sharing functions with other classes and that