Merge pull request #525 from B0pol/rename
rename getHeartedByCreator and getPinned to isPinned and isHeartedByC…
This commit is contained in:
commit
c00ee75d74
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue