do not write as modified if it was added

This commit is contained in:
Jesse Bannon 2022-09-08 10:46:48 -07:00
parent df15e0791c
commit 287eb8ac81
5 changed files with 11 additions and 20 deletions

View file

@ -348,15 +348,18 @@ class FileHandler:
source_file_path = Path(self.working_directory) / file_name source_file_path = Path(self.working_directory) / file_name
output_file_path = Path(self.output_directory) / output_file_name output_file_path = Path(self.output_directory) / output_file_name
# output file exists, see if we modify it # output file exists, and it's not marked as created already, see if we modify it
if os.path.isfile(output_file_path): if (
os.path.isfile(output_file_path)
and output_file_name not in self.file_handler_transaction_log.files_created
):
if not files_equal(source_file_path, output_file_path): if not files_equal(source_file_path, output_file_path):
self._file_handler_transaction_log.log_modified_file( self.file_handler_transaction_log.log_modified_file(
file_name=output_file_name, file_metadata=file_metadata file_name=output_file_name, file_metadata=file_metadata
) )
# output file does not already exist, creates a new file # output file does not already exist, creates a new file
else: else:
self._file_handler_transaction_log.log_created_file( self.file_handler_transaction_log.log_created_file(
file_name=output_file_name, file_metadata=file_metadata file_name=output_file_name, file_metadata=file_metadata
) )

View file

@ -53,7 +53,4 @@ tvshow.nfo
NFO tags: NFO tags:
tvshow: tvshow:
plot: Plugin and map updates for the server Project Zombie. plot: Plugin and map updates for the server Project Zombie.
title: Project / Zombie title: Project / Zombie
Files modified in '{output_directory}'
----------------------------------------
.ytdl-sub-recent-download-archive.json

View file

@ -133,7 +133,4 @@ j_b/[2022] Acoustic Treats/11 - Untold History.mp3
title: Untold History title: Untold History
track: 11 track: 11
year: 2022 year: 2022
j_b/[2022] Acoustic Treats/folder.jpg j_b/[2022] Acoustic Treats/folder.jpg
Files modified in '{output_directory}'
----------------------------------------
.ytdl-sub-jb-download-archive.json

View file

@ -285,7 +285,4 @@ tvshow.nfo
tvshow: tvshow:
plot: Plugin and map updates for the server Project Zombie. plot: Plugin and map updates for the server Project Zombie.
source_uploader: Project Zombie source_uploader: Project Zombie
title: Project / Zombie title: Project / Zombie
Files modified in '{output_directory}'
----------------------------------------
.ytdl-sub-pz-download-archive.json

View file

@ -36,7 +36,4 @@ tvshow.nfo
test: test:
source_description: Trailers, Updates, etc source_description: Trailers, Updates, etc
source_title: Jesse's Minecraft Server source_title: Jesse's Minecraft Server
source_uploader: Project Zombie source_uploader: Project Zombie
Files modified in '{output_directory}'
----------------------------------------
.ytdl-sub-music_video_playlist_test-download-archive.json