Browse Source

Correct reference to Sorter vs BaseSorter

Closes #1941
tags/3.4.0RC1
Safihre 4 years ago
parent
commit
63f1d2905f
  1. 10
      sabnzbd/postproc.py

10
sabnzbd/postproc.py

@ -26,7 +26,7 @@ import time
import re import re
import gc import gc
import queue import queue
from typing import List, Optional from typing import List, Optional, Tuple
import sabnzbd import sabnzbd
from sabnzbd.newsunpack import ( from sabnzbd.newsunpack import (
@ -512,7 +512,7 @@ def process_job(nzo: NzbObject):
# TV/Movie/Date Renaming code part 2 - rename and move files to parent folder # TV/Movie/Date Renaming code part 2 - rename and move files to parent folder
if all_ok and file_sorter.sort_file: if all_ok and file_sorter.sort_file:
if newfiles: if newfiles:
workdir_complete, ok = file_sorter.rename(newfiles, workdir_complete) workdir_complete, ok = file_sorter.sorter.rename(newfiles, workdir_complete)
if not ok: if not ok:
nzo.set_unpack_info("Unpack", T("Failed to move files")) nzo.set_unpack_info("Unpack", T("Failed to move files"))
all_ok = False all_ok = False
@ -670,7 +670,7 @@ def process_job(nzo: NzbObject):
return True return True
def prepare_extraction_path(nzo: NzbObject): def prepare_extraction_path(nzo: NzbObject) -> Tuple[str, str, Sorter, bool, Optional[str]]:
"""Based on the information that we have, generate """Based on the information that we have, generate
the extraction path and create the directory. the extraction path and create the directory.
Separated so it can be called from DirectUnpacker Separated so it can be called from DirectUnpacker
@ -1191,7 +1191,7 @@ def rename_and_collapse_folder(oldpath, newpath, files):
return files return files
def set_marker(folder): def set_marker(folder: str) -> Optional[str]:
"""Set marker file and return name""" """Set marker file and return name"""
name = cfg.marker_file() name = cfg.marker_file()
if name: if name:
@ -1207,7 +1207,7 @@ def set_marker(folder):
return name return name
def del_marker(path): def del_marker(path: str):
"""Remove marker file""" """Remove marker file"""
if path and os.path.exists(path): if path and os.path.exists(path):
logging.debug("Removing marker file %s", path) logging.debug("Removing marker file %s", path)

Loading…
Cancel
Save