diff options
author | Patrick C. McGinty <casey.mcginty@gmail.com> | 2011-03-20 16:47:29 -1000 |
---|---|---|
committer | Patrick C. McGinty <casey.mcginty@gmail.com> | 2011-03-20 16:47:29 -1000 |
commit | 60e9c1ebda68d3fb18c786a94b0e361f6493ccb0 (patch) | |
tree | c1d971c96f2424d9301c7cf1a08692e97c698fdf | |
parent | 42a8a20603ba21a1db3d77a62cd75b8e4ec552f2 (diff) |
Fix 'Preserve Modification Time' option for FLAC files.
Resolve condition when 'preserve modification time' feature is
disabled, FLAC files would not have their modification times changed.
Secondly, it disables easytag from incorrectly warning the user that the
file was changed by an external program, when easytag writes the file.
-rw-r--r-- | src/easytag.c | 2 | ||||
-rw-r--r-- | src/et_core.c | 5 | ||||
-rw-r--r-- | src/flac_tag.c | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/easytag.c b/src/easytag.c index 94c1d60..baac362 100644 --- a/src/easytag.c +++ b/src/easytag.c @@ -2197,7 +2197,7 @@ gint Save_List_Of_Files (GList *etfilelist, gboolean force_saving_files) gchar *msg; gint response; - msg = g_strdup_printf(_("Be careful, severals files (%d file(s)) were changed by an external program.\n" + msg = g_strdup_printf(_("Be careful, several files (%d file(s)) were changed by an external program.\n" "Do you want to continue anyway?"),nb_files_changed_by_ext_program); msgbox = msg_box_new(_("Saving File(s)..."), GTK_WINDOW(MainWindow), diff --git a/src/et_core.c b/src/et_core.c index 567a4bf..d8d1930 100644 --- a/src/et_core.c +++ b/src/et_core.c @@ -3718,6 +3718,11 @@ gboolean ET_Save_File_Tag_To_HD (ET_File *ETFile) } } + // update the stored file modification time to prevent easytag + // from warning that an external program has changed the file + if ( stat(cur_filename,&statbuf)!=-1 ) + ETFile->FileModificationTime = statbuf.st_mtime; + if (state==TRUE) { diff --git a/src/flac_tag.c b/src/flac_tag.c index d8abf2f..19c4c48 100644 --- a/src/flac_tag.c +++ b/src/flac_tag.c @@ -1123,7 +1123,7 @@ gboolean Flac_Tag_Write_File_Tag (ET_File *ETFile) FLAC__metadata_chain_sort_padding(chain); // Write tag - if ( !FLAC__metadata_chain_write(chain, /*padding*/TRUE, /*preserve_file_stats*/TRUE) ) + if ( !FLAC__metadata_chain_write(chain, /*padding*/TRUE, PRESERVE_MODIFICATION_TIME) ) { // Error with "FLAC__metadata_chain_write" FLAC__Metadata_ChainStatus status = FLAC__metadata_chain_status(chain); |