From baf1130ec1148d007f2c98382c217af4731719c7 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 26 Aug 2017 06:07:44 +0200 Subject: Fix date added Hmm, you never stop learning. Not so obviously we want the st_mtime instead of st_ctime from struct stat, because we're intrested in the *data* modification time, not the metadata modification time... For more info, see https://stackoverflow.com/questions/3385203/regarding- access-time-unix --- indexerwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indexerwidget.cpp b/indexerwidget.cpp index d773485..a3b0cd8 100644 --- a/indexerwidget.cpp +++ b/indexerwidget.cpp @@ -132,12 +132,12 @@ void BeetReader::run(){ quint16 year = file.tag()->year(); QString parentDir = QFileInfo(QString(s)).absolutePath(); QFileInfo albumDir(parentDir); - QDateTime created = albumDir.created(); + QDateTime dateAdded = albumDir.lastModified(); //write to database int artistId = doArtist(artist); int genreId = doGenre(genre); - int albumId = doAlbum(album, year, created); + int albumId = doAlbum(album, year, dateAdded); doSong(title, track, albumId, genreId, artistId, s, length); if(ctr % 100 == 0){ -- cgit v1.2.3-70-g09d2