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;
|
this.heartedByUploader = isHeartedByUploader;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getHeartedByUploader() {
|
public boolean isHeartedByUploader() {
|
||||||
return this.heartedByUploader;
|
return this.heartedByUploader;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getPinned() {
|
public boolean isPinned() {
|
||||||
return pinned;
|
return pinned;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,10 +47,10 @@ public interface CommentsInfoItemExtractor extends InfoItemExtractor {
|
||||||
/**
|
/**
|
||||||
* Whether the comment has been hearted by the uploader
|
* Whether the comment has been hearted by the uploader
|
||||||
*/
|
*/
|
||||||
boolean getHeartedByUploader() throws ParsingException;
|
boolean isHeartedByUploader() throws ParsingException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the comment is pinned
|
* Whether the comment is pinned
|
||||||
*/
|
*/
|
||||||
boolean getPinned() throws ParsingException;
|
boolean isPinned() throws ParsingException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,13 +71,13 @@ public class CommentsInfoItemsCollector extends InfoItemsCollector<CommentsInfoI
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
resultItem.setHeartedByUploader(extractor.getHeartedByUploader());
|
resultItem.setHeartedByUploader(extractor.isHeartedByUploader());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
addError(e);
|
addError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
resultItem.setPinned(extractor.getPinned());
|
resultItem.setPinned(extractor.isPinned());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
addError(e);
|
addError(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,12 +89,12 @@ public class PeertubeCommentsInfoItemExtractor implements CommentsInfoItemExtrac
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getHeartedByUploader() throws ParsingException {
|
public boolean isHeartedByUploader() throws ParsingException {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getPinned() throws ParsingException {
|
public boolean isPinned() throws ParsingException {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,12 +40,12 @@ public class SoundcloudCommentsInfoItemExtractor implements CommentsInfoItemExtr
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getHeartedByUploader() throws ParsingException {
|
public boolean isHeartedByUploader() throws ParsingException {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getPinned() throws ParsingException {
|
public boolean isPinned() throws ParsingException {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,12 +116,12 @@ public class YoutubeCommentsInfoItemExtractor implements CommentsInfoItemExtract
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getHeartedByUploader() throws ParsingException {
|
public boolean isHeartedByUploader() throws ParsingException {
|
||||||
return json.has("creatorHeart");
|
return json.has("creatorHeart");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean getPinned() {
|
public boolean isPinned() {
|
||||||
return json.has("pinnedCommentBadge");
|
return json.has("pinnedCommentBadge");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,7 @@ public class YoutubeCommentsExtractorTest {
|
||||||
assertFalse(Utils.isBlank(c.getUrl()));
|
assertFalse(Utils.isBlank(c.getUrl()));
|
||||||
assertFalse(c.getLikeCount() < 0);
|
assertFalse(c.getLikeCount() < 0);
|
||||||
assertFalse(Utils.isBlank(c.getCommentText()));
|
assertFalse(Utils.isBlank(c.getCommentText()));
|
||||||
if (c.getHeartedByUploader()) {
|
if (c.isHeartedByUploader()) {
|
||||||
heartedByUploader = true;
|
heartedByUploader = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ public class YoutubeCommentsExtractorTest {
|
||||||
assertFalse(Utils.isBlank(c.getCommentText()));
|
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