@@ -567,10 +567,30 @@ def on_download_results(self):
567
567
if len (items ) == 0 :
568
568
logger_gui .error ("Please select a row first." )
569
569
else :
570
+ # If it is an artist resolve it with all available albums of him
571
+ if len (items ) == 1 :
572
+ tmp_media : QtWidgets .QTreeWidgetItem = items [0 ].data (5 , QtCore .Qt .ItemDataRole .UserRole )
573
+
574
+ if isinstance (tmp_media , Artist ):
575
+ tmp_children : [QtWidgets .QTreeWidgetItem ] = []
576
+ is_dummy_child = not bool (items [0 ].child (0 ).data (5 , QtCore .Qt .ItemDataRole .UserRole ))
577
+
578
+ # Use the expand function to retrieve all albums.
579
+ if is_dummy_child :
580
+ self .on_tr_results_expanded (items [0 ])
581
+
582
+ count_children : int = items [0 ].childCount ()
583
+
584
+ # Get all children.
585
+ for idx in range (count_children ):
586
+ tmp_children .append (items [0 ].child (idx ))
587
+
588
+ items : [Album ] = tmp_children
589
+
570
590
items_pos_last = len (items ) - 1
571
591
572
592
for item in items :
573
- media : Track | Album | Playlist | Video = item .data (5 , QtCore .Qt .ItemDataRole .UserRole )
593
+ media : Track | Album | Playlist | Video | Artist = item .data (5 , QtCore .Qt .ItemDataRole .UserRole )
574
594
# Skip only if Track item, skip option set and the item is not the last in the list.
575
595
download_delay : bool = bool (
576
596
isinstance (media , Track | Video )
@@ -583,7 +603,9 @@ def on_download_results(self):
583
603
self .pb_download .setText ("Download" )
584
604
self .pb_download .setEnabled (True )
585
605
586
- def download (self , media : Track | Album | Playlist | Video | Mix , dl : Download , delay_track : bool = False ) -> None :
606
+ def download (
607
+ self , media : Track | Album | Playlist | Video | Mix | Artist , dl : Download , delay_track : bool = False
608
+ ) -> None :
587
609
self .s_pb_reset .emit ()
588
610
self .s_statusbar_message .emit (StatusbarMessage (message = "Download started..." ))
589
611
0 commit comments