Only do incremental update if we have cache

This commit is contained in:
craig
2012-01-24 19:30:51 +00:00
committed by craig
parent dee2a5eea4
commit ee293db617

View File

@@ -402,8 +402,13 @@ void MusicLibraryModel::updateMusicLibrary(MusicLibraryItemRoot *newroot, QDateT
}
bool updatedSongs=false;
bool incremental=rootItem->childCount() && newroot->childCount();
if (rootItem->childCount() && newroot->childCount()) {
if (incremental && !QFile::exists(Network::cacheDir(constLibraryCache, false)+QFile::encodeName(Settings::self()->connectionHost() + constLibraryExt))) {
incremental=false;
}
if (incremental) {
QSet<Song> currentSongs=rootItem->allSongs();
QSet<Song> updateSongs=newroot->allSongs();
QSet<Song> removed=currentSongs-updateSongs;