diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/asynctasks/InsertSubscribedThings.java b/app/src/main/java/eu/toldi/infinityforlemmy/asynctasks/InsertSubscribedThings.java index 844e60f3..98553250 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/asynctasks/InsertSubscribedThings.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/asynctasks/InsertSubscribedThings.java @@ -49,7 +49,7 @@ public class InsertSubscribedThings { for (SubscribedSubredditData s : subscribedSubredditDataList) { if (existingSubscribedSubredditDataList.contains(s)) { - subscribedSubredditDao.updateSubscribedSubreddit(s.getQualified_name(), s.getName(), s.getIconUrl()); + subscribedSubredditDao.updateSubscribedSubreddit(s.getQualified_name(), s.getName(), s.getIconUrl(), accountName); continue; } subscribedSubredditDao.insert(s); diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/subscribedsubreddit/SubscribedSubredditDao.java b/app/src/main/java/eu/toldi/infinityforlemmy/subscribedsubreddit/SubscribedSubredditDao.java index f9f6d266..36954d59 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/subscribedsubreddit/SubscribedSubredditDao.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/subscribedsubreddit/SubscribedSubredditDao.java @@ -37,6 +37,6 @@ public interface SubscribedSubredditDao { @Query("SELECT * from subscribed_subreddits WHERE username = :qualified_name AND name LIKE '%' || :searchQuery || '%' COLLATE NOCASE AND is_favorite = 1 ORDER BY name COLLATE NOCASE ASC") LiveData> getAllFavoriteSubscribedSubredditsWithSearchQuery(String qualified_name, String searchQuery); - @Query("UPDATE subscribed_subreddits SET name = :displayName, icon = :icon WHERE qualified_name = :qualified_name") - void updateSubscribedSubreddit(String qualified_name, String displayName, String icon); + @Query("UPDATE subscribed_subreddits SET name = :displayName, icon = :icon WHERE qualified_name = :qualified_name AND username = :accountName COLLATE NOCASE") + void updateSubscribedSubreddit(String qualified_name, String displayName, String icon, String accountName); }