From 87378fc79c0f89f06a4cb335389f3ce2dde6fb71 Mon Sep 17 00:00:00 2001 From: Peter Hindes Date: Wed, 16 Oct 2019 19:56:31 -0600 Subject: [PATCH] Fixed library showing null --- .../database/playlist/model/PlaylistRemoteEntity.java | 7 ------- .../newpipe/local/holder/RemotePlaylistItemHolder.java | 5 +++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistRemoteEntity.java b/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistRemoteEntity.java index 75515b33a..fa257cfed 100644 --- a/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistRemoteEntity.java +++ b/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistRemoteEntity.java @@ -1,7 +1,6 @@ package org.schabi.newpipe.database.playlist.model; import android.text.TextUtils; -import android.util.Log; import androidx.room.ColumnInfo; import androidx.room.Entity; @@ -9,7 +8,6 @@ import androidx.room.Ignore; import androidx.room.Index; import androidx.room.PrimaryKey; -import org.schabi.newpipe.BuildConfig; import org.schabi.newpipe.database.playlist.PlaylistLocalItem; import org.schabi.newpipe.extractor.playlist.PlaylistInfo; import org.schabi.newpipe.util.Constants; @@ -76,21 +74,16 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem { @Ignore public boolean isIdenticalTo(final PlaylistInfo info) { - //String TAG = "isIdenticalTo"; - //boolean DEBUG = !BuildConfig.BUILD_TYPE.equals("release"); /* * Returns boolean comparing the online playlist and the local copy. * (False if info changed such as playlist name or track count) */ - //boolean returnMe = true; return getServiceId() == info.getServiceId() && getStreamCount() == info.getStreamCount() && TextUtils.equals(getName(), info.getName()) && TextUtils.equals(getUrl(), info.getUrl()) && TextUtils.equals(getThumbnailUrl(), info.getThumbnailUrl()) && TextUtils.equals(getUploader(), info.getUploaderName()); - //if (DEBUG) Log.d(TAG, TAG+"() called with result: returnMe = "+returnMe); - //return returnMe; } public long getUid() { diff --git a/app/src/main/java/org/schabi/newpipe/local/holder/RemotePlaylistItemHolder.java b/app/src/main/java/org/schabi/newpipe/local/holder/RemotePlaylistItemHolder.java index f9542850e..b30a6230d 100644 --- a/app/src/main/java/org/schabi/newpipe/local/holder/RemotePlaylistItemHolder.java +++ b/app/src/main/java/org/schabi/newpipe/local/holder/RemotePlaylistItemHolder.java @@ -28,8 +28,13 @@ public class RemotePlaylistItemHolder extends PlaylistItemHolder { itemTitleView.setText(item.getName()); itemStreamCountView.setText(String.valueOf(item.getStreamCount())); + // Here is where the uploader name is set in the bookmarked playlists library itemUploaderView.setText(Localization.concatenateStrings(item.getUploader(), NewPipe.getNameOfService(item.getServiceId()))); + if (item.getUploader() == null) { + itemUploaderView.setText(NewPipe.getNameOfService(item.getServiceId())); + } + itemBuilder.displayImage(item.getThumbnailUrl(), itemThumbnailView, ImageDisplayConstants.DISPLAY_PLAYLIST_OPTIONS);