Skip to content

Commit bbc65c8

Browse files
committed
🛠️ Cover won't be removed, if clicked on the same item multiple times.
1 parent 5bdd48e commit bbc65c8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tidal_dl_ng/gui.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ def cover_show(self, media: Album | Playlist | Track | Video | Album | Artist) -
897897

898898
# Show spinner while loading
899899
self.s_spinner_start.emit(parent_widget)
900+
900901
try:
901902
try:
902903
cover_url = media.album.image()
@@ -908,6 +909,8 @@ def cover_show(self, media: Album | Playlist | Track | Video | Album | Artist) -
908909
except Exception:
909910
logger_gui.info(f"No cover available (media ID: {getattr(media, 'id', 'unknown')}).")
910911
else:
912+
cover_url = None
913+
911914
logger_gui.info(f"No cover available (media ID: {getattr(media, 'id', 'unknown')}).")
912915

913916
if cover_url and self.cover_url_current != cover_url:
@@ -916,7 +919,7 @@ def cover_show(self, media: Album | Playlist | Track | Video | Album | Artist) -
916919
pixmap: QtGui.QPixmap = QtGui.QPixmap()
917920
pixmap.loadFromData(data_cover)
918921
self.l_pm_cover.setPixmap(pixmap)
919-
else:
922+
elif not cover_url:
920923
path_image: str = resource_path("tidal_dl_ng/ui/default_album_image.png")
921924
self.l_pm_cover.setPixmap(QtGui.QPixmap(path_image))
922925
finally:
@@ -1185,6 +1188,7 @@ def tr_results_expanded(self, index: QtCore.QModelIndex) -> None:
11851188

11861189
# Show spinner while loading children
11871190
self.s_spinner_start.emit(self.tr_results)
1191+
11881192
try:
11891193
self.list_items_show_result(media_list=media_list, parent=item)
11901194
finally:

0 commit comments

Comments
 (0)