"""Version management utilities for Aniworld application."""

from pathlib import Path
from typing import Optional


def get_version() -> str:
    """
    Get the current application version from Docker/VERSION file.
    
    Returns:
        Version string from the VERSION file, or "unknown" if not found.
    """
    version_file = Path(__file__).parent.parent.parent.parent / "Docker" / "VERSION"
    
    try:
        if version_file.exists():
            return version_file.read_text().strip()
    except Exception:
        pass
    
    return "unknown"


# Module-level version constant (loaded once at import)
APP_VERSION: str = get_version()