mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 03:27:40 +01:00
Don't download the Magnatune catalogue every time.
This commit is contained in:
parent
b8a78abe06
commit
19ea38b0a1
@ -119,9 +119,6 @@ void MagnatuneService::LazyPopulate(RadioItem *item) {
|
||||
model()->merged_model()->AddSubModel(
|
||||
model()->index(root_->row, 0, model()->ItemToIndex(item->parent)),
|
||||
library_sort_model_);
|
||||
|
||||
if (total_song_count_ == 0)
|
||||
ReloadDatabase();
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -131,6 +128,13 @@ void MagnatuneService::LazyPopulate(RadioItem *item) {
|
||||
item->lazy_loaded = true;
|
||||
}
|
||||
|
||||
void MagnatuneService::UpdateTotalSongCount(int count) {
|
||||
total_song_count_ = count;
|
||||
if (total_song_count_ == 0 && !load_database_task_id_) {
|
||||
ReloadDatabase();
|
||||
}
|
||||
}
|
||||
|
||||
void MagnatuneService::ReloadDatabase() {
|
||||
QNetworkRequest request = QNetworkRequest(QUrl(kDatabaseUrl));
|
||||
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute,
|
||||
|
@ -90,7 +90,7 @@ class MagnatuneService : public RadioService {
|
||||
void DownloadFinished(const QStringList& albums);
|
||||
|
||||
private slots:
|
||||
void UpdateTotalSongCount(int count) { total_song_count_ = count; }
|
||||
void UpdateTotalSongCount(int count);
|
||||
void ReloadDatabase();
|
||||
void ReloadDatabaseFinished();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user