This commit is contained in:
Thomas 2020-09-04 15:58:49 +02:00
parent 9eacccf504
commit 0fcad881bf
2 changed files with 10 additions and 10 deletions

View File

@ -65,8 +65,8 @@ import static app.fedilab.fedilabtube.asynctasks.RetrievePeertubeInformationAsyn
public class AllPlaylistsActivity extends AppCompatActivity implements OnPlaylistActionInterface, OnRetrievePeertubeInterface { public class AllPlaylistsActivity extends AppCompatActivity implements OnPlaylistActionInterface, OnRetrievePeertubeInterface {
PlaylistAdapter playlistAdapter;
private AsyncTask<Void, Void, Void> asyncTask; private AsyncTask<Void, Void, Void> asyncTask;
private RelativeLayout mainLoader; private RelativeLayout mainLoader;
private RelativeLayout textviewNoAction; private RelativeLayout textviewNoAction;
private HashMap<Integer, String> privacyToSend; private HashMap<Integer, String> privacyToSend;
@ -74,7 +74,7 @@ public class AllPlaylistsActivity extends AppCompatActivity implements OnPlaylis
private Spinner set_upload_privacy; private Spinner set_upload_privacy;
private String idChannel; private String idChannel;
private List<Playlist> playlists; private List<Playlist> playlists;
PlaylistAdapter playlistAdapter;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);

View File

@ -66,6 +66,7 @@ import app.fedilab.fedilabtube.interfaces.OnDownloadInterface;
public class HttpsConnection { public class HttpsConnection {
private static final String LINE_FEED = "\r\n";
private HttpsURLConnection httpsURLConnection; private HttpsURLConnection httpsURLConnection;
private String since_id, max_id; private String since_id, max_id;
private Context context; private Context context;
@ -108,7 +109,6 @@ public class HttpsConnection {
} }
} }
/** /**
* Get calls * Get calls
* *
@ -193,7 +193,6 @@ public class HttpsConnection {
return response; return response;
} }
public String get(String urlConnection) throws IOException, NoSuchAlgorithmException, KeyManagementException, HttpsConnectionException { public String get(String urlConnection) throws IOException, NoSuchAlgorithmException, KeyManagementException, HttpsConnectionException {
@ -262,7 +261,7 @@ public class HttpsConnection {
Iterator<Map.Entry<String, String>> it = paramaters.entrySet().iterator(); Iterator<Map.Entry<String, String>> it = paramaters.entrySet().iterator();
while (it.hasNext()) { while (it.hasNext()) {
Map.Entry<String, String> pair = it.next(); Map.Entry<String, String> pair = it.next();
postData = addFormField(postData,pair.getKey(), pair.getValue(), boundary); postData = addFormField(postData, pair.getKey(), pair.getValue(), boundary);
it.remove(); it.remove();
} }
postData.append("--").append(boundary).append("--"); postData.append("--").append(boundary).append("--");
@ -303,15 +302,16 @@ public class HttpsConnection {
httpsURLConnection.getInputStream().close(); httpsURLConnection.getInputStream().close();
return response; return response;
} }
private static final String LINE_FEED = "\r\n";
/** /**
* Adds a form field to the request * Adds a form field to the request
*@param writer StringBuilder *
* @param name field name * @param writer StringBuilder
* @param value field value * @param name field name
* @param value field value
*/ */
private StringBuilder addFormField(StringBuilder writer, String name, String value, String boundary) { private StringBuilder addFormField(StringBuilder writer, String name, String value, String boundary) {
if( writer != null) { if (writer != null) {
writer.append("--").append(boundary).append(LINE_FEED); writer.append("--").append(boundary).append(LINE_FEED);
writer.append("Content-Disposition: form-data; name=\"").append(name).append("\"") writer.append("Content-Disposition: form-data; name=\"").append(name).append("\"")
.append(LINE_FEED); .append(LINE_FEED);