Add support for INFINITE_ and MORE_THAN_100_ITEMS in playlists
This commit is contained in:
parent
e51314b104
commit
2710d9de5b
3 changed files with 13 additions and 3 deletions
|
|
@ -27,6 +27,7 @@ import org.schabi.newpipe.extractor.InfoItem;
|
|||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistInfo;
|
||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||
import org.schabi.newpipe.extractor.stream.StreamType;
|
||||
|
|
@ -302,8 +303,15 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
|
|||
|
||||
IMAGE_LOADER.displayImage(result.getUploaderAvatarUrl(), headerUploaderAvatar,
|
||||
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
|
||||
headerStreamCount.setText(getResources().getQuantityString(R.plurals.videos,
|
||||
(int) result.getStreamCount(), (int) result.getStreamCount()));
|
||||
|
||||
int streamCount = (int) result.getStreamCount();
|
||||
if (streamCount == PlaylistExtractor.MORE_THAN_100_ITEMS) {
|
||||
headerStreamCount.setText(getResources().getString(R.string.playlist_more_than_100_items));
|
||||
} else if (streamCount == PlaylistExtractor.INFINITE_ITEMS) {
|
||||
headerStreamCount.setText(getResources().getString(R.string.playlist_infinite_items));
|
||||
} else {
|
||||
headerStreamCount.setText(getResources().getQuantityString(R.plurals.videos, streamCount, streamCount));
|
||||
}
|
||||
|
||||
if (!result.getErrors().isEmpty()) {
|
||||
showSnackBarError(result.getErrors(), UserAction.REQUESTED_PLAYLIST,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue