Skip to content

Commit c2b5370

Browse files
committed
Apply suggestions: improve switch and use EMPTY_STRING
1 parent 8c1041d commit c2b5370

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampSearchExtractor.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.schabi.newpipe.extractor.MultiInfoItemsCollector;
1919
import org.schabi.newpipe.extractor.search.SearchExtractor;
2020
import org.schabi.newpipe.extractor.services.bandcamp.extractors.streaminfoitem.BandcampSearchStreamInfoItemExtractor;
21+
import org.schabi.newpipe.extractor.utils.Utils;
2122

2223
import javax.annotation.Nonnull;
2324
import java.io.IOException;
@@ -34,7 +35,7 @@ public BandcampSearchExtractor(final StreamingService service,
3435
@NonNull
3536
@Override
3637
public String getSearchSuggestion() {
37-
return "";
38+
return Utils.EMPTY_STRING;
3839
}
3940

4041
@Override
@@ -58,13 +59,9 @@ public InfoItemsPage<InfoItem> getPage(final Page page)
5859
.flatMap(element -> element.getElementsByClass("itemtype").stream())
5960
.map(Element::text)
6061
.findFirst()
61-
.orElse("");
62+
.orElse(Utils.EMPTY_STRING);
6263

6364
switch (type) {
64-
default:
65-
case "FAN":
66-
// don't display fan results
67-
break;
6865
case "ARTIST":
6966
collector.commit(new BandcampChannelInfoItemExtractor(searchResult));
7067
break;
@@ -74,6 +71,9 @@ public InfoItemsPage<InfoItem> getPage(final Page page)
7471
case "TRACK":
7572
collector.commit(new BandcampSearchStreamInfoItemExtractor(searchResult, null));
7673
break;
74+
default:
75+
// don't display fan results ("FAN") or other things
76+
break;
7777
}
7878
}
7979

extractor/src/main/java/org/schabi/newpipe/extractor/services/bandcamp/extractors/BandcampStreamExtractor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public DateWrapper getUploadDate() throws ParsingException {
119119
@Override
120120
public String getThumbnailUrl() throws ParsingException {
121121
if (albumJson.isNull("art_id")) {
122-
return "";
122+
return Utils.EMPTY_STRING;
123123
} else {
124124
return getImageUrl(albumJson.getLong("art_id"), true);
125125
}
@@ -131,7 +131,7 @@ public String getUploaderAvatarUrl() {
131131
return document.getElementsByClass("band-photo").stream()
132132
.map(element -> element.attr("src"))
133133
.findFirst()
134-
.orElse("");
134+
.orElse(Utils.EMPTY_STRING);
135135
}
136136

137137
@Nonnull

0 commit comments

Comments
 (0)