fix: manually encoded the username when creating the uri for streaming and fetching coverArt

This commit is contained in:
antonio 2023-08-21 16:15:08 +02:00
parent 0201077bc4
commit af83ffd608
3 changed files with 16 additions and 4 deletions

View file

@ -1,5 +1,8 @@
package com.cappielloantonio.tempo.util;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
@ -50,4 +53,12 @@ public class Util {
return pascalCase.toString();
}
public static String encode(String value) {
try {
return URLEncoder.encode(value, StandardCharsets.UTF_8.toString());
} catch (UnsupportedEncodingException ex) {
return value;
}
}
}