Compare commits
No commits in common. "41379efd1ba4af8f07c67b3113946d8bca1b9864" and "25add4239d19315b00d89091c558edc3706339a1" have entirely different histories.
41379efd1b
...
25add4239d
@ -65,7 +65,6 @@ class Config(object):
|
||||
MAIL_SERVER = os.environ.get('MAIL_SERVER') or "woodlands.midnighthax.com"
|
||||
MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
|
||||
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
|
||||
MAX_IMPORT_MATCHES = 5
|
||||
MAX_INFO_TABS = 5
|
||||
MAX_MISSING_FILES_TO_REPORT = 10
|
||||
MILLISECOND_SIGFIGS = 0
|
||||
|
||||
@ -10,7 +10,7 @@ from datetime import datetime, timedelta
|
||||
from time import sleep
|
||||
from typing import List, Optional
|
||||
|
||||
from PyQt5.QtCore import pyqtSignal, QDate, QEvent, Qt, QSize, QTime, QTimer
|
||||
from PyQt5.QtCore import QDate, QEvent, Qt, QSize, QTime, QTimer
|
||||
from PyQt5.QtGui import QColor, QFont, QPalette, QResizeEvent
|
||||
from PyQt5.QtWidgets import (
|
||||
QApplication,
|
||||
@ -53,8 +53,6 @@ from utilities import check_db, update_bitrates
|
||||
class CartButton(QPushButton):
|
||||
"""Button for playing carts"""
|
||||
|
||||
progress = pyqtSignal(int)
|
||||
|
||||
def __init__(self, parent: QMainWindow, cart: Carts):
|
||||
"""Create a cart pushbutton and set it disabled"""
|
||||
|
||||
@ -87,8 +85,6 @@ class CartButton(QPushButton):
|
||||
self.pgb.setMaximum(1)
|
||||
self.pgb.setValue(0)
|
||||
|
||||
self.progress.connect(self.pgb.setValue)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return (
|
||||
f"<CartButton(cart_id={self.cart_id} "
|
||||
@ -199,9 +195,9 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
btn.player.play()
|
||||
btn.is_playing = True
|
||||
colour = Config.COLOUR_CART_PLAYING
|
||||
thread = threading.Thread(target=self.cart_progressbar,
|
||||
args=(btn,))
|
||||
thread.start()
|
||||
# thread = threading.Thread(target=self.cart_progressbar,
|
||||
# args=(btn,))
|
||||
# thread.start()
|
||||
else:
|
||||
colour = Config.COLOUR_CART_ERROR
|
||||
btn.setStyleSheet("background-color: " + colour + ";\n")
|
||||
@ -264,7 +260,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
ms = 0
|
||||
btn.pgb.setMaximum(btn.duration)
|
||||
while ms <= btn.duration:
|
||||
btn.progress.emit(ms)
|
||||
btn.pgb.setValue(ms)
|
||||
ms += 100
|
||||
sleep(0.1)
|
||||
|
||||
@ -668,18 +664,17 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
new_tracks.append((fname, tags))
|
||||
title = tags['title']
|
||||
artist = tags['artist']
|
||||
count = 0
|
||||
possible_matches = Tracks.search_titles(session, title)
|
||||
if possible_matches:
|
||||
if len(possible_matches) > 5:
|
||||
txt = "More than five tracks look similar to "
|
||||
txt += f'"{title}" by "{artist} ({fname})":\n\n'
|
||||
else:
|
||||
txt += 'Similar to new track '
|
||||
txt += f'"{title}" by "{artist} ({fname})":\n\n'
|
||||
for track in possible_matches:
|
||||
txt += f' "{track.title}" by {track.artist}'
|
||||
txt += f' ({track.path})\n\n'
|
||||
count += 1
|
||||
if count >= Config.MAX_IMPORT_MATCHES:
|
||||
txt += "\nThere are more similar-looking tracks"
|
||||
break
|
||||
txt += "\n"
|
||||
# Check whether to proceed if there were potential matches
|
||||
txt += "Proceed with import?"
|
||||
|
||||
@ -1727,9 +1727,6 @@ class PlaylistTab(QTableWidget):
|
||||
top.
|
||||
"""
|
||||
|
||||
if row is None:
|
||||
return
|
||||
|
||||
padding_required = Config.SCROLL_TOP_MARGIN
|
||||
top_row = row
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user