Skip to content

Commit

Permalink
refactor: rename implace as in_place
Browse files Browse the repository at this point in the history
also add enum to check if hash should be generated after each download
  • Loading branch information
datawhores committed Nov 18, 2024
1 parent 571cf1f commit 9d50e3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions cyberdrop_dl/clients/hash_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,8 @@ async def hash_item(self, file: Path | str, original_filename: str, referer: URL
async def hash_item_during_download(self, media_item: MediaItem) -> None:
try:

if not self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["enable_dedupe_settings"]:
return
if self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["Hashing_Modications"]["hash_after_all_downloads"]:
return
await self.hash_item_helper(media_item.complete_file, media_item.original_filename, media_item.referer)
if self.manager.config_manager.settings_data["Dupe_Cleanup_Options"]["hashing"].IN_PLACE:
await self.hash_item_helper(media_item.complete_file, media_item.original_filename, media_item.referer)
except Exception as e:
log(f"After hash processing failed: {media_item.complete_file} with error {e}", 40, exc_info=True)

Expand Down
2 changes: 1 addition & 1 deletion cyberdrop_dl/utils/data_enums_classes/hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class Hashing(Enum):
OFF= 0
IMPLACE = 1
IN_PLACE = 1
POST_DOWNLOAD = 2

class Dedupe(Enum):
Expand Down

0 comments on commit 9d50e3f

Please sign in to comment.