Bandcamp capitalization

This commit is contained in:
Fynn Godau 2020-04-20 21:55:35 +02:00
parent b100b9873f
commit c133190c53
11 changed files with 38 additions and 38 deletions

View File

@ -42,7 +42,7 @@ The following sites are currently supported:
- SoundCloud
- MediaCCC
- PeerTube (no P2P)
- bandcamp
- Bandcamp
## License

View File

@ -40,7 +40,7 @@ public final class ServiceList {
public static final SoundcloudService SoundCloud;
public static final MediaCCCService MediaCCC;
public static final PeertubeService PeerTube;
public static final BandcampService bandcamp;
public static final BandcampService Bandcamp;
/**
* When creating a new service, put this service in the end of this list,
@ -52,7 +52,7 @@ public final class ServiceList {
SoundCloud = new SoundcloudService(1),
MediaCCC = new MediaCCCService(2),
PeerTube = new PeertubeService(3),
bandcamp = new BandcampService(4)
Bandcamp = new BandcampService(4)
));
/**

View File

@ -13,7 +13,7 @@ import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampExtract
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.bandcamp;
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
public class BandcampChannelExtractorTest {
@ -22,7 +22,7 @@ public class BandcampChannelExtractorTest {
@BeforeClass
public static void setUp() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance());
extractor = (BandcampChannelExtractor) bandcamp
extractor = (BandcampChannelExtractor) Bandcamp
.getChannelExtractor("https://zachbenson.bandcamp.com/");
}
@ -51,11 +51,11 @@ public class BandcampChannelExtractorTest {
@Test
public void testGetNoAvatar() throws ExtractionException {
assertEquals("", bandcamp.getChannelExtractor("https://powertothequeerkids.bandcamp.com/").getAvatarUrl());
assertEquals("", Bandcamp.getChannelExtractor("https://powertothequeerkids.bandcamp.com/").getAvatarUrl());
}
@Test
public void testGetNoBanner() throws ExtractionException {
assertEquals("", bandcamp.getChannelExtractor("https://powertothequeerkids.bandcamp.com/").getBannerUrl());
assertEquals("", Bandcamp.getChannelExtractor("https://powertothequeerkids.bandcamp.com/").getBannerUrl());
}
}

View File

@ -14,7 +14,7 @@ import java.io.IOException;
import java.util.List;
import static org.junit.Assert.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.bandcamp;
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
/**
* Tests for {@link BandcampFeaturedExtractor}
@ -26,7 +26,7 @@ public class BandcampFeaturedExtractorTest {
@BeforeClass
public static void setUp() throws ExtractionException, IOException {
NewPipe.init(DownloaderTestImpl.getInstance());
extractor = (BandcampFeaturedExtractor) bandcamp
extractor = (BandcampFeaturedExtractor) Bandcamp
.getKioskList().getDefaultKioskExtractor();
}

View File

@ -16,7 +16,7 @@ import java.io.IOException;
import java.util.List;
import static org.junit.Assert.*;
import static org.schabi.newpipe.extractor.ServiceList.bandcamp;
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
/**
* Tests for {@link BandcampPlaylistExtractor}
@ -33,7 +33,7 @@ public class BandcampPlaylistExtractorTest {
*/
@Test
public void testCount() throws ExtractionException, IOException {
PlaylistExtractor extractor = bandcamp.getPlaylistExtractor("https://macbenson.bandcamp.com/album/coming-of-age");
PlaylistExtractor extractor = Bandcamp.getPlaylistExtractor("https://macbenson.bandcamp.com/album/coming-of-age");
extractor.fetchPage();
assertEquals(5, extractor.getStreamCount());
@ -44,7 +44,7 @@ public class BandcampPlaylistExtractorTest {
*/
@Test
public void testDifferentTrackCovers() throws ExtractionException, IOException {
PlaylistExtractor extractor = bandcamp.getPlaylistExtractor("https://zachbensonarchive.bandcamp.com/album/results-of-boredom");
PlaylistExtractor extractor = Bandcamp.getPlaylistExtractor("https://zachbensonarchive.bandcamp.com/album/results-of-boredom");
extractor.fetchPage();
List<StreamInfoItem> l = extractor.getInitialPage().getItems();
@ -57,7 +57,7 @@ public class BandcampPlaylistExtractorTest {
*/
@Test(timeout = 10000L)
public void testDifferentTrackCoversDuration() throws ExtractionException, IOException {
PlaylistExtractor extractor = bandcamp.getPlaylistExtractor("https://infiniteammo.bandcamp.com/album/night-in-the-woods-vol-1-at-the-end-of-everything");
PlaylistExtractor extractor = Bandcamp.getPlaylistExtractor("https://infiniteammo.bandcamp.com/album/night-in-the-woods-vol-1-at-the-end-of-everything");
extractor.fetchPage();
/* All tracks in this album have the same cover art, but I don't know any albums with more than 10 tracks
@ -73,7 +73,7 @@ public class BandcampPlaylistExtractorTest {
*/
@Test(expected = ContentNotAvailableException.class)
public void testLockedContent() throws ExtractionException, IOException {
PlaylistExtractor extractor = bandcamp.getPlaylistExtractor("https://billwurtz.bandcamp.com/album/high-enough");
PlaylistExtractor extractor = Bandcamp.getPlaylistExtractor("https://billwurtz.bandcamp.com/album/high-enough");
extractor.fetchPage();
}
@ -82,7 +82,7 @@ public class BandcampPlaylistExtractorTest {
*/
@Test
public void testSingleStreamPlaylist() throws ExtractionException, IOException {
PlaylistExtractor extractor = bandcamp.getPlaylistExtractor("https://zachjohnson1.bandcamp.com/album/endless");
PlaylistExtractor extractor = Bandcamp.getPlaylistExtractor("https://zachjohnson1.bandcamp.com/album/endless");
extractor.fetchPage();
assertEquals(1, extractor.getStreamCount());

View File

@ -14,7 +14,7 @@ import java.io.IOException;
import java.util.List;
import static org.junit.Assert.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.bandcamp;
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
/**
* Tests for {@link BandcampRadioExtractor}
@ -26,14 +26,14 @@ public class BandcampRadioExtractorTest {
@BeforeClass
public static void setUp() throws ExtractionException, IOException {
NewPipe.init(DownloaderTestImpl.getInstance());
extractor = (BandcampRadioExtractor) bandcamp
extractor = (BandcampRadioExtractor) Bandcamp
.getKioskList()
.getExtractorById("Radio", null);
}
@Test
public void testRadioCount() throws ExtractionException, IOException {
List<InfoItem> list = bandcamp.getKioskList().getExtractorById("Radio", null).getInitialPage().getItems();
List<InfoItem> list = Bandcamp.getKioskList().getExtractorById("Radio", null).getInitialPage().getItems();
assertTrue(list.size() > 300);
}
}

View File

@ -12,7 +12,7 @@ import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampStreamE
import java.io.IOException;
import static org.junit.Assert.*;
import static org.schabi.newpipe.extractor.ServiceList.bandcamp;
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
public class BandcampRadioStreamExtractorTest {
@ -23,13 +23,13 @@ public class BandcampRadioStreamExtractorTest {
@Test
public void testGettingCorrectStreamExtractor() throws ExtractionException {
assertTrue(bandcamp.getStreamExtractor("https://bandcamp.com/?show=3") instanceof BandcampRadioStreamExtractor);
assertFalse(bandcamp.getStreamExtractor("https://zachbenson.bandcamp.com/track/deflated") instanceof BandcampRadioStreamExtractor);
assertTrue(Bandcamp.getStreamExtractor("https://bandcamp.com/?show=3") instanceof BandcampRadioStreamExtractor);
assertFalse(Bandcamp.getStreamExtractor("https://zachbenson.bandcamp.com/track/deflated") instanceof BandcampRadioStreamExtractor);
}
@Test
public void testExtracting() throws ExtractionException, IOException {
BandcampRadioStreamExtractor e = (BandcampRadioStreamExtractor) bandcamp.getStreamExtractor("https://bandcamp.com/?show=230");
BandcampRadioStreamExtractor e = (BandcampRadioStreamExtractor) Bandcamp.getStreamExtractor("https://bandcamp.com/?show=230");
e.fetchPage();
assertEquals("Sound Movements", e.getName());
assertEquals("Andrew Jervis", e.getUploaderName());

View File

@ -20,7 +20,7 @@ import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.bandcamp;
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
/**
* Test for {@link BandcampSearchExtractor}
@ -41,7 +41,7 @@ public class BandcampSearchExtractorTest {
*/
@Test
public void testStreamSearch() throws ExtractionException, IOException {
SearchExtractor extractor = bandcamp.getSearchExtractor("best friend's basement");
SearchExtractor extractor = Bandcamp.getSearchExtractor("best friend's basement");
ListExtractor.InfoItemsPage<InfoItem> page = extractor.getInitialPage();
InfoItem bestFriendsBasement = page.getItems().get(0);
@ -58,7 +58,7 @@ public class BandcampSearchExtractorTest {
*/
@Test
public void testChannelSearch() throws ExtractionException, IOException {
SearchExtractor extractor = bandcamp.getSearchExtractor("C418");
SearchExtractor extractor = Bandcamp.getSearchExtractor("C418");
InfoItem c418 = extractor.getInitialPage()
.getItems().get(0);
@ -75,7 +75,7 @@ public class BandcampSearchExtractorTest {
*/
@Test
public void testAlbumSearch() throws ExtractionException, IOException {
SearchExtractor extractor = bandcamp.getSearchExtractor("minecraft volume alpha");
SearchExtractor extractor = Bandcamp.getSearchExtractor("minecraft volume alpha");
InfoItem minecraft = extractor.getInitialPage()
.getItems().get(0);
@ -96,7 +96,7 @@ public class BandcampSearchExtractorTest {
@Test
public void testMultiplePages() throws ExtractionException, IOException {
// A query practically guaranteed to have the maximum amount of pages
SearchExtractor extractor = bandcamp.getSearchExtractor("e");
SearchExtractor extractor = Bandcamp.getSearchExtractor("e");
assertEquals("https://bandcamp.com/search?q=e&page=2", extractor.getInitialPage().getNextPageUrl());

View File

@ -10,7 +10,7 @@ import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.services.bandcamp.linkHandler.BandcampSearchQueryHandlerFactory;
import static org.junit.Assert.assertEquals;
import static org.schabi.newpipe.extractor.ServiceList.bandcamp;
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
public class BandcampSearchQueryHandlerFactoryTest {
@ -20,7 +20,7 @@ public class BandcampSearchQueryHandlerFactoryTest {
public static void setUp() {
NewPipe.init(DownloaderTestImpl.getInstance());
searchQuery = (BandcampSearchQueryHandlerFactory) bandcamp
searchQuery = (BandcampSearchQueryHandlerFactory) Bandcamp
.getSearchQHFactory();
}

View File

@ -15,7 +15,7 @@ import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.bandcamp;
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
public class BandcampStreamExtractorTest {
@ -24,14 +24,14 @@ public class BandcampStreamExtractorTest {
@BeforeClass
public static void setUp() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance());
extractor = (BandcampStreamExtractor) bandcamp
extractor = (BandcampStreamExtractor) Bandcamp
.getStreamExtractor("https://zachbenson.bandcamp.com/track/kitchen");
extractor.fetchPage();
}
@Test(expected = ExtractionException.class)
public void testAlbum() throws ExtractionException {
bandcamp.getStreamExtractor("https://zachbenson.bandcamp.com/album/prom");
Bandcamp.getStreamExtractor("https://zachbenson.bandcamp.com/album/prom");
}
@Test
@ -66,7 +66,7 @@ public class BandcampStreamExtractorTest {
@Test
public void testNoArtistProfilePicture() throws ExtractionException {
assertEquals("", bandcamp.getStreamExtractor("https://powertothequeerkids.bandcamp.com/track/human-nature").getUploaderAvatarUrl());
assertEquals("", Bandcamp.getStreamExtractor("https://powertothequeerkids.bandcamp.com/track/human-nature").getUploaderAvatarUrl());
}
@Test
@ -77,19 +77,19 @@ public class BandcampStreamExtractorTest {
@Test(expected = ParsingException.class)
public void testInvalidUrl() throws ExtractionException {
bandcamp.getStreamExtractor("https://bandcamp.com");
Bandcamp.getStreamExtractor("https://bandcamp.com");
}
@Test
public void testCategory() throws ExtractionException, IOException {
StreamExtractor se = bandcamp.getStreamExtractor("https://npet.bandcamp.com/track/track-1");
StreamExtractor se = Bandcamp.getStreamExtractor("https://npet.bandcamp.com/track/track-1");
se.fetchPage();
assertEquals("acoustic", se.getCategory());
}
@Test
public void testLicense() throws ExtractionException, IOException {
StreamExtractor se = bandcamp.getStreamExtractor("https://npet.bandcamp.com/track/track-1");
StreamExtractor se = Bandcamp.getStreamExtractor("https://npet.bandcamp.com/track/track-1");
se.fetchPage();
assertEquals("CC BY 3.0", se.getLicence());
}

View File

@ -13,7 +13,7 @@ import java.io.IOException;
import java.util.List;
import static org.junit.Assert.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.bandcamp;
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
/**
* Tests for {@link BandcampSuggestionExtractor}
@ -25,7 +25,7 @@ public class BandcampSuggestionExtractorTest {
@BeforeClass
public static void setUp() {
NewPipe.init(DownloaderTestImpl.getInstance());
extractor = (BandcampSuggestionExtractor) bandcamp.getSuggestionExtractor();
extractor = (BandcampSuggestionExtractor) Bandcamp.getSuggestionExtractor();
}
@Test