Merge pull request #326 from wb9688/subchannel-parentchannel

Rename SubChannel in channels back to ParentChannel
This commit is contained in:
Tobias Groza 2020-05-08 17:40:49 +02:00 committed by GitHub
commit 3ddd6e4d7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 54 additions and 44 deletions

View File

@ -37,7 +37,7 @@ public abstract class ChannelExtractor extends ListExtractor<StreamInfoItem> {
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;
}

View File

@ -95,19 +95,19 @@ public class ChannelInfo extends ListInfo<StreamInfoItem> {
}
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);
}
@ -116,37 +116,37 @@ public class ChannelInfo extends ListInfo<StreamInfoItem> {
}
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() {

View File

@ -53,17 +53,17 @@ public class MediaCCCConferenceExtractor extends ChannelExtractor {
}
@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 "";
}

View File

@ -76,17 +76,17 @@ public class PeertubeAccountExtractor extends ChannelExtractor {
}
@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 "";
}

View File

@ -76,17 +76,17 @@ public class PeertubeChannelExtractor extends ChannelExtractor {
}
@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");

View File

@ -84,17 +84,17 @@ public class SoundcloudChannelExtractor extends ChannelExtractor {
}
@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 "";
}

View File

@ -213,17 +213,17 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
}
@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 "";
}

View File

@ -85,13 +85,18 @@ public class PeertubeChannelExtractorTest {
}
@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
@ -192,13 +197,18 @@ public class PeertubeChannelExtractorTest {
}
@Test
public void testSubChannelName() throws ParsingException {
assertEquals("booteille", extractor.getSubChannelName());
public void testParentChannelName() throws ParsingException {
assertEquals("booteille", extractor.getParentChannelName());
}
@Test
public void testSubChannelUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/booteille", extractor.getSubChannelUrl());
public void testParentChannelUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/booteille", extractor.getParentChannelUrl());
}
@Test
public void testParentChannelAvatarUrl() throws ParsingException {
assertIsSecureUrl(extractor.getParentChannelAvatarUrl());
}
@Test