Skip to content

feat: add support for dubbed/subbed status in history#1708

Closed
HarshK97 wants to merge 1 commit into
pystardust:masterfrom
HarshK97:master
Closed

feat: add support for dubbed/subbed status in history#1708
HarshK97 wants to merge 1 commit into
pystardust:masterfrom
HarshK97:master

Conversation

@HarshK97
Copy link
Copy Markdown

@HarshK97 HarshK97 commented May 6, 2026

fix: remember dub/sub mode in history and resume correctly with -c

Type of change

  • Bug fix
  • Feature
  • Documentation update

Description

This PR fixes an issue where the history mechanism (ani-cli -c) would not remember if the user was watching the dub or sub version of an anime, causing it to incorrectly default to sub when resuming.

Background

While using ani-cli -c, the CLI reads from the ani-hsts file which originally only stored ep_no, id, and title. Because mode (sub/dub) wasn't saved to history, continuing an anime would always use the globally set mode (which defaults to sub), forcing users to manually add the --dub flag every time they wanted to resume a dubbed anime.

What this PR changes

  • ani-cli now securely stores the mode parameter (sub or dub) as an additional field in the ani-hsts history file.
  • The -c interactive menu properly extracts the tracked mode and seamlessly restores the user's preference when fetching the next episode.
  • The history prompt interface has been upgraded to display the tracked mode, showing a clear visual indicator like (dub) or (sub) alongside the title and episode number.

Testing

Tested manually:
Core feature

  • ani-cli --dub [anime] → plays dubbed episode and records mode in history ✓
  • ani-cli -c → correctly shows [Anime Title] - episode X (dub) in the menu and successfully fetches/plays dubbed episodes upon selection ✓

Regression

  • Legacy history entries (from previous versions of ani-cli) load perfectly, reconstruct the title without issues, and default to sub
  • Normal subbed playback functions correctly and updates history with sub

Checklist

  • any anime playing
  • bumped version
  • next, prev and replay work
  • -c history and continue work
  • -d downloads work
  • -s syncplay works
  • -q quality works
  • -v vlc works
  • -e (select episode) aka -r (range selection) works
  • -S select index works
  • --skip ani-skip works
  • --skip-title ani-skip title argument works
  • --no-detach no detach works
  • --exit-after-play auto exit after playing works
  • --nextep-countdown countdown to next ep works
  • --dub and regular (sub) mode both work
  • all providers return links (not necessarily on a single anime, use debug mode to confirm)
  • -h help info is up to date
  • Readme is up to date
  • Man page is up to date

Additional Testcases

  • The safe bet: One Piece
  • Episode 0: Saenai Heroine no Sodatekata ♭
  • Unicode: Saenai Heroine no Sodatekata ♭
  • Non-whole episodes: Tensei shitara slime datta ken (ep. 24.5, ep. 24.9)
  • All Providers: Youkoso Jitsuryoku Shijou Shugi no Kyoushitsu e
  • The examples of the help text

@HarshK97 HarshK97 requested a review from Derisis13 as a code owner May 6, 2026 04:42
@port19x port19x changed the title feat: add support for dubbed/subbed status in history and bump versio… feat: add support for dubbed/subbed status in history May 6, 2026
@port19x
Copy link
Copy Markdown
Collaborator

port19x commented May 6, 2026

I don't like this.
Generally you're either a dub user or sub user.
You can alias ani-cli to be ani-cli --dub, the issue of whether to use sub or dub is orthogonal to history imo.
The history file format hasn't been changed in a long time and I'm not comfortable changing it for something this minor.

@port19x
Copy link
Copy Markdown
Collaborator

port19x commented May 6, 2026

@Derisis13 what do you think about this?

@HarshK97
Copy link
Copy Markdown
Author

HarshK97 commented May 6, 2026

The alias approach doesn't work for users who watch some shows dubbed and some subbed, the mode is per-show, not a global preference. History is meant to make -c frictionless, requiring manual --dub every resume is exactly the friction it exists to remove.

@port19x
Copy link
Copy Markdown
Collaborator

port19x commented May 6, 2026

Yeah, I see that despite my reservations there is some value and so I'm deferring judgement to Derisis on this one

@Derisis13
Copy link
Copy Markdown
Collaborator

No breaking the history file. Not worth it at all.

@port19x
Copy link
Copy Markdown
Collaborator

port19x commented May 7, 2026

I'm glad we're in agreement on this

@port19x port19x closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants