mirror of
				https://github.com/devine-dl/devine.git
				synced 2025-11-04 03:44:49 +00:00 
			
		
		
		
	Implement verbose arg on tree method of Movies and Album
This commit is contained in:
		
							parent
							
								
									375ccd7638
								
							
						
					
					
						commit
						401d0481df
					
				@ -137,12 +137,13 @@ class Movies(SortedKeyList, ABC):
 | 
			
		||||
        # TODO: Assumes there's only one movie
 | 
			
		||||
        return self[0].name + (f" ({self[0].year})" if self[0].year else "")
 | 
			
		||||
 | 
			
		||||
    def tree(self, *_) -> Tree:
 | 
			
		||||
    def tree(self, verbose: bool = False) -> Tree:
 | 
			
		||||
        num_movies = len(self)
 | 
			
		||||
        tree = Tree(
 | 
			
		||||
            f"{num_movies} Movie{['s', ''][num_movies == 1]}",
 | 
			
		||||
            guide_style="bright_black"
 | 
			
		||||
        )
 | 
			
		||||
        if verbose:
 | 
			
		||||
            for movie in self:
 | 
			
		||||
                tree.add(
 | 
			
		||||
                    f"[bold]{movie.name}[/] [bright_black]({movie.year or '?'})",
 | 
			
		||||
 | 
			
		||||
@ -132,12 +132,13 @@ class Album(SortedKeyList, ABC):
 | 
			
		||||
            return super().__str__()
 | 
			
		||||
        return f"{self[0].artist} - {self[0].album} ({self[0].year or '?'})"
 | 
			
		||||
 | 
			
		||||
    def tree(self, *_) -> Tree:
 | 
			
		||||
    def tree(self, verbose: bool = False) -> Tree:
 | 
			
		||||
        num_songs = len(self)
 | 
			
		||||
        tree = Tree(
 | 
			
		||||
            f"{num_songs} Song{['s', ''][num_songs == 1]}",
 | 
			
		||||
            guide_style="bright_black"
 | 
			
		||||
        )
 | 
			
		||||
        if verbose:
 | 
			
		||||
            for song in self:
 | 
			
		||||
                tree.add(
 | 
			
		||||
                    f"[bold]Track {song.track:02}.[/] [bright_black]({song.name})",
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user