Merge branch 'master' into develop

This commit is contained in:
Shinokuni 2020-04-13 19:01:16 +02:00
commit ade8567258
4 changed files with 24 additions and 4 deletions

View File

@ -1,3 +1,9 @@
# v1.1.4
- Fix app crash when using an account url without http scheme #55
- Fix FreshRSS folder name parsing #61
- Fix feeds being deleted when adding a new feed with a NC News account #59
# v1.1.3
- Fix crash for API < 24 #51

View File

@ -83,6 +83,9 @@ public class AddAccountActivity extends AppCompatActivity {
String login = binding.addAccountLogin.getText().toString().trim();
String password = binding.addAccountPassword.getText().toString().trim();
if (!(url.toLowerCase().contains(Utils.HTTP_PREFIX) || url.toLowerCase().contains(Utils.HTTPS_PREFIX))) {
url = Utils.HTTPS_PREFIX + url;
}
if (editAccount) {
accountToEdit.setUrl(url);

View File

@ -108,7 +108,7 @@ public class NextNewsRepository extends ARepository<NextNewsAPI> {
insertFolders(syncResult.getFolders());
timings.addSplit("insert folders");
insertFeeds(syncResult.getFeeds());
insertFeeds(syncResult.getFeeds(), false);
timings.addSplit("insert feeds");
insertItems(syncResult.getItems(), syncType == SyncType.INITIAL_SYNC);
@ -144,7 +144,7 @@ public class NextNewsRepository extends ARepository<NextNewsAPI> {
List<Feed> nextNewsFeeds = api.createFeed(result.getUrl(), 0);
if (nextNewsFeeds != null) {
List<Feed> newFeeds = insertFeeds(nextNewsFeeds);
List<Feed> newFeeds = insertFeeds(nextNewsFeeds, true);
// there is always only one object in the list, see nextcloud news api doc
insertionResult.setFeed(newFeeds.get(0));
} else
@ -259,12 +259,17 @@ public class NextNewsRepository extends ARepository<NextNewsAPI> {
}).andThen(super.deleteFolder(folder));
}
private List<Feed> insertFeeds(List<Feed> nextNewsFeeds) {
private List<Feed> insertFeeds(List<Feed> nextNewsFeeds, boolean newFeeds) {
for (Feed nextNewsFeed : nextNewsFeeds) {
nextNewsFeed.setAccountId(account.getId());
}
List<Long> insertedFeedsIds = database.feedDao().feedsUpsert(nextNewsFeeds, account);
List<Long> insertedFeedsIds;
if (newFeeds) {
insertedFeedsIds = database.feedDao().insert(nextNewsFeeds);
} else {
insertedFeedsIds = database.feedDao().feedsUpsert(nextNewsFeeds, account);
}
List<Feed> insertedFeeds = new ArrayList<>();
if (!insertedFeedsIds.isEmpty()) {

View File

@ -0,0 +1,6 @@
<ul>
<li>Fix app crash when using an account url without http scheme</li>
<li>Fix FreshRSS folder name parsing</li>
<li>Fix feeds being deleted when adding a new feed with a NC News account</li>
</ul>