Favorite folders per account

pull/198/head
M66B 4 years ago
parent efc76a1c63
commit d029728c96

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

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

Loading…
Cancel
Save