Add the concept of a FeedItem that is "in progress"
A FeedItem should be considered "in progress" when the user started listening or watching the media, but did not complete it yet.
This commit is contained in:
parent
56a06f98eb
commit
27fe652551
@ -82,6 +82,21 @@ public class Feed extends FeedFile {
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of FeedItems where the media started to play but
|
||||
* wasn't finished yet.
|
||||
* */
|
||||
public int getNumOfStartedItems() {
|
||||
int count = 0;
|
||||
|
||||
for (FeedItem item : items) {
|
||||
if (item.isInProgress()) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if at least one item in the itemlist is unread.If the
|
||||
* 'display only episodes' - preference is set to true, this method will
|
||||
|
@ -128,6 +128,10 @@ public class FeedItem extends FeedComponent {
|
||||
return read;
|
||||
}
|
||||
|
||||
public boolean isInProgress() {
|
||||
return (media != null && media.isInProgress());
|
||||
}
|
||||
|
||||
public String getContentEncoded() {
|
||||
return contentEncoded;
|
||||
}
|
||||
|
@ -118,4 +118,8 @@ public class FeedMedia extends FeedFile {
|
||||
this.playbackCompletionDate = playbackCompletionDate;
|
||||
}
|
||||
|
||||
public boolean isInProgress() {
|
||||
return (this.position > 0 && this.playbackCompletionDate == null);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user