=== modified file 'mixxx/src/library/libraryscanner.cpp' --- mixxx/src/library/libraryscanner.cpp 2010-09-13 03:49:06 +0000 +++ mixxx/src/library/libraryscanner.cpp 2010-09-13 18:53:59 +0000 @@ -44,6 +44,23 @@ //wrong track location. connect(this, SIGNAL(scanFinished()), &(collection->getTrackDAO()), SLOT(clearCache())); + + /* The "Album Artwork" folder within iTunes stores Album Arts. + * It has numerous hundreds of sub folders but no audio files + * We put this folder on a "black list" + * On Windows, the iTunes folder is contained within the standard music folder + * Hence, Mixxx will scan the "Album Arts folder" for standard users which is wasting time + */ + m_iTunesArtFolder = ""; + #if defined(__WINDOWS__) + QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", QSettings::NativeFormat); + // if the value method fails it returns QTDir::homePath + m_iTunesArtFolder = settings.value("My Music", QDir::homePath()).toString(); + m_iTunesArtFolder += "\\iTunes\\Album Artwork"; + m_iTunesArtFolder.replace(QString("\\"), QString("/")); + #elif defined(__APPLE__) + m_iTunesArtFolder = QDir::homePath() + "/Music/iTunes/Album Artwork"; + #endif } @@ -202,7 +219,21 @@ // Runs inside a transaction m_trackDao.addTracks(tracksToAdd); - + + //Clear all TIOs in tracksToAdd since it wastes huge memory on large music collections + for (int i = 0; i < tracksToAdd.size(); ++i) + { + TrackInfoObject* pTrack = tracksToAdd.at(i); + delete pTrack; + } + tracksToAdd.clear(); + /* Note that the internal array only ever gets bigger over the life of the list. + * It never shrinks. The internal array is deallocated by the destructor and by + * the assignment operator, when one list is assigned to another. + */ + QList emtpy; + tracksToAdd = emtpy; + //Start a transaction for all the library hashing (moved file detection) //stuff. m_database.transaction(); @@ -377,12 +408,18 @@ if (cancel) return false; - + //Look at all the subdirectories and scan them recursively... QDirIterator dirIt(dirPath, QDir::Dirs | QDir::NoDotAndDotDot); while (dirIt.hasNext() && bScanFinishedCleanly) { - if (!recursiveScan(dirIt.next(), tracksToAdd)) + QString nextPath = dirIt.next(); + + //Don' scan "Album Artwork" within iTunes folder since it has too many sub folder containing no audio files + if(nextPath == m_iTunesArtFolder){ + continue; + } + if (!recursiveScan(nextPath, tracksToAdd)) bScanFinishedCleanly = false; } === modified file 'mixxx/src/library/libraryscanner.h' --- mixxx/src/library/libraryscanner.h 2010-09-13 00:42:56 +0000 +++ mixxx/src/library/libraryscanner.h 2010-09-13 18:43:19 +0000 @@ -64,6 +64,7 @@ QStringList nameFilters; bool m_bCancelLibraryScan; QMutex m_libraryScanMutex; + QString m_iTunesArtFolder; }; #endif