Skip to content

Commit 70c2734

Browse files
committed
Fix checkstyle violations in live chat and bullet comments code
1 parent fc533e4 commit 70c2734

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/bulletComments/BulletCommentsExtractor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void disconnect() {
4949
public void reconnect() {
5050

5151
}
52-
52+
5353
public void setCurrentPlayPosition(final long currentPlayPosition) {
5454
}
5555

extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsExtractor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public boolean isCommentsDisabled() throws ExtractionException {
2424

2525
/**
2626
* @apiNote Warning: This method is experimental and may get removed in a future release.
27-
* @return <code>true</code> if the comments source is a live chat otherwise <code>false</code> (default)
27+
* @return <code>true</code> if the comments source is a live chat
28+
* otherwise <code>false</code> (default)
2829
*/
2930
public boolean isLiveChat() throws ExtractionException {
3031
return false;

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeCommentsExtractor.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,10 @@ private void findLiveChatContinuation(final JsonObject nextResponse) {
422422
private InfoItemsPage<CommentsInfoItem> fetchLiveChat(final String chatContinuation)
423423
throws IOException, ExtractionException {
424424
isLiveStream = true;
425-
ExtractorLogger.d(TAG, "fetchLiveChat() called with continuation={}",
426-
chatContinuation != null ? chatContinuation.substring(0, Math.min(30, chatContinuation.length())) : "null");
425+
final String contPreview = chatContinuation != null
426+
? chatContinuation.substring(0, Math.min(30, chatContinuation.length()))
427+
: "null";
428+
ExtractorLogger.d(TAG, "fetchLiveChat() called with continuation={}", contPreview);
427429
final Localization localization = getExtractorLocalization();
428430
final byte[] json = JsonWriter.string(
429431
prepareDesktopJsonBuilder(localization, getExtractorContentCountry())
@@ -434,8 +436,10 @@ private InfoItemsPage<CommentsInfoItem> fetchLiveChat(final String chatContinuat
434436
.done())
435437
.getBytes(StandardCharsets.UTF_8);
436438

437-
final String endpoint = "live_chat/" + (isLiveStream ? "get_live_chat" : "get_live_chat_replay");
438-
ExtractorLogger.d(TAG, "fetchLiveChat() using endpoint={} isLiveStream={}", endpoint, isLiveStream);
439+
final String endpoint = "live_chat/"
440+
+ (isLiveStream ? "get_live_chat" : "get_live_chat_replay");
441+
ExtractorLogger.d(TAG, "fetchLiveChat() endpoint={} isLiveStream={}",
442+
endpoint, isLiveStream);
439443
final JsonObject result = getJsonPostResponse(endpoint, json, localization);
440444

441445
return extractLiveChatComments(result);

0 commit comments

Comments
 (0)