Skip to content

Commit

Permalink
Increase default limit for compact mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ihabunek committed Aug 18, 2022
1 parent 4d19f09 commit cacf921
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/commands/videos.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ twitch-dl videos <channel_name> [FLAGS] [OPTIONS]

<tr>
<td class="code">-l, --limit</td>
<td>Number of videos to fetch. Defaults to 10.</td>
<td>Number of videos to fetch. Defaults to 40 in copmpact mode, 10 otherwise.</td>
</tr>

<tr>
Expand Down
6 changes: 5 additions & 1 deletion twitchdl/commands/videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@

def videos(args):
game_ids = _get_game_ids(args.game)

# Set different defaults for limit for compact display
limit = args.limit or (40 if args.compact else 10)

# Ignore --limit if --pager or --all are given
max_videos = sys.maxsize if args.all or args.pager else args.limit
max_videos = sys.maxsize if args.all or args.pager else limit

total_count, generator = twitch.channel_videos_generator(
args.channel_name, max_videos, args.sort, args.type, game_ids=game_ids)
Expand Down
3 changes: 1 addition & 2 deletions twitchdl/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ def rate(value):
"type": str,
}),
(["-l", "--limit"], {
"help": "Number of videos to fetch. Defaults to 10.",
"help": "Number of videos to fetch. Defaults to 40 in copmpact mode, 10 otherwise.",
"type": pos_integer,
"default": 10,
}),
(["-a", "--all"], {
"help": "Fetch all videos, overrides --limit",
Expand Down

0 comments on commit cacf921

Please sign in to comment.