use of de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetUploadChangesResponse in project AntennaPod by AntennaPod.
the class NextcloudSyncService method uploadSubscriptionChanges.
@Override
public UploadChangesResponse uploadSubscriptionChanges(List<String> addedFeeds, List<String> removedFeeds) throws NextcloudSynchronizationServiceException {
try {
HttpUrl.Builder url = makeUrl("/index.php/apps/gpoddersync/subscription_change/create");
final JSONObject requestObject = new JSONObject();
requestObject.put("add", new JSONArray(addedFeeds));
requestObject.put("remove", new JSONArray(removedFeeds));
RequestBody requestBody = RequestBody.create(MediaType.get("application/json"), requestObject.toString());
performRequest(url, "POST", requestBody);
} catch (Exception e) {
e.printStackTrace();
throw new NextcloudSynchronizationServiceException(e);
}
return new GpodnetUploadChangesResponse(System.currentTimeMillis() / 1000, new HashMap<>());
}
use of de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetUploadChangesResponse in project AntennaPod by AntennaPod.
the class GpodnetService method uploadEpisodeActions.
/**
* Updates the episode actions
* <p/>
* This method requires authentication.
*
* @param episodeActions Collection of episode actions.
* @return a GpodnetUploadChangesResponse. See {@link GpodnetUploadChangesResponse}
* for details.
* @throws GpodnetServiceException if added or removed contain duplicates or if there
* is an authentication error.
*/
@Override
public UploadChangesResponse uploadEpisodeActions(List<EpisodeAction> episodeActions) throws SyncServiceException {
requireLoggedIn();
UploadChangesResponse response = null;
for (int i = 0; i < episodeActions.size(); i += UPLOAD_BULK_SIZE) {
response = uploadEpisodeActionsPartial(episodeActions, i, Math.min(episodeActions.size(), i + UPLOAD_BULK_SIZE));
}
return response;
}
Aggregations