forked from DRMTalks/devine
Replace Tracks.print() calls with new rich tree
This commit is contained in:
parent
48e35fb4c4
commit
984582d19d
|
@ -332,7 +332,8 @@ class dl:
|
|||
title.tracks.sort_chapters()
|
||||
|
||||
console.log("> All Tracks:")
|
||||
title.tracks.print()
|
||||
available_tracks = title.tracks.tree()
|
||||
console.log(available_tracks)
|
||||
|
||||
console.log("> Selected Tracks:") # log early so errors logs make sense
|
||||
|
||||
|
@ -413,8 +414,8 @@ class dl:
|
|||
if not subs_only:
|
||||
title.tracks.subtitles.clear()
|
||||
|
||||
title.tracks.print()
|
||||
|
||||
selected_tracks = title.tracks.tree()
|
||||
console.log(selected_tracks)
|
||||
if list_:
|
||||
continue # only wanted to see what tracks were available and chosen
|
||||
|
||||
|
|
|
@ -151,12 +151,6 @@ class Tracks:
|
|||
if duplicates:
|
||||
log.warning(f" - Found and skipped {duplicates} duplicate tracks...")
|
||||
|
||||
def print(self, level: int = logging.INFO) -> None:
|
||||
"""Print the __str__ to log at a specified level."""
|
||||
log = logging.getLogger("Tracks")
|
||||
for line in str(self).splitlines(keepends=False):
|
||||
log.log(level, line)
|
||||
|
||||
def sort_videos(self, by_language: Optional[Sequence[Union[str, Language]]] = None) -> None:
|
||||
"""Sort video tracks by bitrate, and optionally language."""
|
||||
if not self.videos:
|
||||
|
|
Loading…
Reference in New Issue