Check next track is readable

This commit is contained in:
Keith Edmunds 2021-04-25 00:02:41 +01:00
parent 4f4e81ab75
commit d157dbd7c0
2 changed files with 11 additions and 0 deletions

View File

@ -13,6 +13,7 @@ from PyQt5.QtWidgets import (
QInputDialog,
QLabel,
QMainWindow,
QMessageBox,
)
import helpers
@ -198,6 +199,11 @@ class Window(QMainWindow, Ui_MainWindow):
self.playlist.set_selected_as_next()
self.update_headers()
def show_warning(self, title, msg):
"Display a warning to user"
QMessageBox.warning(None, title, msg, buttons=QMessageBox.Cancel)
def test_function(self):
"Placeholder for test function"

View File

@ -221,6 +221,11 @@ class Playlist(QTableWidget):
if repaint:
self.repaint(clear_selection=False)
def can_read_track(self, track):
"Check track file is readable"
return os.access(track.path, os.R_OK)
def create_playlist(self, name):
"Create new playlist"