Search in sources :

Example 1 with StoryMakerUploader

use of org.storymaker.app.publish.sites.StoryMakerUploader in project storymaker by StoryMaker.

the class UploadWorker method start.

public void start(PublishJob publishJob) {
    //		// TODO guard against multiple calls if we are running already
    ////		ArrayList<Job> jobs = (ArrayList<Job>) (new JobTable(db)).getUnfinishedAsList(context, JobTable.TYPE_UPLOAD);
    //		Job job = (new JobTable(null)).getNextUnfinished(mContext, JobTable.TYPE_UPLOAD, publishJob, null); // FIXME this is grabbing incomplete jobs from previous runs, we should only run the ones from our current publishJob
    //		UploaderBase uploader = null;
    //		if (job != null) {
    //    		if (job.isSite(Auth.SITE_YOUTUBE)) {
    //    			uploader = new YoutubeUploader(mContext, this, job);
    //    		} else if (job.isSite(Auth.SITE_STORYMAKER)) {
    //                uploader = new StoryMakerUploader(mContext, this, job);
    //            } else if (job.isSite(Auth.SITE_FACEBOOK)) {
    //                uploader = new FacebookUploader(mContext, this, job);
    //            } else if (job.isSite(Auth.SITE_FLICKR)) {
    //                uploader = new FlickrUploader(mContext, this, job);
    //            } else if (job.isSite(Auth.SITE_SOUNDCLOUD)) {
    //                uploader = new SoundCloudUploader(mContext, this, job);
    //            } else if (job.isSite(Auth.SITE_SSH)) {
    //                uploader = new SSHUploader(mContext, this, job);
    //            } else if (job.isSite(Auth.SITE_ARCHIVE)) {
    //                uploader = new ArchiveUploader(mContext, this, job);
    //            } 
    //    		uploader.start();
    //		}
    // TODO guard against multiple calls if we are running already
    // FIXME extend this to multiple render jobs, for now its hard coded to 1 at a time
    Job job = publishJob.getUploadJobsAsList().get(0);
    UploaderBase uploader = null;
    if (job != null) {
        if (job.isSite(Auth.SITE_YOUTUBE)) {
            uploader = new YoutubeUploader(mContext, this, job);
        } else if (job.isSite(Auth.SITE_STORYMAKER)) {
            uploader = new StoryMakerUploader(mContext, this, job);
        } else if (job.isSite(Auth.SITE_FACEBOOK)) {
            uploader = new FacebookUploader(mContext, this, job);
        } else if (job.isSite(Auth.SITE_FLICKR)) {
            uploader = new FlickrUploader(mContext, this, job);
        } else if (job.isSite(Auth.SITE_SOUNDCLOUD)) {
            uploader = new SoundCloudUploader(mContext, this, job);
        } else if (job.isSite(Auth.SITE_SSH)) {
            uploader = new SSHUploader(mContext, this, job);
        } else if (job.isSite(Auth.SITE_ARCHIVE)) {
            uploader = new ArchiveUploader(mContext, this, job);
        } else if (job.isSite(Auth.SITE_S3)) {
            uploader = new S3Uploader(mContext, this, job);
        }
        uploader.start();
    }
}
Also used : SSHUploader(org.storymaker.app.publish.sites.SSHUploader) YoutubeUploader(org.storymaker.app.publish.sites.YoutubeUploader) FacebookUploader(org.storymaker.app.publish.sites.FacebookUploader) SoundCloudUploader(org.storymaker.app.publish.sites.SoundCloudUploader) ArchiveUploader(org.storymaker.app.publish.sites.ArchiveUploader) S3Uploader(org.storymaker.app.publish.sites.S3Uploader) PublishJob(org.storymaker.app.model.PublishJob) Job(org.storymaker.app.model.Job) FlickrUploader(org.storymaker.app.publish.sites.FlickrUploader) StoryMakerUploader(org.storymaker.app.publish.sites.StoryMakerUploader)

Aggregations

Job (org.storymaker.app.model.Job)1 PublishJob (org.storymaker.app.model.PublishJob)1 ArchiveUploader (org.storymaker.app.publish.sites.ArchiveUploader)1 FacebookUploader (org.storymaker.app.publish.sites.FacebookUploader)1 FlickrUploader (org.storymaker.app.publish.sites.FlickrUploader)1 S3Uploader (org.storymaker.app.publish.sites.S3Uploader)1 SSHUploader (org.storymaker.app.publish.sites.SSHUploader)1 SoundCloudUploader (org.storymaker.app.publish.sites.SoundCloudUploader)1 StoryMakerUploader (org.storymaker.app.publish.sites.StoryMakerUploader)1 YoutubeUploader (org.storymaker.app.publish.sites.YoutubeUploader)1