Skip to content

Enhance SRT parsing and optimize subtitle loading. Also some EventInfo fixes#1244

Merged
Huevos merged 1 commit intoOpenViX:Developerfrom
DimitarCC:fixes-1
Mar 30, 2026
Merged

Enhance SRT parsing and optimize subtitle loading. Also some EventInfo fixes#1244
Huevos merged 1 commit intoOpenViX:Developerfrom
DimitarCC:fixes-1

Conversation

@DimitarCC
Copy link
Copy Markdown
Contributor

This pull request introduces significant improvements to subtitle parsing and event handling, focusing on performance, maintainability, and feature support. The most notable changes include a major refactor of the SubRipParser for faster and more robust SRT subtitle parsing, additional event handling in EventInfo.py, and improved subtitle loading logic.

Subtitle Parsing Improvements:

  • Major refactor of SubRipParser in SubRip.py:
    • Rewrote SRT parsing to use a faster, single-pass line-based approach instead of regex-heavy parsing.
    • Improved tag and style handling with precompiled regexes and simplified logic for color and style parsing.
    • Added robust helper methods for tag removal, color extraction, and style detection, making the code more maintainable and efficient.

Event Handling Enhancements:

  • EventInfo.py now listens for two new service events: evUpdateTags and evUpdateIDv3Cover, ensuring that the UI responds to more metadata changes.
  • Fixed a bug in gotEvent where the internal service reference is now correctly cleared on all relevant events, improving state consistency.

Subtitle Loader Logic:

  • Improved loadSubtitles in SubtitleRenderer.py to return a boolean indicating success, clarifying the method’s contract and simplifying error handling for SRT subtitles.

…for SRT parsing

[EventInfo] Small enhancements
[SubRip] Optimized parsing of SRT subs
@DimitarCC DimitarCC changed the title Enhance SRT parsing and optimize subtitle loading Enhance SRT parsing and optimize subtitle loading. Also some EventInfo fixes Mar 29, 2026
@Orlandoxx
Copy link
Copy Markdown
Contributor

Looks good !

@Huevos Huevos merged commit 9c2b237 into OpenViX:Developer Mar 30, 2026
1 check passed
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