Skip import of existing accounts

This commit is contained in:
M66B
2021-07-29 19:24:03 +02:00
parent 9fbb996e69
commit e6428cb530
2 changed files with 7 additions and 0 deletions

View File

@@ -879,6 +879,10 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
JSONObject jaccount = (JSONObject) jaccounts.get(a);
EntityAccount account = EntityAccount.fromJSON(jaccount);
EntityAccount existing = db.account().getAccountByUUID(account.uuid);
if (existing != null)
continue;
if (account.auth_type == AUTH_TYPE_GMAIL) {
if (GmailState.getAccount(context, account.user) == null) {
Log.i("Google account not found user=" + account.user);

View File

@@ -90,6 +90,9 @@ public interface DaoAccount {
@Query("SELECT * FROM account WHERE id = :id")
EntityAccount getAccount(long id);
@Query("SELECT * FROM account WHERE uuid = :uuid")
EntityAccount getAccountByUUID(String uuid);
@Query("SELECT * FROM account WHERE name = :name")
EntityAccount getAccount(String name);