1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-21 21:15:20 +01:00

Remove stream schema setting and add Add HI_RES option

This commit is contained in:
Jonas Kvinge 2019-05-14 18:45:38 +02:00
parent 7cc9c75d15
commit 2ad1d27a59
4 changed files with 1 additions and 46 deletions

View File

@ -55,10 +55,7 @@ TidalSettingsPage::TidalSettingsPage(SettingsDialog *parent)
ui_->quality->addItem("Low", "LOW"); ui_->quality->addItem("Low", "LOW");
ui_->quality->addItem("High", "HIGH"); ui_->quality->addItem("High", "HIGH");
ui_->quality->addItem("Lossless", "LOSSLESS"); ui_->quality->addItem("Lossless", "LOSSLESS");
ui_->quality->addItem("Hi resolution", "HI_RES");
ui_->streamurl->addItem("Default", "default");
ui_->streamurl->addItem("HTTP", "http");
ui_->streamurl->addItem("HTTPS", "https");
ui_->coversize->addItem("160x160", "160x160"); ui_->coversize->addItem("160x160", "160x160");
ui_->coversize->addItem("320x320", "320x320"); ui_->coversize->addItem("320x320", "320x320");
@ -88,7 +85,6 @@ void TidalSettingsPage::Load() {
ui_->songssearchlimit->setValue(s.value("songssearchlimit", 100).toInt()); ui_->songssearchlimit->setValue(s.value("songssearchlimit", 100).toInt());
ui_->checkbox_fetchalbums->setChecked(s.value("fetchalbums", false).toBool()); ui_->checkbox_fetchalbums->setChecked(s.value("fetchalbums", false).toBool());
dialog()->ComboBoxLoadFromSettings(s, ui_->coversize, "coversize", "320x320"); dialog()->ComboBoxLoadFromSettings(s, ui_->coversize, "coversize", "320x320");
dialog()->ComboBoxLoadFromSettings(s, ui_->streamurl, "streamurl", "http");
s.endGroup(); s.endGroup();
if (service_->authenticated()) ui_->login_state->SetLoggedIn(LoginStateWidget::LoggedIn); if (service_->authenticated()) ui_->login_state->SetLoggedIn(LoginStateWidget::LoggedIn);
@ -110,7 +106,6 @@ void TidalSettingsPage::Save() {
s.setValue("songssearchlimit", ui_->songssearchlimit->value()); s.setValue("songssearchlimit", ui_->songssearchlimit->value());
s.setValue("fetchalbums", ui_->checkbox_fetchalbums->isChecked()); s.setValue("fetchalbums", ui_->checkbox_fetchalbums->isChecked());
s.setValue("coversize", ui_->coversize->itemData(ui_->coversize->currentIndex())); s.setValue("coversize", ui_->coversize->itemData(ui_->coversize->currentIndex()));
s.setValue("streamurl", ui_->streamurl->itemData(ui_->streamurl->currentIndex()));
s.endGroup(); s.endGroup();
service_->ReloadSettings(); service_->ReloadSettings();

View File

@ -385,39 +385,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="layout_streamurl">
<item>
<widget class="QLabel" name="label_streamurl">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Stream URL scheme</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="streamurl"/>
</item>
<item>
<spacer name="spacer_streamurl">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -127,7 +127,6 @@ void TidalService::ReloadSettings() {
songssearchlimit_ = s.value("songssearchlimit", 100).toInt(); songssearchlimit_ = s.value("songssearchlimit", 100).toInt();
fetchalbums_ = s.value("fetchalbums", false).toBool(); fetchalbums_ = s.value("fetchalbums", false).toBool();
coversize_ = s.value("coversize", "320x320").toString(); coversize_ = s.value("coversize", "320x320").toString();
streamurl_ = s.value("streamurl", "default").toString();
s.endGroup(); s.endGroup();
} }
@ -140,7 +139,6 @@ void TidalService::LoadSessionID() {
session_id_ = s.value("session_id").toString(); session_id_ = s.value("session_id").toString();
user_id_ = s.value("user_id").toInt(); user_id_ = s.value("user_id").toInt();
country_code_ = s.value("country_code").toString(); country_code_ = s.value("country_code").toString();
clientuniquekey_ = Utilities::GetRandomStringWithChars(12).toLower();
s.endGroup(); s.endGroup();
} }
@ -257,7 +255,6 @@ void TidalService::HandleAuthReply(QNetworkReply *reply) {
country_code_ = json_obj["countryCode"].toString(); country_code_ = json_obj["countryCode"].toString();
session_id_ = json_obj["sessionId"].toString(); session_id_ = json_obj["sessionId"].toString();
user_id_ = json_obj["userId"].toInt(); user_id_ = json_obj["userId"].toInt();
clientuniquekey_ = Utilities::GetRandomStringWithChars(12).toLower();
QSettings s; QSettings s;
s.beginGroup(TidalSettingsPage::kSettingsGroup); s.beginGroup(TidalSettingsPage::kSettingsGroup);
@ -1039,8 +1036,6 @@ void TidalService::StreamURLReceived(QNetworkReply *reply, const int song_id, co
filetype = Song::FileType_Stream; filetype = Song::FileType_Stream;
} }
if (new_url.scheme() != streamurl_ && streamurl_.toLower() != "default") new_url.setScheme(streamurl_);
emit StreamURLFinished(original_url, new_url, filetype); emit StreamURLFinished(original_url, new_url, filetype);
} }

View File

@ -139,11 +139,9 @@ class TidalService : public InternetService {
int songssearchlimit_; int songssearchlimit_;
bool fetchalbums_; bool fetchalbums_;
QString coversize_; QString coversize_;
QString streamurl_;
QString session_id_; QString session_id_;
quint64 user_id_; quint64 user_id_;
QString country_code_; QString country_code_;
QString clientuniquekey_;
int pending_search_id_; int pending_search_id_;
int next_pending_search_id_; int next_pending_search_id_;