Apply username and password when subscribing (#6675)

This commit is contained in:
ByteHamster 2023-10-01 18:08:54 +02:00 committed by GitHub
parent 7cb0ba8156
commit 4dc1196c39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -539,19 +539,24 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
viewBinding.subscribeButton.setText(R.string.open_podcast);
if (didPressSubscribe) {
didPressSubscribe = false;
Feed feed1 = DBReader.getFeed(getFeedId());
FeedPreferences feedPreferences = feed1.getPreferences();
if (UserPreferences.isEnableAutodownload()) {
boolean autoDownload = viewBinding.autoDownloadCheckBox.isChecked();
Feed feed1 = DBReader.getFeed(getFeedId());
FeedPreferences feedPreferences = feed1.getPreferences();
feedPreferences.setAutoDownload(autoDownload);
DBWriter.setFeedPreferences(feedPreferences);
SharedPreferences preferences = getSharedPreferences(PREFS, MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean(PREF_LAST_AUTO_DOWNLOAD, autoDownload);
editor.apply();
}
if (username != null) {
feedPreferences.setUsername(username);
feedPreferences.setPassword(password);
}
DBWriter.setFeedPreferences(feedPreferences);
openFeed();
}
} else {