summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/storage/PodDBAdapter.java
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2013-09-23 10:37:43 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2013-09-23 10:37:43 +0200
commite38746f906f9ddfb7600b2113f8934bc4117e6ec (patch)
tree6b4933ad10cbede02c02ce203fce9ad8806e33e5 /src/de/danoeh/antennapod/storage/PodDBAdapter.java
parentaa3675bc838727f4e2b8bddbafa5972370f19cda (diff)
downloadAntennaPod-e38746f906f9ddfb7600b2113f8934bc4117e6ec.zip
Statistics for Feeds with no items are now loaded correctly. fixes #283
Diffstat (limited to 'src/de/danoeh/antennapod/storage/PodDBAdapter.java')
-rw-r--r--src/de/danoeh/antennapod/storage/PodDBAdapter.java5
1 files changed, 3 insertions, 2 deletions
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);