Add favourites command

pull/493/merge
Alex Schroeder 2025-08-04 23:53:20 +02:00 zatwierdzone przez Ivan Habunek
rodzic 16ec73c23e
commit 958d24bd22
2 zmienionych plików z 30 dodań i 0 usunięć

Wyświetl plik

@ -466,6 +466,12 @@ def bookmark_timeline_generator(app, user, limit=20):
return _timeline_generator(app, user, path, params)
def favourite_timeline_generator(app, user, limit=20):
path = '/api/v1/favourites'
params = {'limit': limit}
return _timeline_generator(app, user, path, params)
def notification_timeline_generator(app, user, limit=20):
# exclude all but mentions and statuses
exclude_types = ["follow", "favourite", "reblog", "poll", "follow_request"]

Wyświetl plik

@ -110,6 +110,30 @@ def bookmarks(
_show_timeline(generator, reverse, once)
@cli.command()
@click.option(
"--reverse", "-r", is_flag=True,
help="Reverse the order of the shown timeline (new posts at the bottom)"
)
@click.option(
"--once", "-1", is_flag=True,
help="Only show the first <count> toots, do not prompt to continue"
)
@click.option(
"--count", "-c", type=int, default=10,
help="Number of posts per page (max 20)"
)
@pass_context
def favourites(
ctx: Context,
reverse: bool,
once: bool,
count: int,
):
"""Show recent statuses in a timeline"""
generator = api.favourite_timeline_generator(ctx.app, ctx.user, limit=count)
_show_timeline(generator, reverse, once)
@cli.command()
@click.option(
"--clear", is_flag=True,