Favorite folders per account

This commit is contained in:
M66B 2021-04-19 15:07:01 +02:00
parent efc76a1c63
commit d029728c96
2 changed files with 4 additions and 3 deletions

View File

@ -199,11 +199,12 @@ public interface DaoFolder {
LiveData<List<TupleFolderUnified>> liveUnified();
@Query("SELECT * FROM folder" +
" WHERE selected_count > 0" +
" WHERE account = :account" +
" AND selected_count > 0" +
" AND NOT folder.id IN (:disabled)" +
" ORDER BY selected_count DESC, selected_last DESC" +
" LIMIT :count")
List<EntityFolder> getFavoriteFolders(int count, long[] disabled);
List<EntityFolder> getFavoriteFolders(long account, int count, long[] disabled);
@Query("UPDATE folder" +
" SET selected_last = :last, selected_count = selected_count + 1" +

View File

@ -283,7 +283,7 @@ public class FragmentDialogFolder extends FragmentDialogBase {
Data data = new Data();
data.folders = db.folder().getFoldersEx(account);
data.favorites = db.folder().getFavoriteFolders(3, disabled);
data.favorites = db.folder().getFavoriteFolders(account, 3, disabled);
return data;
}