Skip to content

Commit

Permalink
Non-Traktor NI should not crash on startup (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
aw-was-here authored Mar 2, 2023
1 parent cd5581d commit f71c383
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nowplaying/inputs/traktor.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ def defaults(self, qsettings):
qsettings.setValue('traktor/port', '8000')
nidir = pathlib.Path.home().joinpath('Documents', 'Native Instruments')
if nidir.exists():
collist = list(nidir.glob('**/collection.nml'))
collist.sort(key=lambda x: x.stat().st_mtime)
qsettings.setValue('traktor/collections', str(collist[-1]))
if collist := list(nidir.glob('**/collection.nml')):
collist.sort(key=lambda x: x.stat().st_mtime)
qsettings.setValue('traktor/collections', str(collist[-1]))

def connect_settingsui(self, qwidget, uihelp):
''' connect any UI elements such as buttons '''
Expand Down

0 comments on commit f71c383

Please sign in to comment.