[vlma-devel] commit: Fix a bug when editing a FilesChannel. (Adrien Grand )

git version control git at videolan.org
Fri Sep 12 22:57:20 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Thu Sep 11 20:38:15 2008 +0200| [3200291c01b1cfdaffa333ea0d4d3f0b89a810cc] | committer: Adrien Grand 

Fix a bug when editing a FilesChannel.

When editing the files to stream, files were added to the files list instead
of replacing the files list.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=3200291c01b1cfdaffa333ea0d4d3f0b89a810cc
---

 .../web/media/file/FileChannelEditController.java  |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/vlma-webapp/src/main/java/org/videolan/vlma/web/media/file/FileChannelEditController.java b/vlma-webapp/src/main/java/org/videolan/vlma/web/media/file/FileChannelEditController.java
index 18c6651..fbb7243 100644
--- a/vlma-webapp/src/main/java/org/videolan/vlma/web/media/file/FileChannelEditController.java
+++ b/vlma-webapp/src/main/java/org/videolan/vlma/web/media/file/FileChannelEditController.java
@@ -20,6 +20,9 @@
 
 package org.videolan.vlma.web.media.file;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -48,9 +51,11 @@ public class FileChannelEditController extends SimpleFormController {
         int id = ((FileChannelAdd)command).getId();
 
         FilesChannel filesChannel = (FilesChannel)data.getMedia(id);
+        List<String> files = new ArrayList<String>();
         for (String file : ((FileChannelAdd) command).getFiles().trim().split("\n")) {
-            filesChannel.getFiles().add(file);
+            files.add(file);
         }
+        filesChannel.setFiles(files);
         Integer serverId;
         try {
             serverId = Integer.valueOf(((FileChannelAdd) command).getServer());



More information about the vlma-devel mailing list