Skip to content

Commit 59abfe6

Browse files
committed
#474 WriteMetaFLAC fails on new files on Windows
#474
1 parent 08a8614 commit 59abfe6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

getid3/getid3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ class getID3
387387
*/
388388
protected $startup_warning = '';
389389

390-
const VERSION = '1.9.24-202510150953';
390+
const VERSION = '1.9.24-202510151030';
391391
const FREAD_BUFFER_SIZE = 32768;
392392

393393
const ATTACHMENTS_NONE = false;

getid3/write.metaflac.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,14 @@ public function WriteMetaFLAC() {
121121
$metaflacError = shell_exec($commandline);
122122

123123
if (empty($metaflacError)) {
124-
clearstatcache(true, $this->filename);
125-
if ($timestampbeforewriting == filemtime($this->filename)) {
126-
$metaflacError = 'File modification timestamp has not changed - it looks like the tags were not written';
124+
if (abs(time() - $timestampbeforewriting) < 5) {
125+
// https://github.com/JamesHeinrich/getID3/issues/474
126+
// probably working on a temporary (or otherwise newly-created) file so hack-check file-modification-date will always fail
127+
} else {
128+
clearstatcache(true, $this->filename);
129+
if ($timestampbeforewriting == filemtime($this->filename)) {
130+
$metaflacError = 'File modification timestamp has not changed - it looks like the tags were not written';
131+
}
127132
}
128133
}
129134
} else {

0 commit comments

Comments
 (0)