Skip to content

Commit 0b086ce

Browse files
[SoundCloud] Minor refactors
1 parent 212886e commit 0b086ce

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamExtractorTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ public SoundcloudTrackTest2() {
195195
.build()
196196
);
197197
}
198-
199198
}
200199

201200
@Nested
@@ -222,6 +221,5 @@ public SoundcloudTrackTest3() {
222221
.build()
223222
);
224223
}
225-
226224
}
227225
}

extractor/src/test/java/org/schabi/newpipe/extractor/services/testcases/ISoundcloudStreamExtractorTestCase.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ public interface ISoundcloudStreamExtractorTestCase extends DefaultStreamExtract
2828
* Pattern for matching soundcloud stream URLs
2929
* Matches URLs of the form:
3030
* <pre>
31-
* https://soundcloud.com/user-904087338/nether#t=46
31+
* <a href="https://soundcloud.com/user-904087338/nether#t=46">https://soundcloud.com/user-904087338/nether#t=46</a>
3232
* </pre>
3333
*/
34-
Pattern URL_PATTERN = java.util.regex.Pattern.compile(
34+
Pattern URL_PATTERN = Pattern.compile(
3535
"^https?://(?:www\\.|m\\.|on\\.)?soundcloud\\.com/"
3636
+ "(?<uploader>[0-9a-z_-]+)/(?!(?:tracks|albums|sets|reposts|followers|following)/?$)"
3737
+ "(?<id>[0-9a-z_-]+)/?"
@@ -61,9 +61,6 @@ default int getGroupEndIndexFromUrl(String group) {
6161
}
6262
}
6363

64-
/**
65-
* @inheritdoc
66-
*/
6764
default Matcher urlMatcher() {
6865
try {
6966
return Parser.matchOrThrow(URL_PATTERN, url());
@@ -81,14 +78,14 @@ default String urlContains() {
8178
}
8279

8380
@Value.Derived
84-
public default StreamingService service() { return SoundCloud; }
81+
default StreamingService service() { return SoundCloud; }
8582

8683
@Value.Derived
8784
@Override
88-
public default StreamType streamType() { return StreamType.AUDIO_STREAM; }
85+
default StreamType streamType() { return StreamType.AUDIO_STREAM; }
8986

9087
@Override
91-
public default int timestamp() {
88+
default int timestamp() {
9289
try {
9390
return Integer.parseInt(getGroupFromUrl("timestamp"));
9491
}
@@ -99,15 +96,15 @@ public default int timestamp() {
9996
}
10097

10198
@Override
102-
public default long dislikeCountAtLeast() { return -1; } // default: soundcloud has no dislikes
99+
default long dislikeCountAtLeast() { return -1; } // default: soundcloud has no dislikes
103100

104101
@Override
105-
public default boolean hasVideoStreams() { return false; } // default: soundcloud has no video streams
102+
default boolean hasVideoStreams() { return false; } // default: soundcloud has no video streams
106103

107104
@Override
108-
public default boolean hasSubtitles() { return false; } // default: soundcloud has no subtitles
105+
default boolean hasSubtitles() { return false; } // default: soundcloud has no subtitles
109106

110-
public default boolean hasFrames() { return false; } // default: soundcloud has no frames
107+
default boolean hasFrames() { return false; } // default: soundcloud has no frames
111108

112-
public default int streamSegmentsCount() { return 0; }
109+
default int streamSegmentsCount() { return 0; }
113110
}

0 commit comments

Comments
 (0)