This commit is contained in:
2026-02-02 19:49:07 -08:00
parent 8d22ec5a81
commit 1e0000ae19
13 changed files with 297 additions and 988 deletions

View File

@@ -7,6 +7,7 @@ from typing import Any, Dict, List, Optional, Tuple
from ProviderCore.base import Provider, SearchResult
from SYS.logger import log
from SYS.utils import format_bytes
def _get_podcastindex_credentials(config: Dict[str, Any]) -> Tuple[str, str]:
@@ -79,23 +80,8 @@ class PodcastIndex(Provider):
@staticmethod
def _format_bytes(value: Any) -> str:
try:
n = int(value)
except Exception:
return ""
if n <= 0:
return ""
units = ["B", "KB", "MB", "GB", "TB"]
size = float(n)
unit = units[0]
for u in units:
unit = u
if size < 1024.0 or u == units[-1]:
break
size /= 1024.0
if unit == "B":
return f"{int(size)}{unit}"
return f"{size:.1f}{unit}"
"""Format bytes using centralized utility."""
return format_bytes(value)
@staticmethod
def _format_date_from_epoch(value: Any) -> str: