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).
This commit is contained in:
parent
00be0ff210
commit
d79ada241c
1 changed files with 1 additions and 6 deletions
|
|
@ -228,16 +228,11 @@ class ConfluencePublisher(_ConfluencePublisher):
|
||||||
"""
|
"""
|
||||||
logger.info('pass-through intercept: store_attachment')
|
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)
|
file_name = quote_plus(name)
|
||||||
|
|
||||||
output_basepath = Path(getattr(self.config, 'xconfluence_outdir'))
|
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)
|
file_.parent.mkdir(parents = True, exist_ok = True)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue