mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-02-16 12:00:42 +01:00
Some fixes
This commit is contained in:
parent
e08d9805f1
commit
4d53612adc
@ -91,12 +91,14 @@ public class MainActivity extends AppCompatActivity {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Token token = new RetrofitPeertubeAPI(MainActivity.this).manageToken(oauthParams);
|
||||
if (token == null) {
|
||||
Helper.logoutCurrentUser(MainActivity.this, account);
|
||||
if( token == null) {
|
||||
runOnUiThread(() -> {
|
||||
Helper.logoutCurrentUser(MainActivity.this, account);
|
||||
});
|
||||
return;
|
||||
}
|
||||
UserMe userMe = new RetrofitPeertubeAPI(MainActivity.this, instance, token.getAccess_token()).verifyCredentials();
|
||||
if (userMe != null && userMe.getAccount() != null) {
|
||||
if( userMe != null && userMe.getAccount() != null) {
|
||||
new AccountDAO(MainActivity.this.getApplicationContext(), db).updateAccount(userMe.getAccount());
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putString(Helper.PREF_KEY_ID, account.getId());
|
||||
|
@ -898,7 +898,9 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(PeertubeActivity.this, android.R.layout.select_dialog_item);
|
||||
for (File file : peertube.getFiles()) {
|
||||
if (file.getResolutions() != null) {
|
||||
arrayAdapter.add(file.getResolutions().getLabel() + "p");
|
||||
if( file.getResolutions().getLabel().compareTo("0p") != 0) {
|
||||
arrayAdapter.add(file.getResolutions().getLabel());
|
||||
}
|
||||
}
|
||||
}
|
||||
builderSingle.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||
@ -996,6 +998,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
||||
}
|
||||
|
||||
private void initResolution() {
|
||||
//TODO: add in settings a way to pick up the lower/medium/Highest resolution and init it there
|
||||
PlayerControlView controlView = playerView.findViewById(R.id.exo_controller);
|
||||
resolution = controlView.findViewById(R.id.resolution);
|
||||
resolution.setText(String.format("%s", peertube.getFiles().get(0).getResolutions().getLabel()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user