From e38746f906f9ddfb7600b2113f8934bc4117e6ec Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Mon, 23 Sep 2013 10:37:43 +0200 Subject: Statistics for Feeds with no items are now loaded correctly. fixes #283 --- src/de/danoeh/antennapod/storage/PodDBAdapter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/de/danoeh/antennapod/storage/PodDBAdapter.java') diff --git a/src/de/danoeh/antennapod/storage/PodDBAdapter.java b/src/de/danoeh/antennapod/storage/PodDBAdapter.java index 6d41f6dfd..e22fe56c9 100644 --- a/src/de/danoeh/antennapod/storage/PodDBAdapter.java +++ b/src/de/danoeh/antennapod/storage/PodDBAdapter.java @@ -1017,14 +1017,15 @@ public class PodDBAdapter { * Select number of items, new items, the date of the latest episode and the number of episodes in progress. The result * is sorted by the title of the feed. */ - private static final String FEED_STATISTICS_QUERY = "SELECT feed, num_items, new_items, latest_episode, in_progress FROM " + + private static final String FEED_STATISTICS_QUERY = "SELECT Feeds.id, num_items, new_items, latest_episode, in_progress FROM " + + " Feeds LEFT JOIN " + "(SELECT feed,count(*) AS num_items," + " COUNT(CASE WHEN read=0 THEN 1 END) AS new_items," + " MAX(pubDate) AS latest_episode," + " COUNT(CASE WHEN position>0 THEN 1 END) AS in_progress," + " COUNT(CASE WHEN downloaded=1 THEN 1 END) AS episodes_downloaded " + " FROM FeedItems LEFT JOIN FeedMedia ON FeedItems.id=FeedMedia.feeditem GROUP BY FeedItems.feed)" + - " INNER JOIN Feeds ON Feeds.id = feed ORDER BY Feeds.title;"; + " ON Feeds.id = feed ORDER BY Feeds.title;"; public Cursor getFeedStatisticsCursor() { return db.rawQuery(FEED_STATISTICS_QUERY, null); -- cgit v1.2.3