diff --git a/src/de/danoeh/antennapod/feed/FeedItem.java b/src/de/danoeh/antennapod/feed/FeedItem.java index fa5c49436..e886c73b3 100644 --- a/src/de/danoeh/antennapod/feed/FeedItem.java +++ b/src/de/danoeh/antennapod/feed/FeedItem.java @@ -35,7 +35,7 @@ public class FeedItem extends FeedComponent { private Date pubDate; private FeedMedia media; private Feed feed; - protected boolean read; + private boolean read; private String paymentLink; private List chapters; @@ -152,9 +152,6 @@ public class FeedItem extends FeedComponent { public void setRead(boolean read) { this.read = read; - if (media != null) { - media.setPosition(0); - } } private boolean isInProgress() { diff --git a/src/de/danoeh/antennapod/feed/FeedManager.java b/src/de/danoeh/antennapod/feed/FeedManager.java index 860922e7e..721bebeff 100644 --- a/src/de/danoeh/antennapod/feed/FeedManager.java +++ b/src/de/danoeh/antennapod/feed/FeedManager.java @@ -375,15 +375,17 @@ public class FeedManager { * instead of the setters of FeedItem. */ public void markItemRead(final Context context, final FeedItem item, - final boolean read) { + final boolean read, boolean resetMediaPosition) { if (AppConfig.DEBUG) Log.d(TAG, "Setting item with title " + item.getTitle() + " as read/unread"); item.setRead(read); - + if (item.hasMedia() && resetMediaPosition) { + item.getMedia().setPosition(0); + } setFeedItem(context, item); - if (item.hasMedia()) + if (item.hasMedia() && resetMediaPosition) setFeedMedia(context, item.getMedia()); contentChanger.post(new Runnable() { @@ -411,7 +413,7 @@ public class FeedManager { public void markFeedRead(Context context, Feed feed) { for (FeedItem item : feed.getItems()) { if (unreadItems.contains(item)) { - markItemRead(context, item, true); + markItemRead(context, item, true, false); } } } @@ -825,7 +827,7 @@ public class FeedManager { } }); - markItemRead(context, item, false); + markItemRead(context, item, false, false); } } // update attributes @@ -1168,9 +1170,9 @@ public class FeedManager { mediaIds.add(String.valueOf(mediaId)); item.setMedia(new FeedMedia(mediaId, item)); } - item.read = (itemlistCursor + item.setRead((itemlistCursor .getInt(PodDBAdapter.IDX_FI_SMALL_READ) > 0) ? true - : false; + : false); item.setItemIdentifier(itemlistCursor .getString(PodDBAdapter.IDX_FI_SMALL_ITEM_IDENTIFIER)); if (item.getState() == FeedItem.State.NEW) { diff --git a/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java b/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java index 82de9a204..2b7d5e2b0 100644 --- a/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java +++ b/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java @@ -88,10 +88,10 @@ public class FeedItemMenuHandler { requester.cancelDownload(context, selectedItem.getMedia()); break; case R.id.mark_read_item: - manager.markItemRead(context, selectedItem, true); + manager.markItemRead(context, selectedItem, true, true); break; case R.id.mark_unread_item: - manager.markItemRead(context, selectedItem, false); + manager.markItemRead(context, selectedItem, false, true); break; case R.id.add_to_queue_item: manager.addQueueItem(context, selectedItem);