more improvements of comments

Co-Authored-By: Stypox <stypox@pm.me>
This commit is contained in:
Tobias Groza 2020-02-16 23:59:31 +01:00 committed by GitHub
parent 0a4115286b
commit a129c65c63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 7 deletions

View File

@ -263,7 +263,7 @@ public abstract class StreamingService {
public CommentsExtractor getCommentsExtractor(String url) throws ExtractionException {
ListLinkHandlerFactory llhf = getCommentsLHFactory();
if (null == llhf) {
if (llhf == null) {
return null;
}
return getCommentsExtractor(llhf.fromUrl(url));

View File

@ -43,7 +43,7 @@ public class PeertubeInstance {
throw new Exception("unable to configure instance " + url, e);
}
if (null == response || StringUtil.isBlank(response.responseBody())) {
if (response == null || StringUtil.isBlank(response.responseBody())) {
throw new Exception("unable to configure instance " + url);
}

View File

@ -171,7 +171,7 @@ public class PeertubeChannelExtractor extends ChannelExtractor {
} catch (JsonParserException e) {
throw new ExtractionException("Unable to extract peertube channel data", e);
}
if (null == json) throw new ExtractionException("Unable to extract PeerTube channel data");
if (json == null) throw new ExtractionException("Unable to extract PeerTube channel data");
}
@Override

View File

@ -133,7 +133,7 @@ public class YoutubeCommentsExtractor extends CommentsExtractor {
}
private void fetchTitle(JsonArray contents) {
if (null == title) {
if (title == null) {
try {
title = getYoutubeText(JsonUtils.getObject(contents.getObject(0), "commentThreadRenderer.commentTargetTitle"));
} catch (Exception e) {

View File

@ -68,7 +68,7 @@ public class YoutubePlaylistExtractor extends PlaylistExtractor {
@Override
public String getBannerUrl() {
return ""; // Banner can't be handled by frontend right now.
// Whoever is willing to implement this should also implement this in the front end.
// Whoever is willing to implement this should also implement it in the frontend.
}
@Override

View File

@ -335,10 +335,10 @@ public abstract class StreamExtractor extends Extractor {
try {
timeStamp = Parser.matchGroup1(regexPattern, getOriginalUrl());
} catch (Parser.RegexException e) {
// catch this instantly since an url does not necessarily have to have a time stamp
// catch this instantly since a url does not necessarily have a timestamp
// -2 because the testing system will consequently know that the regex failed
// not good i know
// not good, I know
return -2;
}