Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Refine pretty-printing of episode ranges #221

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading