mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Update pelican_import.py
Use a set to avoid downloading duplicate attachments on a post more than once.
This commit is contained in:
parent
940d4534a1
commit
4d1869002e
2 changed files with 11 additions and 9 deletions
|
|
@ -699,7 +699,7 @@ def get_attachments(xml):
|
|||
else:
|
||||
filename = get_filename(filename, post_id)
|
||||
names[post_id] = filename
|
||||
attachedposts = defaultdict(list)
|
||||
attachedposts = defaultdict(set)
|
||||
for parent, url in attachments:
|
||||
try:
|
||||
parent_name = names[parent]
|
||||
|
|
@ -707,7 +707,7 @@ def get_attachments(xml):
|
|||
# attachment's parent is not a valid post
|
||||
parent_name = None
|
||||
|
||||
attachedposts[parent_name].append(url)
|
||||
attachedposts[parent_name].add(url)
|
||||
return attachedposts
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue