Fix upload
This commit is contained in:
parent
70903578d1
commit
b6769ca25f
|
@ -54,7 +54,7 @@ import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import app.fedilab.fedilabtube.client.APIResponse;
|
import app.fedilab.fedilabtube.client.APIResponse;
|
||||||
import app.fedilab.fedilabtube.client.data.AccountData.Account;
|
import app.fedilab.fedilabtube.client.data.ChannelData;
|
||||||
import app.fedilab.fedilabtube.helper.Helper;
|
import app.fedilab.fedilabtube.helper.Helper;
|
||||||
import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
|
import app.fedilab.fedilabtube.viewmodel.ChannelsVM;
|
||||||
import es.dmoral.toasty.Toasty;
|
import es.dmoral.toasty.Toasty;
|
||||||
|
@ -155,7 +155,7 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void manageVIewChannels(APIResponse apiResponse) {
|
public void manageVIewChannels(APIResponse apiResponse) {
|
||||||
if (apiResponse.getError() != null || apiResponse.getAccounts() == null || apiResponse.getAccounts().size() == 0) {
|
if (apiResponse.getError() != null || apiResponse.getChannels() == null || apiResponse.getChannels().size() == 0) {
|
||||||
if (apiResponse.getError() != null && apiResponse.getError().getError() != null)
|
if (apiResponse.getError() != null && apiResponse.getError().getError() != null)
|
||||||
Toasty.error(PeertubeUploadActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
Toasty.error(PeertubeUploadActivity.this, apiResponse.getError().getError(), Toast.LENGTH_LONG).show();
|
||||||
else
|
else
|
||||||
|
@ -164,14 +164,14 @@ public class PeertubeUploadActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Populate channels
|
//Populate channels
|
||||||
List<Account> accounts = apiResponse.getAccounts();
|
List<ChannelData.Channel> channelsForUser = apiResponse.getChannels();
|
||||||
String[] channelName = new String[accounts.size()];
|
String[] channelName = new String[channelsForUser.size()];
|
||||||
String[] channelId = new String[accounts.size()];
|
String[] channelId = new String[channelsForUser.size()];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Account account : accounts) {
|
for (ChannelData.Channel channel : channelsForUser) {
|
||||||
channels.put(account.getUsername(), account.getId());
|
channels.put(channel.getName(), channel.getId());
|
||||||
channelName[i] = account.getUsername();
|
channelName[i] = channel.getName();
|
||||||
channelId[i] = account.getId();
|
channelId[i] = channel.getId();
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue