Skip to content

feat: add bangumi archive and episode offset features#958

Merged
EstrellaXD merged 2 commits into
3.2-devfrom
feature/bangumi-archive-and-episode-offset
Jan 25, 2026
Merged

feat: add bangumi archive and episode offset features#958
EstrellaXD merged 2 commits into
3.2-devfrom
feature/bangumi-archive-and-episode-offset

Conversation

@EstrellaXD
Copy link
Copy Markdown
Owner

Summary

  • Archive Feature: Automatically archive ended series based on TMDB status, with collapsible UI section for archived items
  • Episode Offset: Auto-detect and apply episode offset for shows using absolute numbering (e.g., S02E18 → S02E05)
  • TMDB Integration: Extract series status and season episode counts for both features

Changes

Backend

  • Add archived field to Bangumi model with database migration (v4)
  • Add archive/unarchive/suggest-offset/refresh-metadata API endpoints
  • Enhance TMDB parser to extract series_status and season_episode_counts
  • Integrate offset application in renamer's gen_path() method

Frontend

  • Add collapsible archived section in bangumi page
  • Add archive/unarchive button in edit rule popup
  • Add offset field with "Auto Detect" button in rule editor
  • Add i18n translations (zh-CN, en)

Test plan

  • Verify database migration adds archived column: sqlite3 data/data.db ".schema bangumi"
  • Test PATCH /api/v1/bangumi/archive/{id} and PATCH /api/v1/bangumi/unarchive/{id}
  • Test GET /api/v1/bangumi/refresh/metadata auto-archives ended series
  • Test GET /api/v1/bangumi/suggest-offset/{id} returns correct offset
  • Verify offset is applied during file renaming (e.g., E18 with offset=-13 → E05)
  • Verify archived section appears and is collapsible in UI
  • Test auto-detect button fetches and applies suggested offset

🤖 Generated with Claude Code

Archive Feature:
- Add archived field to Bangumi model with database migration (v4)
- Add archive/unarchive API endpoints (PATCH /bangumi/archive/{id})
- Add auto-archive for ended series via TMDB metadata refresh
- Add collapsible archived section in UI with visual styling
- Add archive/unarchive button in edit rule popup

Episode Offset Feature:
- Extract series_status and season_episode_counts from TMDB API
- Add suggest-offset API endpoint with auto-detection logic
- Apply offset in renamer gen_path() for episode numbering
- Add offset field with "Auto Detect" button in rule editor
- Look up offset from database when renaming files

The offset auto-detection calculates the sum of episodes from all
previous seasons (e.g., if S01 has 13 episodes, S02E18 → S02E05
with offset=-13).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
auto-bangumi Ready Ready Preview, Comment Jan 25, 2026 8:14am

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant