use of org.storymaker.app.model.Job in project storymaker by StoryMaker.
the class PublisherBase method publishToStoryMaker.
public String publishToStoryMaker() {
Job job = getPreferredUploadJob();
Project project = mPublishJob.getProject();
String title = project.getTitle();
String desc = project.getDescription();
String mediaEmbed = getEmbed(job);
String[] categories = project.getCategories();
String medium = getMedium();
String mediaService = job.getSite();
// TODO get the id from the preferred job to publish to facebook
String mediaGuid = job.getResult();
try {
String ret = publishToStoryMaker(title, desc, mediaEmbed, categories, medium, mediaService, mediaGuid);
return ret;
} catch (IOException ioe) {
Timber.e(ioe, "failed to publish due to an IOException");
}
return null;
}
use of org.storymaker.app.model.Job in project storymaker by StoryMaker.
the class RenderWorker 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);
//// SQLiteDatabase db = (new StoryMakerDB(context)).getWritableDatabase("foo");
// Job job = (new JobTable(null)).getNextUnfinished(mContext, JobTable.TYPE_RENDER, publishJob, null);
// RendererBase renderer = null;
// if (job != null) {
// if (job.isSpec(VideoRenderer.SPEC_KEY)) {
// renderer = new VideoRenderer(mContext, this, job);
// } else if (job.isSpec(AudioRenderer.SPEC_KEY)) {
// renderer = new AudioRenderer(mContext, this, job);
// } //else if (job.isSpec(Auth.SITE_STORYMAKER)) {
// // renderer = new StoryMakerUploader(context, this, job);
// // }
// renderer.start();
// }
// TODO guard against multiple calls if we are running already
// Job job = (new JobTable(null)).getNextUnfinished(mContext, JobTable.TYPE_RENDER, publishJob, null);
// this should just just grab the new job, ignore old ones for now
// FIXME extend this to multiple render jobs, for now its hard coded to 1 at a time
ArrayList<Job> jobs = publishJob.getRenderJobsAsList();
if (jobs != null && jobs.size() > 0) {
Job job = jobs.get(0);
RendererBase renderer = null;
if (job != null) {
if (job.isSpec(VideoRenderer.SPEC_KEY)) {
renderer = new VideoRenderer(mContext, this, job);
} else if (job.isSpec(AudioRenderer.SPEC_KEY)) {
renderer = new AudioRenderer(mContext, this, job);
}
// FIXME need a slideshow renderer?
renderer.start();
}
} else {
jobFailed(null, null, 98129129, "No render job in db");
}
}
use of org.storymaker.app.model.Job in project storymaker by StoryMaker.
the class ArchivePublisher method startUpload.
public void startUpload() {
Timber.d("startUpload");
// FIXME hardcoded to youtube?
Job newJob = new Job(mContext, mPublishJob.getProjectId(), mPublishJob.getId(), JobTable.TYPE_UPLOAD, Auth.SITE_ARCHIVE, null);
mController.enqueueJob(newJob);
}
use of org.storymaker.app.model.Job in project storymaker by StoryMaker.
the class FacebookPublisher method startUpload.
public void startUpload() {
Timber.d("startUpload");
Job newJob = new Job(mContext, mPublishJob.getProjectId(), mPublishJob.getId(), JobTable.TYPE_UPLOAD, Auth.SITE_FACEBOOK, null);
mController.enqueueJob(newJob);
}
use of org.storymaker.app.model.Job in project storymaker by StoryMaker.
the class S3Publisher method startRender.
public void startRender() {
Timber.d("startRender");
// TODO should detect if user is directly publishing to youtube so we don't double publish to there
Job job = new Job(mContext, mPublishJob.getProjectId(), mPublishJob.getId(), JobTable.TYPE_RENDER, null, VideoRenderer.SPEC_KEY);
mController.enqueueJob(job);
}
Aggregations