Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.

Add TV show episode support#3

Merged
maateen merged 5 commits intomainfrom
feature/tv-show-support
Nov 8, 2025
Merged

Add TV show episode support#3
maateen merged 5 commits intomainfrom
feature/tv-show-support

Conversation

@maateen
Copy link
Owner

@maateen maateen commented Sep 8, 2025

Summary

  • Implements comprehensive TV series episode subtitle downloading and management
  • Consolidates episode functionality into main Bazarr client (unified architecture)
  • Adds automatic subtitle synchronization using Bazarr's SubSync
  • Adds Sub-Zero subtitle modification support with configurable parameters
  • Provides configurable processing for both movies and episodes
  • Migrates to Ruff for faster, unified linting (replaces Black/isort/flake8)
  • Maintains full backward compatibility with existing movie functionality

Key Features

  • Unified Architecture: Consolidated episode operations into api/bazarr.py (removed separate modules)
  • SubSync Integration: Automatic subtitle timing synchronization with configurable max offset, framerate handling, and GSS algorithm
  • Sub-Zero Mods: Subtitle content modifications (OCR fixes, hearing impaired processing, etc.)
  • Smart Processing: Reads sync/mod settings directly from Bazarr configuration
  • Multi-Pattern Search: Episode search using S01E01 format, episode titles, and scene names
  • Enhanced Documentation: Comprehensive guides for sync features and processing flow

Addresses Issue

Closes #2

Test plan

  • All existing tests pass (105 total)
  • New TV show functionality tested with 24 additional test cases
  • Episode search and matching validated across multiple patterns
  • Configuration system tested for both movies and episodes
  • Pre-commit hooks and formatting requirements satisfied
  • Ruff linting and formatting applied across codebase

@maateen maateen assigned maateen and unassigned maateen Sep 8, 2025
- Add Bazarr episode API client with series enrichment and episode upload
- Implement SubSource TV show downloader with intelligent episode matching
- Add multi-pattern episode search (S01E01, episode title, scene names)
- Extend main workflow to process both movies and TV episodes
- Add configurable processing for movies and episodes via config settings
- Implement episode tracking with composite keys for series/season/episode
- Add comprehensive test suite (24 new tests, 105 total passing)
- Update documentation with TV show features and troubleshooting guide
- Maintain backward compatibility with existing movie-only functionality
@maateen maateen force-pushed the feature/tv-show-support branch from 7fe2444 to 96fb5f8 Compare September 8, 2025 23:47
@maateen maateen mentioned this pull request Sep 8, 2025
3 tasks
@maateen maateen marked this pull request as draft September 11, 2025 11:34
- Migrated TV episode functionality from separate modules into main Bazarr client
- Removed api/bazarr_episodes.py and api/tv_shows.py (consolidated into api/bazarr.py)
- Added automatic subtitle synchronization using Bazarr's SubSync
- Added Sub-Zero subtitle modification support
- Implemented configurable sync parameters (max_offset, framerate fix, GSS)
- Replaced Black, isort, and flake8 with Ruff for faster, unified linting
- Updated documentation with sync/Sub-Zero feature details and processing flow
- Improved terminology consistency (TV shows → TV series)
- Updated all tests to reflect consolidated architecture
@maateen maateen marked this pull request as ready for review October 20, 2025 21:13
- Fixed episode info extraction regex priority (S01E01 pattern now checked first)
- Added year display support in format_movie_info for multiple year fields
- Updated episode subtitle tests to match current API structure
- Fixed _is_subtitle_match to support both episode_number and episode fields
- Removed obsolete _generate_episode_search_queries tests (method removed)
- All 113 tests now passing
- Added comprehensive browser-like headers for Cloudflare protection bypass
- Included all required sec-fetch-* and sec-ch-ua-* headers
- Added support for cf_clearance cookie via SUBSOURCE_CF_CLEARANCE env variable
- Updated User-Agent to match modern Chrome/Edge browser
- Added Origin and Referer headers for CORS compliance
- Fixes 403 Forbidden errors from SubSource API

Tested with successful subtitle download, upload, Sub-Zero mods, and sync.
- Added cf_clearance field to subsource config section
- Cookie can now be stored in config file instead of environment variable
- Priority: environment variable > config file
- Updated SubSourceDownloader to accept cf_clearance parameter
- Added helpful comments in config template for getting the cookie
- Updated all tests to handle new parameter
- All 113 tests passing

Users can now set the cookie once in config file and don't need to export
the environment variable every time they run the application.
@maateen maateen merged commit d620f4e into main Nov 8, 2025
4 checks passed
@maateen maateen deleted the feature/tv-show-support branch November 8, 2025 12:54
@maateen maateen restored the feature/tv-show-support branch November 8, 2025 12:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Include TV Shows

1 participant