format files

This commit is contained in:
maxid
2026-02-04 21:34:37 +01:00
parent 3d52a87302
commit 12854ff661
2 changed files with 4 additions and 7 deletions

View File

@@ -64,16 +64,12 @@ class TorznabMixin:
title = item.find("title").text
size_str = item.find("size")
if size_str is None or size_str.text is None:
log.warning(
f"Torznab item {title} has no size, skipping."
)
log.warning(f"Torznab item {title} has no size, skipping.")
continue
try:
size = int(size_str.text or "0")
except ValueError:
log.warning(
f"Torznab item {title} has invalid size, skipping."
)
log.warning(f"Torznab item {title} has invalid size, skipping.")
continue
result = IndexerQueryResult(

View File

@@ -133,7 +133,8 @@ def get_torrent_hash(torrent: IndexerQueryResult) -> str:
:return: The hash of the torrent.
"""
torrent_filepath = (
MediaManagerConfig().misc.torrent_directory / f"{sanitize_filename(torrent.title)}.torrent"
MediaManagerConfig().misc.torrent_directory
/ f"{sanitize_filename(torrent.title)}.torrent"
)
if torrent_filepath.exists():
log.warning(f"Torrent file already exists at: {torrent_filepath}")