mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2026-04-18 04:41:24 +00:00
Add support for INFINITE_ and MORE_THAN_100_ITEMS in playlists
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user