mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-08-14 23:51:41 +00:00
Add supported countries to frontend properies.
This commit is contained in:
parent
d10fd66a20
commit
ec4e058652
1 changed files with 6 additions and 0 deletions
|
@ -2,6 +2,7 @@ package me.kavin.piped.consts;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.json.JsonMapper;
|
import com.fasterxml.jackson.databind.json.JsonMapper;
|
||||||
|
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
|
||||||
import me.kavin.piped.utils.PageMixin;
|
import me.kavin.piped.utils.PageMixin;
|
||||||
|
@ -14,6 +15,7 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||||
import org.schabi.newpipe.extractor.Page;
|
import org.schabi.newpipe.extractor.Page;
|
||||||
import org.schabi.newpipe.extractor.StreamingService;
|
import org.schabi.newpipe.extractor.StreamingService;
|
||||||
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
|
||||||
|
import org.schabi.newpipe.extractor.localization.ContentCountry;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
|
@ -136,6 +138,10 @@ public class Constants {
|
||||||
frontendProperties.put(StringUtils.substringAfter(key, "frontend."), value);
|
frontendProperties.put(StringUtils.substringAfter(key, "frontend."), value);
|
||||||
});
|
});
|
||||||
frontendProperties.put("imageProxyUrl", IMAGE_PROXY_PART);
|
frontendProperties.put("imageProxyUrl", IMAGE_PROXY_PART);
|
||||||
|
frontendProperties.putArray("countries").addAll(
|
||||||
|
YOUTUBE_SERVICE.getSupportedCountries().stream().map(ContentCountry::getCountryCode)
|
||||||
|
.map(JsonNodeFactory.instance::textNode).toList()
|
||||||
|
);
|
||||||
|
|
||||||
// transform hibernate properties for legacy configurations
|
// transform hibernate properties for legacy configurations
|
||||||
hibernateProperties.replace("hibernate.dialect",
|
hibernateProperties.replace("hibernate.dialect",
|
||||||
|
|
Loading…
Reference in a new issue