diff --git a/app/src/main/java/org/schabi/newpipe/database/playlist/PlaylistStreamEntry.kt b/app/src/main/java/org/schabi/newpipe/database/playlist/PlaylistStreamEntry.kt index d2543ae6d..37e3114ef 100644 --- a/app/src/main/java/org/schabi/newpipe/database/playlist/PlaylistStreamEntry.kt +++ b/app/src/main/java/org/schabi/newpipe/database/playlist/PlaylistStreamEntry.kt @@ -29,6 +29,7 @@ data class PlaylistStreamEntry( item.uploaderName = streamEntity.uploader item.uploaderUrl = streamEntity.uploaderUrl item.thumbnailUrl = streamEntity.thumbnailUrl + item.setRequiresMembership(streamEntity.isPaid) return item } diff --git a/app/src/main/java/org/schabi/newpipe/local/holder/LocalPlaylistStreamItemHolder.java b/app/src/main/java/org/schabi/newpipe/local/holder/LocalPlaylistStreamItemHolder.java index e681f6fe4..143036ccd 100644 --- a/app/src/main/java/org/schabi/newpipe/local/holder/LocalPlaylistStreamItemHolder.java +++ b/app/src/main/java/org/schabi/newpipe/local/holder/LocalPlaylistStreamItemHolder.java @@ -66,7 +66,13 @@ public void updateFromItem(final LocalItem localItem, .concatenateStrings(item.getStreamEntity().getUploader(), NewPipe.getNameOfService(item.getStreamEntity().getServiceId()))); - if (item.getStreamEntity().getDuration() > 0) { + if (item.getStreamEntity().isPaid()) { + itemDurationView.setText(R.string.paid_video); + itemDurationView.setBackgroundColor(ContextCompat.getColor(itemBuilder.getContext(), + R.color.paid_video_background_color)); + itemDurationView.setVisibility(View.VISIBLE); + itemProgressView.setVisibility(View.GONE); + } else if (item.getStreamEntity().getDuration() > 0) { itemDurationView.setText(Localization .getDurationString(item.getStreamEntity().getDuration())); itemDurationView.setBackgroundColor(ContextCompat.getColor(itemBuilder.getContext(), @@ -114,7 +120,9 @@ public void updateState(final LocalItem localItem, } final PlaylistStreamEntry item = (PlaylistStreamEntry) localItem; - if (item.getProgressMillis() > 0 && item.getStreamEntity().getDuration() > 0) { + if (!item.getStreamEntity().isPaid() + && item.getProgressMillis() > 0 + && item.getStreamEntity().getDuration() > 0) { itemProgressView.setMax((int) item.getStreamEntity().getDuration()); if (itemProgressView.getVisibility() == View.VISIBLE) { itemProgressView.setProgressAnimated((int) TimeUnit.MILLISECONDS