Validate configuration better

This commit is contained in:
Jonas Kvinge
2019-06-20 20:49:02 +02:00
parent 8b6fd3d594
commit e1de110dd7
19 changed files with 192 additions and 76 deletions

View File

@@ -319,6 +319,16 @@ void SubsonicService::ResetSongsRequest() {
void SubsonicService::GetSongs() {
if (!server_url().isValid()) {
emit SongsResults(SongList(), tr("Server URL is invalid."));
return;
}
if (username().isEmpty() || password().isEmpty()) {
emit SongsResults(SongList(), tr("Missing username or password."));
return;
}
ResetSongsRequest();
songs_request_.reset(new SubsonicRequest(this, url_handler_, network_, this));
connect(songs_request_.get(), SIGNAL(Results(const SongList&, const QString&)), SLOT(SongsResultsReceived(const SongList&, const QString&)));