Skip to content

Commit d294ccb

Browse files
authored
Merge pull request #1071 from TeamNewPipe/feat/ServiceList
Init services at the correct place
2 parents 5d112aa + 0e01d90 commit d294ccb

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/ServiceList.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import org.schabi.newpipe.extractor.services.soundcloud.SoundcloudService;
77
import org.schabi.newpipe.extractor.services.youtube.YoutubeService;
88

9-
import java.util.Arrays;
10-
import java.util.Collections;
119
import java.util.List;
1210

1311
/*
@@ -34,27 +32,21 @@
3432
@SuppressWarnings({"ConstantName", "InnerAssignment"}) // keep unusual names and inner assignments
3533
public final class ServiceList {
3634
private ServiceList() {
37-
//no instance
35+
// no instance
3836
}
3937

40-
public static final YoutubeService YouTube;
41-
public static final SoundcloudService SoundCloud;
42-
public static final MediaCCCService MediaCCC;
43-
public static final PeertubeService PeerTube;
44-
public static final BandcampService Bandcamp;
38+
public static final YoutubeService YouTube = new YoutubeService(0);
39+
public static final SoundcloudService SoundCloud = new SoundcloudService(1);
40+
public static final MediaCCCService MediaCCC = new MediaCCCService(2);
41+
public static final PeertubeService PeerTube = new PeertubeService(3);
42+
public static final BandcampService Bandcamp = new BandcampService(4);
4543

4644
/**
4745
* When creating a new service, put this service in the end of this list,
4846
* and give it the next free id.
4947
*/
50-
private static final List<StreamingService> SERVICES = Collections.unmodifiableList(
51-
Arrays.asList(
52-
YouTube = new YoutubeService(0),
53-
SoundCloud = new SoundcloudService(1),
54-
MediaCCC = new MediaCCCService(2),
55-
PeerTube = new PeertubeService(3),
56-
Bandcamp = new BandcampService(4)
57-
));
48+
private static final List<StreamingService> SERVICES = List.of(
49+
YouTube, SoundCloud, MediaCCC, PeerTube, Bandcamp);
5850

5951
/**
6052
* Get all the supported services.

0 commit comments

Comments
 (0)