Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename SubChannel in channels back to ParentChannel #326

Merged
merged 1 commit into from
May 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ChannelExtractor(StreamingService service, ListLinkHandler linkHandler) {
public abstract String getFeedUrl() throws ParsingException;
public abstract long getSubscriberCount() throws ParsingException;
public abstract String getDescription() throws ParsingException;
public abstract String getSubChannelName() throws ParsingException;
public abstract String getSubChannelUrl() throws ParsingException;
public abstract String getSubChannelAvatarUrl() throws ParsingException;
public abstract String getParentChannelName() throws ParsingException;
public abstract String getParentChannelUrl() throws ParsingException;
public abstract String getParentChannelAvatarUrl() throws ParsingException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ public static ChannelInfo getInfo(ChannelExtractor extractor) throws IOException
}

try {
info.setSubChannelName(extractor.getSubChannelName());
info.setParentChannelName(extractor.getParentChannelName());
} catch (Exception e) {
info.addError(e);
}

try {
info.setSubChannelUrl(extractor.getSubChannelUrl());
info.setParentChannelUrl(extractor.getParentChannelUrl());
} catch (Exception e) {
info.addError(e);
}

try {
info.setSubChannelAvatarUrl(extractor.getSubChannelAvatarUrl());
info.setParentChannelAvatarUrl(extractor.getParentChannelAvatarUrl());
} catch (Exception e) {
info.addError(e);
}
Expand All @@ -116,37 +116,37 @@ public static ChannelInfo getInfo(ChannelExtractor extractor) throws IOException
}

private String avatarUrl;
private String subChannelName;
private String subChannelUrl;
private String subChannelAvatarUrl;
private String parentChannelName;
private String parentChannelUrl;
private String parentChannelAvatarUrl;
private String bannerUrl;
private String feedUrl;
private long subscriberCount = -1;
private String description;
private String[] donationLinks;

public String getSubChannelName() {
return subChannelName;
public String getParentChannelName() {
return parentChannelName;
}

public void setSubChannelName(String subChannelName) {
this.subChannelName = subChannelName;
public void setParentChannelName(String parentChannelName) {
this.parentChannelName = parentChannelName;
}

public String getSubChannelUrl() {
return subChannelUrl;
public String getParentChannelUrl() {
return parentChannelUrl;
}

public void setSubChannelUrl(String subChannelUrl) {
this.subChannelUrl = subChannelUrl;
public void setParentChannelUrl(String parentChannelUrl) {
this.parentChannelUrl = parentChannelUrl;
}

public String getSubChannelAvatarUrl() {
return subChannelAvatarUrl;
public String getParentChannelAvatarUrl() {
return parentChannelAvatarUrl;
}

public void setSubChannelAvatarUrl(String subChannelAvatarUrl) {
this.subChannelAvatarUrl = subChannelAvatarUrl;
public void setParentChannelAvatarUrl(String parentChannelAvatarUrl) {
this.parentChannelAvatarUrl = parentChannelAvatarUrl;
}

public String getAvatarUrl() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ public String getDescription() {
}

@Override
public String getSubChannelName() throws ParsingException {
public String getParentChannelName() throws ParsingException {
return "";
}

@Override
public String getSubChannelUrl() throws ParsingException {
public String getParentChannelUrl() throws ParsingException {
return "";
}

@Override
public String getSubChannelAvatarUrl() throws ParsingException {
public String getParentChannelAvatarUrl() throws ParsingException {
return "";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ public String getDescription() throws ParsingException {
}

@Override
public String getSubChannelName() throws ParsingException {
public String getParentChannelName() throws ParsingException {
return "";
}

@Override
public String getSubChannelUrl() throws ParsingException {
public String getParentChannelUrl() throws ParsingException {
return "";
}

@Override
public String getSubChannelAvatarUrl() throws ParsingException {
public String getParentChannelAvatarUrl() throws ParsingException {
return "";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ public String getDescription() throws ParsingException {
}

@Override
public String getSubChannelName() throws ParsingException {
public String getParentChannelName() throws ParsingException {
return JsonUtils.getString(json, "ownerAccount.name");
}

@Override
public String getSubChannelUrl() throws ParsingException {
public String getParentChannelUrl() throws ParsingException {
return JsonUtils.getString(json, "ownerAccount.url");
}

@Override
public String getSubChannelAvatarUrl() throws ParsingException {
public String getParentChannelAvatarUrl() throws ParsingException {
String value;
try {
value = JsonUtils.getString(json, "ownerAccount.avatar.path");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,17 @@ public String getDescription() {
}

@Override
public String getSubChannelName() throws ParsingException {
public String getParentChannelName() throws ParsingException {
return "";
}

@Override
public String getSubChannelUrl() throws ParsingException {
public String getParentChannelUrl() throws ParsingException {
return "";
}

@Override
public String getSubChannelAvatarUrl() throws ParsingException {
public String getParentChannelAvatarUrl() throws ParsingException {
return "";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,17 @@ public String getDescription() throws ParsingException {
}

@Override
public String getSubChannelName() throws ParsingException {
public String getParentChannelName() throws ParsingException {
return "";
}

@Override
public String getSubChannelUrl() throws ParsingException {
public String getParentChannelUrl() throws ParsingException {
return "";
}

@Override
public String getSubChannelAvatarUrl() throws ParsingException {
public String getParentChannelAvatarUrl() throws ParsingException {
return "";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,18 @@ public void testDescription() throws ParsingException {
}

@Test
public void testSubChannelName() throws ParsingException {
assertEquals("libux", extractor.getSubChannelName());
public void testParentChannelName() throws ParsingException {
assertEquals("libux", extractor.getParentChannelName());
}

@Test
public void testSubChannelUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/libux", extractor.getSubChannelUrl());
public void testParentChannelUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/libux", extractor.getParentChannelUrl());
}

@Test
public void testParentChannelAvatarUrl() throws ParsingException {
assertIsSecureUrl(extractor.getParentChannelAvatarUrl());
}

@Test
Expand Down Expand Up @@ -192,13 +197,18 @@ public void testDescription() throws ParsingException {
}

@Test
public void testSubChannelName() throws ParsingException {
assertEquals("booteille", extractor.getSubChannelName());
public void testParentChannelName() throws ParsingException {
assertEquals("booteille", extractor.getParentChannelName());
}

@Test
public void testParentChannelUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/booteille", extractor.getParentChannelUrl());
}

@Test
public void testSubChannelUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/booteille", extractor.getSubChannelUrl());
public void testParentChannelAvatarUrl() throws ParsingException {
assertIsSecureUrl(extractor.getParentChannelAvatarUrl());
}

@Test
Expand Down