CLI: reject invalid player seek and volume values before connecting
Nobody has claimed this yet.
- #90 by @bfs2021 — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Start in the CLI argument parsing for the spotapi player seek and spotapi player volume subcommands, and read the existing range checks in Player.seek() and Player.volume() to match their limits. Add small argparse type validators that reject negative seek values and volumes outside 0-100 with exit status 2, keeping 0 and 100 valid. Done when offline tests cover negative seek, volume below zero, volume above 100, and both boundaries, and the issue asks you to comment before starting to avoid duplicate work.
Written by the indexing model from the issue text.
Description
Problem
The Python player API correctly rejects negative seek positions and volume values outside 0–100. The CLI currently parses both as unrestricted integers, so obviously invalid input can reach account/session setup before producing an error.
Proposed change
Validate these values during argument parsing:
spotapi player seek MILLISECONDS: integer greater than or equal to zero.spotapi player volume PERCENT: integer from zero through 100.
Acceptance criteria
- Invalid values fail through
argparsewith a clear range message and exit status 2. - Invalid input is rejected before reading account state or opening a Spotify connection.
- Boundary values
0and100remain valid where applicable. - Existing valid commands retain their current behavior.
- Offline tests cover negative seek, volume below zero, volume above 100, and boundaries.
Scope
Keep validation helpers small and local to the CLI. The existing validation inside Player.seek() and Player.volume() must remain as the library-level safety boundary.
Comment before starting so duplicate work can be avoided.
- Dominant language
- Python
- Stars
- 493
- Forks
- 40
- Avg merge
- 5m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Aran404/SpotAPI
-
CLI: expose public search language with --languagePossibly taken @semajzandrews claimed this today. Openenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
documentation enhancement help wanted
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
deepchem/deepchem#5289 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
UKGovernmentBEIS/inspect_evals#2892 · 1 comment ·
Maintainers usually reply within 1 day
-
Versioning docs: say that no output from the 0.46 warning check means nothing is affectedPossibly taken @grelinfo claimed this today. Opendocumentation priority:low size:S
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
alphacrack/readme2demo#293 ·