Search in sources :

Example 1 with MediaPayload

use of org.wordpress.android.fluxc.store.MediaStore.MediaPayload in project WordPress-Android by wordpress-mobile.

the class MediaUploadService method dispatchUploadAction.

private void dispatchUploadAction(@NonNull final MediaModel media) {
    AppLog.i(AppLog.T.MEDIA, "Dispatching upload action for media with local id: " + media.getId() + " and path: " + media.getFilePath());
    media.setUploadState(UploadState.UPLOADING.name());
    mDispatcher.dispatch(MediaActionBuilder.newUpdateMediaAction(media));
    MediaPayload payload = new MediaPayload(mSite, media);
    mDispatcher.dispatch(MediaActionBuilder.newUploadMediaAction(payload));
}
Also used : MediaPayload(org.wordpress.android.fluxc.store.MediaStore.MediaPayload)

Example 2 with MediaPayload

use of org.wordpress.android.fluxc.store.MediaStore.MediaPayload in project WordPress-Android by wordpress-mobile.

the class MediaDeleteService method dispatchDeleteAction.

private void dispatchDeleteAction(@NonNull MediaModel media) {
    AppLog.v(T.MEDIA, "Deleting " + media.getTitle() + " (id=" + media.getMediaId() + ")");
    MediaPayload payload = new MediaPayload(mSite, media);
    mDispatcher.dispatch(MediaActionBuilder.newDeleteMediaAction(payload));
}
Also used : MediaPayload(org.wordpress.android.fluxc.store.MediaStore.MediaPayload)

Example 3 with MediaPayload

use of org.wordpress.android.fluxc.store.MediaStore.MediaPayload in project WordPress-Android by wordpress-mobile.

the class EditPostActivity method onMediaUploadCancelClicked.

@Override
public void onMediaUploadCancelClicked(String mediaId, boolean delete) {
    MediaModel media = new MediaModel();
    media.setMediaId(Long.valueOf(mediaId));
    MediaPayload payload = new MediaPayload(mSite, media);
    mDispatcher.dispatch(MediaActionBuilder.newCancelMediaUploadAction(payload));
}
Also used : MediaModel(org.wordpress.android.fluxc.model.MediaModel) MediaPayload(org.wordpress.android.fluxc.store.MediaStore.MediaPayload)

Example 4 with MediaPayload

use of org.wordpress.android.fluxc.store.MediaStore.MediaPayload in project WordPress-Android by wordpress-mobile.

the class EditPostActivity method updateMediaFileOnServer.

private void updateMediaFileOnServer(MediaFile mediaFile) {
    if (mediaFile == null) {
        return;
    }
    MediaPayload payload = new MediaPayload(mSite, FluxCUtils.mediaModelFromMediaFile(mediaFile));
    mDispatcher.dispatch(MediaActionBuilder.newPushMediaAction(payload));
}
Also used : MediaPayload(org.wordpress.android.fluxc.store.MediaStore.MediaPayload)

Example 5 with MediaPayload

use of org.wordpress.android.fluxc.store.MediaStore.MediaPayload in project WordPress-Android by wordpress-mobile.

the class MediaUploadService method dispatchCancelAction.

private void dispatchCancelAction(@NonNull final MediaModel media) {
    AppLog.i(AppLog.T.MEDIA, "Dispatching cancel upload action for media with local id: " + media.getId() + " and path: " + media.getFilePath());
    MediaPayload payload = new MediaPayload(mSite, mCurrentUpload);
    mDispatcher.dispatch(MediaActionBuilder.newCancelMediaUploadAction(payload));
}
Also used : MediaPayload(org.wordpress.android.fluxc.store.MediaStore.MediaPayload)

Aggregations

MediaPayload (org.wordpress.android.fluxc.store.MediaStore.MediaPayload)5 MediaModel (org.wordpress.android.fluxc.model.MediaModel)1