Count non favorite answers only

This commit is contained in:
M66B
2021-05-03 07:42:57 +02:00
parent a5854d06f3
commit 31389e4808
2 changed files with 5 additions and 4 deletions

View File

@@ -56,8 +56,9 @@ public interface DaoAnswer {
LiveData<List<EntityAnswer>> liveAnswers();
@Query("SELECT COUNT(*) FROM answer" +
" WHERE NOT hide")
Integer getAnswerCount();
" WHERE NOT hide" +
" AND (:favorite OR NOT favorite)")
Integer getAnswerCount(boolean favorite);
@Insert
long insertAnswer(EntityAnswer answer);