1
0
Fork 0
mirror of synced 2024-09-21 03:42:07 +12:00

Merge pull request #692 from OMEGARAZER/hardlink_to

This commit is contained in:
Serene 2022-11-09 09:55:54 +10:00 committed by GitHub
commit 25fdd28037
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -114,7 +114,10 @@ class RedditDownloader(RedditConnector):
f'Resource hash {resource_hash} from submission {submission.id} downloaded elsewhere')
return
elif self.args.make_hard_links:
self.master_hash_list[resource_hash].link_to(destination)
try:
destination.hardlink_to(self.master_hash_list[resource_hash])
except AttributeError:
self.master_hash_list[resource_hash].link_to(destination)
logger.info(
f'Hard link made linking {destination} to {self.master_hash_list[resource_hash]}'
f' in submission {submission.id}')