[PeerTube] Fix link handler inconsistency providing API links

This commit is contained in:
Stypox
2020-04-09 19:46:20 +02:00
parent 4349be13af
commit 7ae3cb6d07
8 changed files with 46 additions and 43 deletions

View File

@@ -28,7 +28,7 @@ public class PeertubeAccountExtractorTest {
// setting instance might break test when running in parallel
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
extractor = (PeertubeAccountExtractor) PeerTube
.getChannelExtractor("https://peertube.mastodon.host/api/v1/accounts/kde");
.getChannelExtractor("https://peertube.mastodon.host/accounts/kde");
extractor.fetchPage();
}
@@ -53,7 +53,7 @@ public class PeertubeAccountExtractorTest {
@Test
public void testUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/api/v1/accounts/kde", extractor.getUrl());
assertEquals("https://peertube.mastodon.host/accounts/kde", extractor.getUrl());
}
@Test
@@ -115,7 +115,7 @@ public class PeertubeAccountExtractorTest {
// setting instance might break test when running in parallel
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
extractor = (PeertubeAccountExtractor) PeerTube
.getChannelExtractor("https://peertube.mastodon.host/accounts/booteille");
.getChannelExtractor("https://peertube.mastodon.host/api/v1/accounts/booteille");
extractor.fetchPage();
}
@@ -150,12 +150,12 @@ public class PeertubeAccountExtractorTest {
@Test
public void testUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/api/v1/accounts/booteille", extractor.getUrl());
assertEquals("https://peertube.mastodon.host/accounts/booteille", extractor.getUrl());
}
@Test
public void testOriginalUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/accounts/booteille", extractor.getOriginalUrl());
assertEquals("https://peertube.mastodon.host/api/v1/accounts/booteille", extractor.getOriginalUrl());
}
/*//////////////////////////////////////////////////////////////////////////

View File

@@ -53,7 +53,7 @@ public class PeertubeChannelExtractorTest {
@Test
public void testUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/api/v1/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa", extractor.getUrl());
assertEquals("https://peertube.mastodon.host/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa", extractor.getUrl());
}
@Test
@@ -130,7 +130,7 @@ public class PeertubeChannelExtractorTest {
// setting instance might break test when running in parallel
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
extractor = (PeertubeChannelExtractor) PeerTube
.getChannelExtractor("https://peertube.mastodon.host/video-channels/35080089-79b6-45fc-96ac-37e4d46a4457");
.getChannelExtractor("https://peertube.mastodon.host/api/v1/video-channels/35080089-79b6-45fc-96ac-37e4d46a4457");
extractor.fetchPage();
}
@@ -165,12 +165,12 @@ public class PeertubeChannelExtractorTest {
@Test
public void testUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/api/v1/video-channels/35080089-79b6-45fc-96ac-37e4d46a4457", extractor.getUrl());
assertEquals("https://peertube.mastodon.host/video-channels/35080089-79b6-45fc-96ac-37e4d46a4457", extractor.getUrl());
}
@Test
public void testOriginalUrl() throws ParsingException {
assertEquals("https://peertube.mastodon.host/video-channels/35080089-79b6-45fc-96ac-37e4d46a4457", extractor.getOriginalUrl());
assertEquals("https://peertube.mastodon.host/api/v1/video-channels/35080089-79b6-45fc-96ac-37e4d46a4457", extractor.getOriginalUrl());
}
/*//////////////////////////////////////////////////////////////////////////

View File

@@ -53,7 +53,7 @@ public class PeertubeStreamExtractorTest {
@Override public StreamType expectedStreamType() { return StreamType.VIDEO_STREAM; }
@Override public String expectedUploaderName() { return "Framasoft"; }
@Override public String expectedUploaderUrl() { return "https://framatube.org/accounts/framasoft"; }
@Override public String expectedUploaderUrl() { return "https://framatube.org/accounts/framasoft@framatube.org"; }
@Override public List<String> expectedDescriptionContains() { // CRLF line ending
return Arrays.asList("**[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n"
+ "\r\n"
@@ -108,7 +108,7 @@ public class PeertubeStreamExtractorTest {
@Override public StreamType expectedStreamType() { return StreamType.VIDEO_STREAM; }
@Override public String expectedUploaderName() { return "Tomas Berezovskiy"; }
@Override public String expectedUploaderUrl() { return "https://peertube.iriseden.eu/accounts/tomas_berezovskiy"; }
@Override public String expectedUploaderUrl() { return "https://peertube.co.uk/accounts/tomas_berezovskiy@peertube.iriseden.eu"; }
@Override public List<String> expectedDescriptionContains() { // LF line ending
return Arrays.asList("https://en.informnapalm.org/dpr-combatant-describes-orders-given-russian-officers/ "
+ " The InformNapalm team received another video of a separatist prisoner of war telling about his "