Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.schabi.newpipe.extractor.utils.Utils;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;

import static org.schabi.newpipe.extractor.services.peertube.PeertubeParsingHelper.COUNT_KEY;
Expand Down Expand Up @@ -90,13 +91,10 @@ public long getSubscriberCount() throws ParsingException {
return subscribersCount;
}

@Nullable
@Override
public String getDescription() {
try {
return JsonUtils.getString(json, "description");
} catch (final ParsingException e) {
return "No description";
}
return json.getString("description");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.schabi.newpipe.extractor.utils.Utils;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.IOException;

import static org.schabi.newpipe.extractor.services.peertube.PeertubeParsingHelper.COUNT_KEY;
Expand Down Expand Up @@ -63,13 +64,10 @@ public long getSubscriberCount() {
return json.getLong("followersCount");
}

@Nullable
@Override
public String getDescription() {
try {
return JsonUtils.getString(json, "description");
} catch (final ParsingException e) {
return "No description";
}
return json.getString("description");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
import org.schabi.newpipe.extractor.services.BaseChannelExtractorTest;
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeAccountExtractor;

import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
import static org.schabi.newpipe.extractor.services.DefaultTests.*;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestGetPageInNewExtractor;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestMoreItems;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestRelatedItems;

/**
* Test for {@link PeertubeAccountExtractor}
Expand Down Expand Up @@ -82,7 +87,7 @@ public void testMoreRelatedItems() throws Exception {

@Test
public void testDescription() throws ParsingException {
assertNotNull(extractor.getDescription());
assertNull(extractor.getDescription());
}

@Test
Expand Down