diff --git a/app/src/main/java/com/readrops/app/database/dao/FeedDao.java b/app/src/main/java/com/readrops/app/database/dao/FeedDao.java index 34eabff9..c52ad1ab 100644 --- a/app/src/main/java/com/readrops/app/database/dao/FeedDao.java +++ b/app/src/main/java/com/readrops/app/database/dao/FeedDao.java @@ -30,8 +30,8 @@ public abstract class FeedDao implements BaseDao { @Query("Select count(*) from Feed Where account_id = :accountId") public abstract Single getFeedCount(int accountId); - @Query("Select * from Feed Where url = :feedUrl") - public abstract Feed getFeedByUrl(String feedUrl); + @Query("Select * from Feed Where url = :feedUrl And account_id = :accountId") + public abstract Feed getFeedByUrl(String feedUrl, int accountId); @Query("Select id from Feed Where remoteId = :remoteId And account_id = :accountId") public abstract int getFeedIdByRemoteId(String remoteId, int accountId); diff --git a/app/src/main/java/com/readrops/app/repositories/LocalFeedRepository.java b/app/src/main/java/com/readrops/app/repositories/LocalFeedRepository.java index db702233..0018c9f1 100644 --- a/app/src/main/java/com/readrops/app/repositories/LocalFeedRepository.java +++ b/app/src/main/java/com/readrops/app/repositories/LocalFeedRepository.java @@ -151,15 +151,15 @@ public class LocalFeedRepository extends ARepository { switch (type) { case RSS_2: - dbFeed = database.feedDao().getFeedByUrl(((RSSFeed) feed).getChannel().getFeedUrl()); + dbFeed = database.feedDao().getFeedByUrl(((RSSFeed) feed).getChannel().getFeedUrl(), account.getId()); items = ItemMatcher.itemsFromRSS(((RSSFeed) feed).getChannel().getItems(), dbFeed); break; case RSS_ATOM: - dbFeed = database.feedDao().getFeedByUrl(((ATOMFeed) feed).getUrl()); + dbFeed = database.feedDao().getFeedByUrl(((ATOMFeed) feed).getUrl(), account.getId()); items = ItemMatcher.itemsFromATOM(((ATOMFeed) feed).getEntries(), dbFeed); break; case RSS_JSON: - dbFeed = database.feedDao().getFeedByUrl(((JSONFeed) feed).getFeedUrl()); + dbFeed = database.feedDao().getFeedByUrl(((JSONFeed) feed).getFeedUrl(), account.getId()); items = ItemMatcher.itemsFromJSON(((JSONFeed) feed).getItems(), dbFeed); break; }