Skip to content

Commit 34c9241

Browse files
authored
Merge pull request #1655 from sbrunner/ghci/backport/1654-to-master
[Backport master] Fix extends config path
2 parents 44eaca8 + 555c93e commit 34c9241

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scan_to_paperless/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def get_config(config_filename: Path) -> schema.Configuration:
3434
config = cast("schema.Configuration", yaml.load(config_file))
3535
if "extends" in config:
3636
base_config = get_config(
37-
config_filename.parent / Path(config["extends"]).expanduser().resolve(),
37+
(config_filename.parent / config["extends"]).expanduser().resolve(),
3838
)
3939

4040
strategies_config = cast("schema.MergeStrategies", config.get("strategies", {}))

scan_to_paperless/scan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def main() -> None:
228228
continue
229229
images.append(Path("source") / img)
230230

231-
regex = re.compile(rf"^source\/image\-([0-9]+)\.{config.get('extension', schema.EXTENSION_DEFAULT)}$")
231+
regex = re.compile(rf".*/source/image\-([0-9]+)\.{config.get('extension', schema.EXTENSION_DEFAULT)}$")
232232

233233
def image_match(image_path: Path) -> int:
234234
match = regex.match(str(image_path))
@@ -238,7 +238,7 @@ def image_match(image_path: Path) -> int:
238238
images = sorted(images, key=image_match)
239239
if images:
240240
process_config = {
241-
"images": images,
241+
"images": [str(image) for image in images],
242242
"args": args_,
243243
}
244244
yaml = YAML()

0 commit comments

Comments
 (0)