Skip to content

Commit d15966e

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

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

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/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)