- public void process(DownloadProgress progress) {
- if (clientListner != null) {
- // TODO
- clientListner.process(rowId, TaskKind.DOWNLOAD, TaskStatus.DOING, 0.0, "");
+ public void done(DownloadResult result) {
+ super.done(result);
+ synchronized (TaskManage.this) {
+ final ManageTarget<DownloadResult> mt = removeRequest(getRowId());
+ final RequestProcess request = mt.getRequest();
+ if (request.getConvertProfile().isConvert()) {
+ final DownloadProfile dp = request.getDownloadProfile();
+ final File video = (dp.getVideoProfile().isDownload()) ? result.getDownloadVideo() : dp.
+ getVideoProfile().getLocalFile();
+ final File comment = (dp.getCommentProfile().isDownload()) ? result.getDownloadComment() : dp.
+ getCommentProfile().getLocalFile();
+ final ConvertProfile cp = request.getConvertProfile();
+ final Convert task = new Convert(cp, video, comment, new ConvertListener(getRowId()));
+ final Future<ConvertResult> future = convertExecutorService.submit(task);
+ convertTargets.put(request.getRowId(), new ManageTarget<>(request, future));
+ }
+ // TODO 変換が必要なら変換キューに入れる