diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 28dca0e53..9f93662de 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -25,11 +25,11 @@
android:summary="@string/pref_nav_drawer_feed_order_sum"
android:defaultValue="0"/>
comparator;
int feedOrder = UserPreferences.getFeedOrder();
- if(feedOrder == UserPreferences.ORDER_UNPLAYED_EPISODES) {
+ if(feedOrder == UserPreferences.FEED_ORDER_UNPLAYED_EPISODES) {
comparator = new Comparator() {
@Override
public int compare(Feed lhs, Feed rhs) {
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java
index d0da0b194..216d1bde2 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java
@@ -360,6 +360,10 @@ public class DBWriter {
queue.add(index, item);
adapter.setQueue(queue);
EventBus.getDefault().post(new QueueEvent(QueueEvent.Action.ADDED, item, index));
+ if(item.isNew()) {
+ adapter.setFeedItemRead(FeedItem.UNPLAYED, item.getId());
+ EventDistributor.getInstance().sendUnreadItemsUpdateBroadcast();
+ }
}
}
}
@@ -379,7 +383,6 @@ public class DBWriter {
return addQueueItem(context, false, itemIds);
}
-
/**
* Appends FeedItem objects to the end of the queue. The 'read'-attribute of all items will be set to true.
* If a FeedItem is already in the queue, the FeedItem will not change its position in the queue.
@@ -397,11 +400,11 @@ public class DBWriter {
if (itemIds.length > 0) {
final PodDBAdapter adapter = new PodDBAdapter(context);
adapter.open();
- final List queue = DBReader.getQueue(context,
- adapter);
+ final List queue = DBReader.getQueue(context, adapter);
if (queue != null) {
boolean queueModified = false;
+ LongList markAsUnplayedIds = new LongList();
for (int i = 0; i < itemIds.length; i++) {
if (!itemListContains(queue, itemIds[i])) {
final FeedItem item = DBReader.getFeedItem(context, itemIds[i]);
@@ -415,12 +418,20 @@ public class DBWriter {
queue.add(item);
}
queueModified = true;
+ if(item.isNew()) {
+ markAsUnplayedIds.add(item.getId());
+ }
}
}
}
if (queueModified) {
adapter.setQueue(queue);
EventBus.getDefault().post(new QueueEvent(QueueEvent.Action.ADDED_ITEMS, queue));
+ Log.d(TAG, "# mark as unplayed: " + markAsUnplayedIds.size());
+ if(markAsUnplayedIds.size() > 0) {
+ adapter.setFeedItemRead(FeedItem.UNPLAYED, markAsUnplayedIds.toArray());
+ EventDistributor.getInstance().sendUnreadItemsUpdateBroadcast();
+ }
}
}
adapter.close();
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java
index c3466c621..91a8e2ed0 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java
@@ -1295,14 +1295,14 @@ public class PodDBAdapter {
}
public final LongIntMap getFeedCounters(long... feedIds) {
- int indicator = UserPreferences.getFeedIndicator();
+ int counter = UserPreferences.getFeedCounter();
String whereRead;
- if(indicator == UserPreferences.SHOW_NEW_UNPLAYED_SUM) {
+ if(counter == UserPreferences.FEED_COUNTER_SHOW_NEW_UNPLAYED_SUM) {
whereRead = "(" + KEY_READ + "=" + FeedItem.NEW
+ " OR " + KEY_READ + "=" + FeedItem.UNPLAYED + ")";
- } else if(indicator == UserPreferences.SHOW_NEW) {
+ } else if(counter == UserPreferences.FEED_COUNTER_SHOW_NEW) {
whereRead = KEY_READ + "=" + FeedItem.NEW;
- } else if(indicator == UserPreferences.SHOW_UNPLAYED) {
+ } else if(counter == UserPreferences.FEED_COUNTER_SHOW_UNPLAYED) {
whereRead = KEY_READ + "=" + FeedItem.UNPLAYED;
} else {
return new LongIntMap(0);
diff --git a/core/src/main/res/values/arrays.xml b/core/src/main/res/values/arrays.xml
index 82596e970..5fe5f24e8 100644
--- a/core/src/main/res/values/arrays.xml
+++ b/core/src/main/res/values/arrays.xml
@@ -135,13 +135,13 @@
- 1
-
- - @string/drawer_feed_indicator_new_unplayed
- - @string/drawer_feed_indicator_new
- - @string/drawer_feed_indicator_unplayed
- - @string/drawer_feed_indicator_none
+
+ - @string/drawer_feed_counter_new_unplayed
+ - @string/drawer_feed_counter_new
+ - @string/drawer_feed_counter_unplayed
+ - @string/drawer_feed_counter_none
-
+
- 0
- 1
- 2
diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml
index 9cebfa26e..d2c0844aa 100644
--- a/core/src/main/res/values/strings.xml
+++ b/core/src/main/res/values/strings.xml
@@ -35,10 +35,10 @@
Drawer Preferences
Sort by counter
Sort alphabetically
- Number of new and unplayed episodes
- Number of new episodes
- Number of unplayed episodes
- None
+ Number of new and unplayed episodes
+ Number of new episodes
+ Number of unplayed episodes
+ None
Open in Browser
@@ -292,8 +292,8 @@
Change which items appear in the navigation drawer.
Set Subscription Order
Change the order of your subscriptions
- Set Subscription Counter
- Change the information displayed by the subscription counter
+ Set Subscription Counter
+ Change the information displayed by the subscription counter
Change the appearance of AntennaPod.
Automatic Download
Configure the automatic download of episodes.