empty support returns "", same for empty description
This commit is contained in:
parent
74439f692a
commit
20da4750f8
|
@ -76,7 +76,7 @@ public class PeertubeStreamExtractor extends StreamExtractor {
|
|||
try {
|
||||
desc = JsonUtils.getString(json, "description");
|
||||
} catch (ParsingException e) {
|
||||
return "No description";
|
||||
return "";
|
||||
}
|
||||
if (desc.length() == 250 && desc.substring(247).equals("...")) {
|
||||
//if description is shortened, get full description
|
||||
|
@ -256,7 +256,11 @@ public class PeertubeStreamExtractor extends StreamExtractor {
|
|||
@Nonnull
|
||||
@Override
|
||||
public String getSupportInfo() throws ParsingException {
|
||||
return JsonUtils.getString(json, "support");
|
||||
try {
|
||||
return JsonUtils.getString(json, "support");
|
||||
} catch (ParsingException e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private String getRelatedStreamsUrl(List<String> tags) throws UnsupportedEncodingException {
|
||||
|
|
|
@ -61,7 +61,7 @@ public class PeertubeStreamExtractorDefaultTest {
|
|||
public void testGetEmptyDescription() throws Exception {
|
||||
PeertubeStreamExtractor extractorEmpty = (PeertubeStreamExtractor) PeerTube.getStreamExtractor("https://framatube.org/api/v1/videos/d5907aad-2252-4207-89ec-a4b687b9337d");
|
||||
extractorEmpty.fetchPage();
|
||||
assertEquals("No description", extractorEmpty.getDescription());
|
||||
assertEquals("", extractorEmpty.getDescription());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue