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 return
# Populate the model # Populate the model
row_count: int = 0 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 total_time: int = 0 # total time of all songs in seconds
for row_data in data: for row_data in data:
print(row_data)
# if "length" in fields:
row_count += 1 row_count += 1
id, *rest_of_data = row_data id, *rest_of_data = row_data
# handle different datatypes # handle different datatypes

16
main.py
View File

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