mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-02-16 12:00:42 +01:00
Fix playlist
This commit is contained in:
parent
46cd597c0f
commit
3b02cfb367
@ -228,8 +228,9 @@ public class PeertubeActivity extends AppCompatActivity implements OnRetrievePee
|
|||||||
initFullscreenDialog();
|
initFullscreenDialog();
|
||||||
initFullscreenButton();
|
initFullscreenButton();
|
||||||
}
|
}
|
||||||
|
if( Helper.isLoggedIn(PeertubeActivity.this)) {
|
||||||
new ManagePlaylistsAsyncTask(PeertubeActivity.this, GET_PLAYLIST, null, null, null, PeertubeActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new ManagePlaylistsAsyncTask(PeertubeActivity.this, GET_PLAYLIST, null, null, null, PeertubeActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
|
}
|
||||||
|
|
||||||
new RetrievePeertubeSingleAsyncTask(PeertubeActivity.this, peertubeInstance, videoId, PeertubeActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
new RetrievePeertubeSingleAsyncTask(PeertubeActivity.this, peertubeInstance, videoId, PeertubeActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,9 @@ public class ManagePlaylistsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||||||
String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(contextReference.get()));
|
String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(contextReference.get()));
|
||||||
SQLiteDatabase db = Sqlite.getInstance(contextReference.get().getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
SQLiteDatabase db = Sqlite.getInstance(contextReference.get().getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||||
Account account = new AccountDAO(contextReference.get(), db).getUniqAccount(userId, instance);
|
Account account = new AccountDAO(contextReference.get(), db).getUniqAccount(userId, instance);
|
||||||
|
if( account == null) {
|
||||||
|
account = new AccountDAO(contextReference.get(), db).getUniqAccount(userId, Helper.getPeertubeUrl(instance));
|
||||||
|
}
|
||||||
if (account == null) {
|
if (account == null) {
|
||||||
statusCode = 403;
|
statusCode = 403;
|
||||||
apiResponse = new APIResponse();
|
apiResponse = new APIResponse();
|
||||||
|
@ -1472,7 +1472,6 @@ public class PeertubeAPI {
|
|||||||
List<String> ids = new ArrayList<>();
|
List<String> ids = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
String response = new HttpsConnection(context).get(getAbsoluteUrl("/users/me/video-playlists/videos-exist"), 60, params, prefKeyOauthTokenT);
|
String response = new HttpsConnection(context).get(getAbsoluteUrl("/users/me/video-playlists/videos-exist"), 60, params, prefKeyOauthTokenT);
|
||||||
|
|
||||||
JSONArray jsonArray = new JSONObject(response).getJSONArray(videoId);
|
JSONArray jsonArray = new JSONObject(response).getJSONArray(videoId);
|
||||||
try {
|
try {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -1509,6 +1508,7 @@ public class PeertubeAPI {
|
|||||||
playlists = parsePlaylists(context, new JSONObject(response).getJSONArray("data"));
|
playlists = parsePlaylists(context, new JSONObject(response).getJSONArray("data"));
|
||||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
} catch (HttpsConnection.HttpsConnectionException e) {
|
||||||
setError(e.getStatusCode(), e);
|
setError(e.getStatusCode(), e);
|
||||||
|
e.printStackTrace();
|
||||||
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException e) {
|
} catch (NoSuchAlgorithmException | IOException | KeyManagementException | JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user