Experiment: quick switch unified folders

This commit is contained in:
M66B
2023-10-22 15:30:34 +02:00
parent 5cdec1c39f
commit 7f71b21c2c
3 changed files with 88 additions and 2 deletions

View File

@@ -100,7 +100,7 @@ public interface DaoFolder {
" GROUP BY folder.id")
LiveData<List<TupleFolderEx>> liveFolders(Long account, boolean primary);
@Query("SELECT folder.*" +
final String queryUnified = "SELECT folder.*" +
", account.id AS accountId, account.pop AS accountProtocol, account.`order` AS accountOrder" +
", account.name AS accountName, account.category AS accountCategory, account.color AS accountColor" +
", account.state AS accountState, account.error AS accountError" +
@@ -117,9 +117,14 @@ public interface DaoFolder {
" LEFT JOIN operation ON operation.folder = folder.id" +
" WHERE account.`synchronize`" +
" AND ((:type IS NULL AND folder.unified) OR folder.type = :type)" +
" GROUP BY folder.id")
" GROUP BY folder.id";
@Query(queryUnified)
LiveData<List<TupleFolderEx>> liveUnified(String type);
@Query(queryUnified)
List<TupleFolderEx> getUnified(String type);
@Query("SELECT folder.account, folder.id AS folder, unified, sync_state" +
" FROM folder" +
" JOIN account ON account.id = folder.account" +