Expand description
Unit conversion and formatting utilities
This module provides centralized conversion functions for:
- Jellyfin tick-to-seconds conversions
- Volume normalization (0-1 vs 0-100 ranges)
- Time formatting for UI display
These utilities eliminate magic numbers and duplicate conversion logic across the codebase.
Constants§
- TICKS_
PER_ SECOND - Number of Jellyfin ticks per second (10 million)
Functions§
- calculate_
progress - Calculate progress percentage from position and duration
- format_
time - Format time in seconds to MM:SS display string
- format_
time_ long - Format time in seconds to HH:MM:SS or MM:SS display string
- percent_
to_ volume - Convert percentage volume (0-100) to normalized (0.0-1.0)
- seconds_
to_ ticks - Convert seconds to Jellyfin ticks
- ticks_
to_ seconds - Convert Jellyfin ticks to seconds
- volume_
to_ percent - Convert normalized volume (0.0-1.0) to percentage (0-100)