We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit abf065a2 authored by Mike Sheldon's avatar Mike Sheldon

URL Encode station names when tuning Libre Droid

Fix some indentation inconsistencies in Libre Droid
parent 49216b6f
......@@ -2,11 +2,13 @@ package fm.libre.droid;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.net.URI;
import java.net.URL;
import java.net.HttpURLConnection;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
......@@ -297,12 +299,12 @@ public class LibreService extends Service implements OnBufferingUpdateListener,
private class TuneStationTask extends AsyncTask<String,String,String> {
protected String doInBackground(String... params) {
String type = params[0];
String station = params[1];
String result = "";
String station;
try {
station = URLEncoder.encode(params[1], "UTF-8");
result = LibreService.this.httpGet("http://alpha.libre.fm/radio/adjust.php?session=" + LibreService.this.sessionKey + "&url=librefm://" + type + "/" + station);
} catch (Exception ex) {
Log.w("libredroid", "Unable to tune station: " + ex.getMessage());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment