Skip to content

Commit 1e9d30c

Browse files
committed
Do not init services while creating services array
1 parent 533121f commit 1e9d30c

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

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

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,21 @@
3434
@SuppressWarnings({"ConstantName", "InnerAssignment"}) // keep unusual names and inner assignments
3535
public final class ServiceList {
3636
private ServiceList() {
37-
//no instance
37+
// no instance
3838
}
3939

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;
40+
public static final YoutubeService YouTube = new YoutubeService(0);
41+
public static final SoundcloudService SoundCloud = new SoundcloudService(1);
42+
public static final MediaCCCService MediaCCC = new MediaCCCService(2);
43+
public static final PeertubeService PeerTube = new PeertubeService(3);
44+
public static final BandcampService Bandcamp = new BandcampService(4);
4545

4646
/**
4747
* When creating a new service, put this service in the end of this list,
4848
* and give it the next free id.
4949
*/
5050
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-
));
51+
Arrays.asList(YouTube, SoundCloud, MediaCCC, PeerTube, Bandcamp));
5852

5953
/**
6054
* Get all the supported services.

0 commit comments

Comments
 (0)