refactor: converters

This commit is contained in:
Benexl
2025-07-24 18:38:11 +03:00
parent 5da5dc5dcc
commit 9ba3f88813
3 changed files with 11 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ from typing import Dict, Literal, Optional
from pydantic import BaseModel, Field, computed_field
from ....libs.media_api.types import MediaItem, UserMediaListStatus
from ...utils import converters
from ....core.utils import converters
logger = logging.getLogger(__name__)

View File

@@ -1,10 +0,0 @@
def time_to_seconds(time_str: str) -> int:
"""Convert HH:MM:SS to seconds."""
try:
parts = time_str.split(":")
if len(parts) == 3:
h, m, s = map(int, parts)
return h * 3600 + m * 60 + s
except (ValueError, AttributeError):
pass
return 0

View File

@@ -0,0 +1,10 @@
def time_to_seconds(time_str: str) -> int:
"""Convert HH:MM:SS to seconds."""
try:
parts = time_str.split(":")
if len(parts) == 3:
h, m, s = map(int, parts)
return h * 3600 + m * 60 + s
except (ValueError, AttributeError):
pass
return 0