Code improvements

This commit is contained in:
TobiGr 2021-02-20 23:58:49 +01:00
parent ea120a4637
commit adde4332d1
5 changed files with 11 additions and 23 deletions

View File

@ -119,16 +119,16 @@ public class BandcampExtractorHelper {
/**
* @param id The image ID
* @param album Whether this is the cover of an album
* @return Url of image with this ID in size 10 which is 1200x1200 (we could also choose size 0
* but we don't want something as large as 3460x3460 here, do we?)
* @return URL of image with this ID in size 10 which is 1200x1200 (we could also choose size 0
* but we don't want something as large as 3460x3460 here)
*/
public static String getImageUrl(final long id, final boolean album) {
return "https://f4.bcbits.com/img/" + (album ? 'a' : "") + id + "_10.jpg";
}
/**
* @return <code>true</code> if the given url looks like it comes from a bandcamp custom domain
* or if it comes from bandcamp.com itself
* @return <code>true</code> if the given URL looks like it comes from a bandcamp custom domain
* or if it comes from <code>bandcamp.com</code> itself
*/
public static boolean isSupportedDomain(final String url) throws ParsingException {
@ -151,7 +151,7 @@ public class BandcampExtractorHelper {
/**
* Whether the URL points to a radio kiosk.
* @param url the URL to check
* @return true if the URL is <code>https://bandcamp.com/?show=SHOW_ID</code>
* @return true if the URL matches <code>https://bandcamp.com/?show=SHOW_ID</code>
*/
public static boolean isRadioUrl(final String url) {
return url.toLowerCase().matches("https?://bandcamp\\.com/\\?show=\\d+");

View File

@ -18,11 +18,6 @@ public class BandcampDiscographStreamInfoItemExtractor extends BandcampStreamInf
return discograph.getString("band_name");
}
@Override
public boolean isUploaderVerified() throws ParsingException {
return false;
}
@Override
public String getName() {
return discograph.getString("title");

View File

@ -53,11 +53,6 @@ public class BandcampPlaylistStreamInfoItemExtractor extends BandcampStreamInfoI
return "";
}
@Override
public boolean isUploaderVerified() throws ParsingException {
return false;
}
/**
* Each track can have its own cover art. Therefore, unless a substitute is provided,
* the thumbnail is extracted using a stream extractor.

View File

@ -24,11 +24,6 @@ public class BandcampSearchStreamInfoItemExtractor extends BandcampStreamInfoIte
}
}
@Override
public boolean isUploaderVerified() throws ParsingException {
return false;
}
@Override
public String getName() throws ParsingException {
return resultInfo.getElementsByClass("heading").text();

View File

@ -1,5 +1,6 @@
package org.schabi.newpipe.extractor.services.bandcamp.extractors.streaminfoitem;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.localization.DateWrapper;
import org.schabi.newpipe.extractor.stream.StreamInfoItemExtractor;
import org.schabi.newpipe.extractor.stream.StreamType;
@ -44,9 +45,11 @@ public abstract class BandcampStreamInfoItemExtractor implements StreamInfoItemE
return null;
}
/**
* There are no ads just like that, duh
*/
@Override
public boolean isUploaderVerified() throws ParsingException {
return false;
}
@Override
public boolean isAd() {
return false;