Skip to content

Commit

Permalink
fix: Refine pretty-printing of episode ranges (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
janw authored Dec 30, 2024
1 parent 8bfa4db commit 083cae0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
Binary file added .assets/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.m4a
*.yaml
*.db
*.cast
!.github/**/*.yaml

archive/
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ A fast and simple command line client to archive all episodes from your favorite

Podcast Archiver takes the feed URLs of your favorite podcasts and downloads all available episodes for you—even those "hidden" in [paged feeds](https://podlove.org/paged-feeds/). You'll end up with a complete archive of your shows. The archiver also supports updating an existing archive, so that it lends itself to be set up as a cronjob.

![Demo of podcast-archiver](.assets/demo.gif)

## Setup

Install via [pipx](https://pipx.pypa.io/stable/):
Expand Down Expand Up @@ -56,10 +58,10 @@ Run `podcast-archiver --help` for details on how to use it:

### Example invocation

```bash
```sh
podcast-archiver -d ~/Music/Podcasts \
-f http://logbuch-netzpolitik.de/feed/m4a \
-f http://raumzeit-podcast.de/feed/m4a/ \
-f https://logbuch-netzpolitik.de/feed/mp3/ \
-f https://raumzeit-podcast.de/feed/mp3/ \
-f https://feeds.lagedernation.org/feeds/ldn-mp3.xml
```

Expand Down
19 changes: 11 additions & 8 deletions podcast_archiver/utils/pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,17 @@ def __rich__(self) -> ConsoleRenderable | str:
Text("╶┬╴" if pair.length > 1 else " ", style=pair.style),
pair.first,
)
if pair.length == 1:
continue
if pair.length > 2:
grid.add_row(
"",
Text(" │ ", style=pair.style),
Text(" ︙", style="dim"),
)
if pair.length > 1:
grid.add_row("", " │ ", "", style=pair.style)
grid.add_row(
"",
Text(" ╰╴" if pair.last else " ", style=pair.style),
pair.last,
)
grid.add_row(
"",
Text(" ╰╴", style=pair.style),
pair.last,
)
grid.add_row("", "", "")
return grid

0 comments on commit 083cae0

Please sign in to comment.