Skip to content

Commit

Permalink
Separate attr and mtime copy to mtime is done even is there is proble…
Browse files Browse the repository at this point in the history
…m with attr
  • Loading branch information
kassoulet committed Oct 30, 2024
1 parent 166dbfc commit 221994d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions soundconverter/gstreamer/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,15 @@ def _conversion_done(self):
# Copy file permissions
source = Gio.file_parse_name(self.sound_file.uri)
destination = Gio.file_parse_name(newname)
source.copy_attributes(destination, Gio.FileCopyFlags.NONE)

source.copy_attributes(destination, Gio.FileCopyFlags.ALL_METADATA)
except Exception as error:
logger.error(
"Could not set some attributes of the target '{}': {}".format(
beautify_uri(newname),
str(error)
)
)
try:
# the modification date of the destination should be now
info = Gio.FileInfo()
now = GLib.DateTime.new_now(GLib.TimeZone())
Expand All @@ -442,7 +449,7 @@ def _conversion_done(self):
)
except Exception as error:
logger.error(
"Could not set some attributes of the target '{}': {}".format(
"Could not set modification time of the target '{}': {}".format(
beautify_uri(newname),
str(error)
)
Expand Down

0 comments on commit 221994d

Please sign in to comment.