// state orders for inexistent transcodings private void queueCreateTranscoding(TranscodingRow source) { for (OLATResource videoResource : olatresources) { if (!availableTranscodings.get(source.getResolution()).contains(videoResource)) { VideoMetadata videoMetadata = videoManager.readVideoMetadataFile(videoResource); if (videoMetadata != null && videoMetadata.getHeight() >= source.getResolution()) { videoManager.createTranscoding(videoResource, source.getResolution(), "mp4"); } } } }
private void loadTable() { // Hardcoded same as VideoAdminSetController int[] resolution = {2160, 1080, 720, 480, 360, 240}; // FIXME:FK fetch using one single SQL query for (int i = 0; i < resolution.length; i++) { int sizeOfTranscodings = availableTranscodings.get(resolution[i]).size(); int counter = 0; for (OLATResource videoResource : olatresources) { VideoMetadata videoMetadata = videoManager.readVideoMetadataFile(videoResource); if (videoMetadata != null && videoMetadata.getHeight() >= resolution[i]) counter++; } resolutions.add( new TranscodingRow( resolution[i], sizeOfTranscodings, counter, mayTranscode(resolution[i]))); } if (resolutions != null) tableModel.setObjects(resolutions); transcodingTable.reset(true, true, true); }