mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 15:43:28 +02:00
format files
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user