diff --git a/app/build.gradle b/app/build.gradle index b714faa84..981a5b4f1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -136,7 +136,7 @@ dependencies { exclude module: 'support-annotations' }) - implementation 'com.github.TeamNewPipe:NewPipeExtractor:a5155fb' + implementation 'com.github.XiangRongLin:NewPipeExtractor:6a23efa8d41a05f37b8f523aa08af7e0a9d6c4e1' testImplementation 'junit:junit:4.12' testImplementation 'org.mockito:mockito-core:2.23.0' diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java index e3eac27ca..7c21c073d 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java @@ -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 { 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, diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ea2202c58..d8641cc0f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -458,6 +458,8 @@ Playlist thumbnail changed. Could not delete playlist. Auto-generated (no uploader found) + 100+ videos + ∞ videos No Captions Fit