Standardize environment variable naming with backwards compatibility#229
Merged
McCloudS merged 1 commit intoMcCloudS:mainfrom Aug 27, 2025
Merged
Conversation
- Add get_env_with_fallback() helper function for seamless migration - Implement consistent UPPERCASE_WITH_UNDERSCORES naming convention - Group variables by logical categories (PLEX_*, JELLYFIN_*, PROCESS_*, SKIP_*, etc.) - Maintain full backwards compatibility with legacy variable names - Add comprehensive documentation explaining new naming convention New standardized names with backwards compatibility: - PLEX_TOKEN (was PLEXTOKEN) - PLEX_SERVER (was PLEXSERVER) - JELLYFIN_TOKEN (was JELLYFINTOKEN) - JELLYFIN_SERVER (was JELLYFINSERVER) - PROCESS_ADDED_MEDIA (was PROCADDEDMEDIA) - PROCESS_MEDIA_ON_PLAY (was PROCMEDIAONPLAY) - SUBTITLE_LANGUAGE_NAME (was NAMESUBLANG) - WEBHOOK_PORT (was WEBHOOKPORT) - SKIP_IF_EXTERNAL_SUBTITLES_EXIST (was SKIPIFEXTERNALSUB) - SKIP_IF_TARGET_SUBTITLES_EXIST (was SKIP_IF_TO_TRANSCRIBE_SUB_ALREADY_EXIST) - SKIP_IF_INTERNAL_SUBTITLES_LANGUAGE (was SKIPIFINTERNALSUBLANG) - SKIP_SUBTITLE_LANGUAGES (was SKIP_LANG_CODES) - SKIP_IF_AUDIO_LANGUAGES (was SKIP_IF_AUDIO_TRACK_IS) - SKIP_ONLY_SUBGEN_SUBTITLES (was ONLY_SKIP_IF_SUBGEN_SUBTITLE) - SKIP_IF_NO_LANGUAGE_BUT_SUBTITLES_EXIST (was SKIP_IF_LANGUAGE_IS_NOT_SET_BUT_SUBTITLES_EXIST) Migration is seamless - both old and new names work simultaneously. New names take precedence when both are set. Tested: All mappings, type conversions, precedence logic, and syntax validation.
McCloudS
approved these changes
Aug 23, 2025
github-actions bot
pushed a commit
that referenced
this pull request
Aug 27, 2025
…229) - Add get_env_with_fallback() helper function for seamless migration - Implement consistent UPPERCASE_WITH_UNDERSCORES naming convention - Group variables by logical categories (PLEX_*, JELLYFIN_*, PROCESS_*, SKIP_*, etc.) - Maintain full backwards compatibility with legacy variable names - Add comprehensive documentation explaining new naming convention New standardized names with backwards compatibility: - PLEX_TOKEN (was PLEXTOKEN) - PLEX_SERVER (was PLEXSERVER) - JELLYFIN_TOKEN (was JELLYFINTOKEN) - JELLYFIN_SERVER (was JELLYFINSERVER) - PROCESS_ADDED_MEDIA (was PROCADDEDMEDIA) - PROCESS_MEDIA_ON_PLAY (was PROCMEDIAONPLAY) - SUBTITLE_LANGUAGE_NAME (was NAMESUBLANG) - WEBHOOK_PORT (was WEBHOOKPORT) - SKIP_IF_EXTERNAL_SUBTITLES_EXIST (was SKIPIFEXTERNALSUB) - SKIP_IF_TARGET_SUBTITLES_EXIST (was SKIP_IF_TO_TRANSCRIBE_SUB_ALREADY_EXIST) - SKIP_IF_INTERNAL_SUBTITLES_LANGUAGE (was SKIPIFINTERNALSUBLANG) - SKIP_SUBTITLE_LANGUAGES (was SKIP_LANG_CODES) - SKIP_IF_AUDIO_LANGUAGES (was SKIP_IF_AUDIO_TRACK_IS) - SKIP_ONLY_SUBGEN_SUBTITLES (was ONLY_SKIP_IF_SUBGEN_SUBTITLE) - SKIP_IF_NO_LANGUAGE_BUT_SUBTITLES_EXIST (was SKIP_IF_LANGUAGE_IS_NOT_SET_BUT_SUBTITLES_EXIST) Migration is seamless - both old and new names work simultaneously. New names take precedence when both are set. Tested: All mappings, type conversions, precedence logic, and syntax validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Standardize Environment Variable Naming with Backwards Compatibility
Overview
This PR standardizes environment variable naming throughout the codebase while maintaining full backwards compatibility. The inconsistent naming patterns (some with underscores, some without) have been unified under a clear, logical convention.
Problem
The current environment variables use inconsistent naming patterns:
WHISPER_MODEL,TRANSCRIBE_DEVICE,SKIP_LANG_CODESPLEXTOKEN,JELLYFINSERVER,PROCADDEDMEDIA,NAMESUBLANGThis inconsistency creates confusion for users and makes the codebase harder to maintain.
Solution
New Naming Convention
UPPERCASE_WITH_UNDERSCORESKey Implementation
get_env_with_fallback()for seamless migrationEnvironment Variable Mappings
Server Integration
Processing Control
Subtitle Configuration
Migration Strategy
Testing
Benefits
Files Changed
subgen.py: Environment variable declarations and documentationBreaking Changes
None - Full backwards compatibility maintained.
Migration Timeline
This PR provides a solid foundation for consistent environment variable management while ensuring zero disruption to existing users.