rename getHeartedByCreator and getPinned to isPinned and isHeartedByCreator

This commit is contained in:
bopol 2021-01-23 13:06:07 +01:00
parent 10e8c543e8
commit 2662ceca22
7 changed files with 14 additions and 14 deletions

View File

@ -92,11 +92,11 @@ public class CommentsInfoItem extends InfoItem {
this.heartedByUploader = isHeartedByUploader;
}
public boolean getHeartedByUploader() {
public boolean isHeartedByUploader() {
return this.heartedByUploader;
}
public boolean getPinned() {
public boolean isPinned() {
return pinned;
}

View File

@ -47,10 +47,10 @@ public interface CommentsInfoItemExtractor extends InfoItemExtractor {
/**
* Whether the comment has been hearted by the uploader
*/
boolean getHeartedByUploader() throws ParsingException;
boolean isHeartedByUploader() throws ParsingException;
/**
* Whether the comment is pinned
*/
boolean getPinned() throws ParsingException;
boolean isPinned() throws ParsingException;
}

View File

@ -71,13 +71,13 @@ public class CommentsInfoItemsCollector extends InfoItemsCollector<CommentsInfoI
}
try {
resultItem.setHeartedByUploader(extractor.getHeartedByUploader());
resultItem.setHeartedByUploader(extractor.isHeartedByUploader());
} catch (Exception e) {
addError(e);
}
try {
resultItem.setPinned(extractor.getPinned());
resultItem.setPinned(extractor.isPinned());
} catch (Exception e) {
addError(e);
}

View File

@ -89,12 +89,12 @@ public class PeertubeCommentsInfoItemExtractor implements CommentsInfoItemExtrac
}
@Override
public boolean getHeartedByUploader() throws ParsingException {
public boolean isHeartedByUploader() throws ParsingException {
return false;
}
@Override
public boolean getPinned() throws ParsingException {
public boolean isPinned() throws ParsingException {
return false;
}

View File

@ -40,12 +40,12 @@ public class SoundcloudCommentsInfoItemExtractor implements CommentsInfoItemExtr
}
@Override
public boolean getHeartedByUploader() throws ParsingException {
public boolean isHeartedByUploader() throws ParsingException {
return false;
}
@Override
public boolean getPinned() throws ParsingException {
public boolean isPinned() throws ParsingException {
return false;
}

View File

@ -116,12 +116,12 @@ public class YoutubeCommentsInfoItemExtractor implements CommentsInfoItemExtract
}
@Override
public boolean getHeartedByUploader() throws ParsingException {
public boolean isHeartedByUploader() throws ParsingException {
return json.has("creatorHeart");
}
@Override
public boolean getPinned() {
public boolean isPinned() {
return json.has("pinnedCommentBadge");
}

View File

@ -181,7 +181,7 @@ public class YoutubeCommentsExtractorTest {
assertFalse(Utils.isBlank(c.getUrl()));
assertFalse(c.getLikeCount() < 0);
assertFalse(Utils.isBlank(c.getCommentText()));
if (c.getHeartedByUploader()) {
if (c.isHeartedByUploader()) {
heartedByUploader = true;
}
}
@ -222,7 +222,7 @@ public class YoutubeCommentsExtractorTest {
assertFalse(Utils.isBlank(c.getCommentText()));
}
assertTrue("First comment isn't pinned", comments.getItems().get(0).getPinned());
assertTrue("First comment isn't pinned", comments.getItems().get(0).isPinned());
}
}
}