mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-26 02:35:57 +02:00
refactor: reformat code
This commit is contained in:
@@ -9,6 +9,7 @@ from torrent.schemas import Torrent
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def list_files_recursively(path: Path = Path(".")) -> list[Path]:
|
||||
files = list(path.glob("**/*"))
|
||||
log.debug(f"Found {len(files)} entries via glob")
|
||||
@@ -28,10 +29,13 @@ def extract_archives(files):
|
||||
for file in files:
|
||||
file_type = mimetypes.guess_type(file)
|
||||
log.debug(f"File: {file}, Size: {file.stat().st_size} bytes, Type: {file_type}")
|
||||
if file_type[0] == 'application/x-compressed':
|
||||
log.debug(f"File {file} is a compressed file, extracting it into directory {file.parent}")
|
||||
if file_type[0] == "application/x-compressed":
|
||||
log.debug(
|
||||
f"File {file} is a compressed file, extracting it into directory {file.parent}"
|
||||
)
|
||||
patoolib.extract_archive(str(file), outdir=str(file.parent))
|
||||
|
||||
|
||||
def get_torrent_filepath(torrent: Torrent):
|
||||
return BasicConfig().torrent_directory / torrent.title
|
||||
|
||||
|
||||
Reference in New Issue
Block a user