From d79ada241c2feb6b8d503d09e7c176a75b3ea583 Mon Sep 17 00:00:00 2001 From: "Rodweil, Theodor" Date: Mon, 7 Aug 2023 18:58:11 +0200 Subject: [PATCH] refactor: change attachment output path for better clarity on the output, we're prefixing the name of the container page to the path of the attachment (as its parent directory). --- src/xconfluencebuilder/__init__.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/xconfluencebuilder/__init__.py b/src/xconfluencebuilder/__init__.py index f4efc0c..68b8e17 100644 --- a/src/xconfluencebuilder/__init__.py +++ b/src/xconfluencebuilder/__init__.py @@ -228,16 +228,11 @@ class ConfluencePublisher(_ConfluencePublisher): """ logger.info('pass-through intercept: store_attachment') - # 😭 i wanted to use this method so bad, but since we're ditching - # hashing altogether, this isn't necessary. We'll keep it as an - # orbituary 🪦 - # mime_extension = guess_extension(mimetype, False) - file_name = quote_plus(name) output_basepath = Path(getattr(self.config, 'xconfluence_outdir')) - file_ = output_basepath / 'attachments' / file_name + file_ = output_basepath / 'attachments' / quote_plus(page_id) / file_name file_.parent.mkdir(parents = True, exist_ok = True)