forked from Wobbl/Wobuzz
Fixed another crash that occurred because of an unexpected NoneType in the getting of the playing track's cover.
This commit is contained in:
parent
567afb1866
commit
851c2306b4
1 changed files with 9 additions and 1 deletions
|
@ -55,7 +55,6 @@ class TrackInfo(QToolBar):
|
||||||
title = current_track.tags.title
|
title = current_track.tags.title
|
||||||
artist = current_track.tags.artist
|
artist = current_track.tags.artist
|
||||||
album = current_track.tags.album
|
album = current_track.tags.album
|
||||||
cover_data = current_track.tags.images.any.data
|
|
||||||
|
|
||||||
self.title.setText(title)
|
self.title.setText(title)
|
||||||
|
|
||||||
|
@ -71,6 +70,15 @@ class TrackInfo(QToolBar):
|
||||||
else:
|
else:
|
||||||
self.album.setText("No Album")
|
self.album.setText("No Album")
|
||||||
|
|
||||||
|
cover = current_track.tags.images.any
|
||||||
|
|
||||||
|
if cover is None:
|
||||||
|
self.track_cover.setPixmap(self.wobuzz_logo)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
cover_data = cover.data
|
||||||
|
|
||||||
if isinstance(cover_data, bytes):
|
if isinstance(cover_data, bytes):
|
||||||
cover_pixmap = QPixmap()
|
cover_pixmap = QPixmap()
|
||||||
cover_pixmap.loadFromData(cover_data)
|
cover_pixmap.loadFromData(cover_data)
|
||||||
|
|
Loading…
Add table
Reference in a new issue