Rename cache album covers to download album covers and only do it for

favorite requests
This commit is contained in:
Jonas Kvinge 2019-07-01 01:01:30 +02:00
parent 9083c578cc
commit c2a6def8b9
16 changed files with 30 additions and 28 deletions

View File

@ -904,7 +904,8 @@ void QobuzRequest::SongsFinishCheck(const qint64 artist_id, const QString &album
if (!album_songs_requests_queue_.isEmpty() && album_songs_requests_active_ < kMaxConcurrentAlbumSongsRequests) FlushAlbumSongsRequests();
if (
service_->cache_album_covers() &&
service_->download_album_covers() &&
IsQuery() &&
songs_requests_queue_.isEmpty() &&
songs_requests_active_ <= 0 &&
album_songs_requests_queue_.isEmpty() &&

View File

@ -96,7 +96,7 @@ QobuzService::QobuzService(Application *app, QObject *parent)
artistssearchlimit_(1),
albumssearchlimit_(1),
songssearchlimit_(1),
cache_album_covers_(true),
download_album_covers_(true),
pending_search_id_(0),
next_pending_search_id_(1),
search_id_(0),
@ -205,7 +205,7 @@ void QobuzService::ReloadSettings() {
artistssearchlimit_ = s.value("artistssearchlimit", 4).toInt();
albumssearchlimit_ = s.value("albumssearchlimit", 10).toInt();
songssearchlimit_ = s.value("songssearchlimit", 10).toInt();
cache_album_covers_ = s.value("cachealbumcovers", true).toBool();
download_album_covers_ = s.value("cachealbumcovers", true).toBool();
user_auth_token_ = s.value("user_auth_token").toString();

View File

@ -78,7 +78,7 @@ class QobuzService : public InternetService {
int artistssearchlimit() { return artistssearchlimit_; }
int albumssearchlimit() { return albumssearchlimit_; }
int songssearchlimit() { return songssearchlimit_; }
bool cache_album_covers() { return cache_album_covers_; }
bool download_album_covers() { return download_album_covers_; }
QString user_auth_token() { return user_auth_token_; }
@ -198,7 +198,7 @@ class QobuzService : public InternetService {
int artistssearchlimit_;
int albumssearchlimit_;
int songssearchlimit_;
bool cache_album_covers_;
bool download_album_covers_;
QString user_auth_token_;

View File

@ -81,7 +81,7 @@ void QobuzSettingsPage::Load() {
ui_->artistssearchlimit->setValue(s.value("artistssearchlimit", 4).toInt());
ui_->albumssearchlimit->setValue(s.value("albumssearchlimit", 10).toInt());
ui_->songssearchlimit->setValue(s.value("songssearchlimit", 10).toInt());
ui_->checkbox_cache_album_covers->setChecked(s.value("cachealbumcovers", true).toBool());
ui_->checkbox_download_album_covers->setChecked(s.value("downloadalbumcovers", true).toBool());
s.endGroup();
@ -105,7 +105,7 @@ void QobuzSettingsPage::Save() {
s.setValue("artistssearchlimit", ui_->artistssearchlimit->value());
s.setValue("albumssearchlimit", ui_->albumssearchlimit->value());
s.setValue("songssearchlimit", ui_->songssearchlimit->value());
s.setValue("cachealbumcovers", ui_->checkbox_cache_album_covers->isChecked());
s.setValue("downloadalbumcovers", ui_->checkbox_download_album_covers->isChecked());
s.endGroup();
service_->ReloadSettings();

View File

@ -217,9 +217,9 @@
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkbox_cache_album_covers">
<widget class="QCheckBox" name="checkbox_download_album_covers">
<property name="text">
<string>Cache album covers</string>
<string>Download album covers</string>
</property>
</widget>
</item>

View File

@ -67,7 +67,7 @@ void SubsonicSettingsPage::Load() {
if (password.isEmpty()) ui_->password->clear();
else ui_->password->setText(QString::fromUtf8(QByteArray::fromBase64(password)));
ui_->checkbox_verify_certificate->setChecked(s.value("verifycertificate", false).toBool());
ui_->checkbox_cache_album_covers->setChecked(s.value("cachealbumcovers", true).toBool());
ui_->checkbox_download_album_covers->setChecked(s.value("downloadalbumcovers", true).toBool());
s.endGroup();
}
@ -81,7 +81,7 @@ void SubsonicSettingsPage::Save() {
s.setValue("username", ui_->username->text());
s.setValue("password", QString::fromUtf8(ui_->password->text().toUtf8().toBase64()));
s.setValue("verifycertificate", ui_->checkbox_verify_certificate->isChecked());
s.setValue("cachealbumcovers", ui_->checkbox_cache_album_covers->isChecked());
s.setValue("downloadalbumcovers", ui_->checkbox_download_album_covers->isChecked());
s.endGroup();
service_->ReloadSettings();

View File

@ -128,9 +128,9 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkbox_cache_album_covers">
<widget class="QCheckBox" name="checkbox_download_album_covers">
<property name="text">
<string>Cache album covers</string>
<string>Download album covers</string>
</property>
</widget>
</item>

View File

@ -101,7 +101,7 @@ void TidalSettingsPage::Load() {
ui_->albumssearchlimit->setValue(s.value("albumssearchlimit", 10).toInt());
ui_->songssearchlimit->setValue(s.value("songssearchlimit", 10).toInt());
ui_->checkbox_fetchalbums->setChecked(s.value("fetchalbums", false).toBool());
ui_->checkbox_cache_album_covers->setChecked(s.value("cachealbumcovers", true).toBool());
ui_->checkbox_download_album_covers->setChecked(s.value("downloadalbumcovers", true).toBool());
dialog()->ComboBoxLoadFromSettings(s, ui_->coversize, "coversize", "320x320");
StreamUrlMethod stream_url = static_cast<StreamUrlMethod>(s.value("streamurl").toInt());
@ -133,7 +133,7 @@ void TidalSettingsPage::Save() {
s.setValue("albumssearchlimit", ui_->albumssearchlimit->value());
s.setValue("songssearchlimit", ui_->songssearchlimit->value());
s.setValue("fetchalbums", ui_->checkbox_fetchalbums->isChecked());
s.setValue("cachealbumcovers", ui_->checkbox_cache_album_covers->isChecked());
s.setValue("downloadalbumcovers", ui_->checkbox_download_album_covers->isChecked());
s.setValue("coversize", ui_->coversize->itemData(ui_->coversize->currentIndex()));
s.setValue("streamurl", ui_->streamurl->itemData(ui_->streamurl->currentIndex()));
s.endGroup();

View File

@ -224,9 +224,9 @@
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkbox_cache_album_covers">
<widget class="QCheckBox" name="checkbox_download_album_covers">
<property name="text">
<string>Cache album covers</string>
<string>Download album covers</string>
</property>
</widget>
</item>

View File

@ -72,7 +72,7 @@ class SubsonicBaseRequest : public QObject {
QString username() { return service_->username(); }
QString password() { return service_->password(); }
bool verify_certificate() { return service_->verify_certificate(); }
bool cache_album_covers() { return service_->cache_album_covers(); }
bool download_album_covers() { return service_->download_album_covers(); }
private:

View File

@ -434,7 +434,7 @@ void SubsonicRequest::SongsFinishCheck() {
if (!album_songs_requests_queue_.isEmpty() && album_songs_requests_active_ < kMaxConcurrentAlbumSongsRequests) FlushAlbumSongsRequests();
if (
cache_album_covers() &&
download_album_covers() &&
album_songs_requests_queue_.isEmpty() &&
album_songs_requests_active_ <= 0 &&
album_cover_requests_queue_.isEmpty() &&

View File

@ -70,7 +70,7 @@ SubsonicService::SubsonicService(Application *app, QObject *parent)
collection_model_(nullptr),
collection_sort_model_(new QSortFilterProxyModel(this)),
verify_certificate_(false),
cache_album_covers_(true)
download_album_covers_(true)
{
app->player()->RegisterUrlHandler(url_handler_);
@ -112,7 +112,7 @@ void SubsonicService::ReloadSettings() {
else password_ = QString::fromUtf8(QByteArray::fromBase64(password));
verify_certificate_ = s.value("verifycertificate", false).toBool();
cache_album_covers_ = s.value("cachealbumcovers", true).toBool();
download_album_covers_ = s.value("cachealbumcovers", true).toBool();
s.endGroup();

View File

@ -67,7 +67,7 @@ class SubsonicService : public InternetService {
QString username() { return username_; }
QString password() { return password_; }
bool verify_certificate() { return verify_certificate_; }
bool cache_album_covers() { return cache_album_covers_; }
bool download_album_covers() { return download_album_covers_; }
CollectionBackend *collection_backend() { return collection_backend_; }
CollectionModel *collection_model() { return collection_model_; }
@ -120,7 +120,7 @@ class SubsonicService : public InternetService {
QString username_;
QString password_;
bool verify_certificate_;
bool cache_album_covers_;
bool download_album_covers_;
};

View File

@ -862,7 +862,8 @@ void TidalRequest::SongsFinishCheck(const qint64 artist_id, const qint64 album_i
if (!album_songs_requests_queue_.isEmpty() && album_songs_requests_active_ < kMaxConcurrentAlbumSongsRequests) FlushAlbumSongsRequests();
if (
service_->cache_album_covers() &&
service_->download_album_covers() &&
IsQuery() &&
songs_requests_queue_.isEmpty() &&
songs_requests_active_ <= 0 &&
album_songs_requests_queue_.isEmpty() &&

View File

@ -102,7 +102,7 @@ TidalService::TidalService(Application *app, QObject *parent)
albumssearchlimit_(1),
songssearchlimit_(1),
fetchalbums_(true),
cache_album_covers_(true),
download_album_covers_(true),
pending_search_id_(0),
next_pending_search_id_(1),
search_id_(0),
@ -217,7 +217,7 @@ void TidalService::ReloadSettings() {
songssearchlimit_ = s.value("songssearchlimit", 10).toInt();
fetchalbums_ = s.value("fetchalbums", false).toBool();
coversize_ = s.value("coversize", "320x320").toString();
cache_album_covers_ = s.value("cachealbumcovers", true).toBool();
download_album_covers_ = s.value("cachealbumcovers", true).toBool();
stream_url_method_ = static_cast<TidalSettingsPage::StreamUrlMethod>(s.value("streamurl").toInt());
user_id_ = s.value("user_id").toInt();

View File

@ -83,7 +83,7 @@ class TidalService : public InternetService {
int songssearchlimit() { return songssearchlimit_; }
bool fetchalbums() { return fetchalbums_; }
QString coversize() { return coversize_; }
bool cache_album_covers() { return cache_album_covers_; }
bool download_album_covers() { return download_album_covers_; }
TidalSettingsPage::StreamUrlMethod stream_url_method() { return stream_url_method_; }
QString access_token() { return access_token_; }
@ -218,7 +218,7 @@ class TidalService : public InternetService {
int songssearchlimit_;
bool fetchalbums_;
QString coversize_;
bool cache_album_covers_;
bool download_album_covers_;
TidalSettingsPage::StreamUrlMethod stream_url_method_;
QString access_token_;