mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-06-05 21:09:11 +02:00
Some fixes
This commit is contained in:
@ -91,12 +91,14 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
Token token = new RetrofitPeertubeAPI(MainActivity.this).manageToken(oauthParams);
|
Token token = new RetrofitPeertubeAPI(MainActivity.this).manageToken(oauthParams);
|
||||||
if (token == null) {
|
if( token == null) {
|
||||||
|
runOnUiThread(() -> {
|
||||||
Helper.logoutCurrentUser(MainActivity.this, account);
|
Helper.logoutCurrentUser(MainActivity.this, account);
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UserMe userMe = new RetrofitPeertubeAPI(MainActivity.this, instance, token.getAccess_token()).verifyCredentials();
|
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());
|
new AccountDAO(MainActivity.this.getApplicationContext(), db).updateAccount(userMe.getAccount());
|
||||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||||
editor.putString(Helper.PREF_KEY_ID, account.getId());
|
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);
|
final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(PeertubeActivity.this, android.R.layout.select_dialog_item);
|
||||||
for (File file : peertube.getFiles()) {
|
for (File file : peertube.getFiles()) {
|
||||||
if (file.getResolutions() != null) {
|
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());
|
builderSingle.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
|
||||||
@ -996,6 +998,7 @@ public class PeertubeActivity extends AppCompatActivity implements CommentListAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initResolution() {
|
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);
|
PlayerControlView controlView = playerView.findViewById(R.id.exo_controller);
|
||||||
resolution = controlView.findViewById(R.id.resolution);
|
resolution = controlView.findViewById(R.id.resolution);
|
||||||
resolution.setText(String.format("%s", peertube.getFiles().get(0).getResolutions().getLabel()));
|
resolution.setText(String.format("%s", peertube.getFiles().get(0).getResolutions().getLabel()));
|
||||||
|
Reference in New Issue
Block a user