Commit 2f03005c authored by Elias Englmeier's avatar Elias Englmeier
Browse files

fixed a bug

parent 3f068ed1
......@@ -121,14 +121,6 @@ public class VideoConverter extends BaseBackgroundTaskExecutor {
logger.info("CREATED ENTRY: " + fileUrl);
VideosLocalServiceUtil.createNewVideoEntry(i.getPrimaryKey(), createdEntry.getPrimaryKey(), fileUrl, convertTo);
// String newIdeasVideoUrlEntry;
// if(i.getVideoUrl() != null && !i.getVideoUrl().equals("")){
// newIdeasVideoUrlEntry = i.getVideoUrl() + "," + fileUrl;
// }else{
// newIdeasVideoUrlEntry = fileUrl;
// }
// i.setVideoUrl(newIdeasVideoUrlEntry);
// i.persist();
logger.info("-------------------------------- Deleting temp files -----------------------------------");
tmpSourceFile.delete();
......
......@@ -162,10 +162,6 @@ public class IdeasLocalServiceImpl extends IdeasLocalServiceBaseImpl {
public void addVideoToExistingIdea(long ideasId, long videoId, String videoRef, ThemeDisplay themedisplay){
try {
Ideas i = IdeasUtil.findByPrimaryKey(ideasId);
// i.setVideoFileRef(videoId);
// //i.setVideoUrl(videoRef);
// i.persist();
VideosLocalServiceUtil.createNewVideoEntry(ideasId, videoId, videoRef, VideoExtensions.ORIGINAL.getVideoExtensionDescription());
startBackgroundVideoConversion(i,VideoExtensions.WEBM.getVideoExtensionDescription(), themedisplay);
......
......@@ -51,18 +51,21 @@ public class VideosLocalServiceImpl extends VideosLocalServiceBaseImpl {
try {
Videos v = this.getVideoUrlByIdeaRefAndExtension(ideasRef,extension);
DLAppLocalServiceUtil.deleteFileEntry(v.getFileRef());
VideosUtil.remove(v.getPrimaryKey());
if(v != null){
DLAppLocalServiceUtil.deleteFileEntry(v.getFileRef());
VideosUtil.remove(v.getPrimaryKey());
}
} catch (PortalException e) {
e.printStackTrace();
}
int nextDbId = (int)CounterLocalServiceUtil.increment(Videos.class.getName());
Videos nextPic = VideosLocalServiceUtil.createVideos(nextDbId);
nextPic.setIdeasRef(ideasRef);
nextPic.setExtension(extension);
nextPic.setFileRef(fileRef);
nextPic.setVideoUrl(videoUrl);
nextPic.persist();
return nextPic.getPrimaryKey();
Videos nextVideo = VideosLocalServiceUtil.createVideos(nextDbId);
nextVideo.setIdeasRef(ideasRef);
nextVideo.setExtension(extension);
nextVideo.setFileRef(fileRef);
nextVideo.setVideoUrl(videoUrl);
nextVideo.persist();
return nextVideo.getPrimaryKey();
}
public List<Videos> getAllVideosForIdeasRef(long ideasRef) throws NoSuchVideosException{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment