Skip to content

Commit 6f4fd8d

Browse files
committed
AttributeError: 'PosixPath' object has no attribute 'startswith'
1 parent 3a5aceb commit 6f4fd8d

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

library/createdb/fs_add.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def scan_path(args, path_str: str) -> int:
234234
n_jobs = None
235235
if args.verbose >= consts.LOG_DEBUG:
236236
n_jobs = 1
237-
elif args.threads != -1:
237+
elif args.threads and args.threads != -1:
238238
n_jobs = args.threads
239239
elif getattr(args, "process", False):
240240
n_jobs = max(1, int(os.cpu_count() or 4) // 2)

library/createdb/fs_add_metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ def extract_metadata(mp_args, path) -> dict[str, str | int | None] | None:
110110
m["hash"] = sample_hash.sample_hash_file(path)
111111

112112
if getattr(mp_args, "copy", False) and not file_utils.is_file_open(path):
113-
path = m["path"] = shell_utils.copy(mp_args, path, mp_args.copy)
113+
path = m["path"] = shell_utils.copy(mp_args, path, str(mp_args.copy))
114114

115115
if getattr(mp_args, "move", False) and not file_utils.is_file_open(path):
116-
path = m["path"] = shell_utils.rel_move(mp_args, path, mp_args.move)
116+
path = m["path"] = shell_utils.rel_move(mp_args, path, str(mp_args.move))
117117

118118
if getattr(mp_args, "process", False):
119119
if objects.is_profile(mp_args, DBType.audio) and Path(path).suffix not in [".opus", ".mka"]:

library/folders/merge_mv.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import concurrent.futures, os, shutil
22
from pathlib import Path
3+
from typing import Iterable
34

45
from library import usage
56
from library.folders import filter_src
@@ -133,7 +134,7 @@ def mcp_file(args, source, destination):
133134
log.debug("copied %s\t%s", source, out)
134135

135136

136-
def gen_src_dest(args, sources, destination, shortcut_allowed=False):
137+
def gen_src_dest(args, sources: Iterable[str], destination: str, shortcut_allowed=False):
137138
for source in sources:
138139
if args.relative_to: # modify the destination for each source
139140
source_destination = path_utils.gen_rel_path(source, destination, args.relative_to)

library/playback/post_actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
def mv_to_keep_folder(args, src: str) -> str:
18-
keep_dir = args.keep_dir
18+
keep_dir = str(args.keep_dir)
1919
if not args.keep_dir.startswith(":/"):
2020
p = Path(src)
2121
if os.path.isabs(keep_dir):

library/utils/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def reddit_frequency(frequency) -> str:
219219
"|v210|yuv10|vag|vc1|rcv|vob|viv|vpk|vqf|vql|vqe|wmv|wsd|xmv|xvag|yop|y4m"
220220
).split("|")
221221
)
222-
SUBTITLE_EXTENSIONS = set("srt|vtt|mks".split("|"))
222+
SUBTITLE_EXTENSIONS = set("srt|vtt|mks|ass|ssa".split("|"))
223223
TEXTRACT_EXTENSIONS = set(
224224
"csv|tab|tsv|doc|docx|eml|epub|json|htm|html|msg|odt|pdf|pptx|ps|rtf|txt|log|xlsx|xls".split("|")
225225
)

library/utils/processes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
from typing import NoReturn
66

77
from library.data import unar_errors
8-
from library.utils import consts, iterables, nums, path_utils, strings
9-
from library.utils import shell_utils
8+
from library.utils import consts, iterables, nums, path_utils, shell_utils, strings
109
from library.utils.log_utils import log
1110
from library.utils.objects import traverse_obj
1211

0 commit comments

Comments
 (0)