Fixed library showing null

This commit is contained in:
Peter Hindes 2019-10-16 19:56:31 -06:00
parent ad2de3a828
commit 87378fc79c
2 changed files with 5 additions and 7 deletions

View file

@ -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() {

View file

@ -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);