change the oderBy from the usual last update to ID no. for media.
authormh <mh>
Mon, 17 Jun 2002 10:24:50 +0000 (10:24 +0000)
committermh <mh>
Mon, 17 Jun 2002 10:24:50 +0000 (10:24 +0000)
source/mircoders/storage/DatabaseContentToMedia.java

index 5807ea5..82d4ed3 100755 (executable)
@@ -59,7 +59,10 @@ public class DatabaseContentToMedia extends Database implements StorageObject{
       String subselect = "id in (select media_id from " + theTable + " where content_id=" + id+")";
 
       try {
-        returnList = DatabaseMedia.getInstance().selectByWhereClause(subselect,-1);
+        // media should stay in uploaded order. this is especially important
+        // for photo stories which require a specific chronologic order.
+        // this is why we have the the second parameter "id"
+        returnList = DatabaseMedia.getInstance().selectByWhereClause(subselect,"id",-1);
       } catch (Exception e) {
         theLog.printDebugInfo("-- get media failed " + e.toString());
         throw new StorageObjectException("-- get media failed " + e.toString());
@@ -104,7 +107,10 @@ public class DatabaseContentToMedia extends Database implements StorageObject{
       String subselect = "id in (select media_id from " + theTable + " where content_id=" + id+")";
 
       try {
-        returnList = DatabaseAudio.getInstance().selectByWhereClause(subselect,-1);
+        // media should stay in uploaded order. this is especially important
+        // for photo stories which require a specific chronologic order.
+        // this is why we have the the second parameter "id"
+        returnList = DatabaseAudio.getInstance().selectByWhereClause(subselect,"id",-1);
       } catch (Exception e) {
         theLog.printDebugInfo("-- get audio failed " + e.toString());
         throw new StorageObjectException("-- get audio failed " + e.toString());
@@ -127,7 +133,10 @@ public class DatabaseContentToMedia extends Database implements StorageObject{
       String subselect = "id in (select media_id from " + theTable + " where content_id=" + id+")";
 
       try {
-        returnList = DatabaseVideo.getInstance().selectByWhereClause(subselect,-1);
+        // media should stay in uploaded order. this is especially important
+        // for photo stories which require a specific chronologic order.
+        // this is why we have the the second parameter "id"
+        returnList = DatabaseVideo.getInstance().selectByWhereClause(subselect,"id",-1);
       } catch (Exception e) {
         theLog.printDebugInfo("-- get video failed " + e.toString());
         throw new StorageObjectException("-- get video failed " + e.toString());
@@ -150,7 +159,10 @@ public class DatabaseContentToMedia extends Database implements StorageObject{
       String subselect = "id in (select media_id from " + theTable + " where content_id=" + id+")";
 
       try {
-        returnList = DatabaseImages.getInstance().selectByWhereClause(subselect,-1);
+        // media should stay in uploaded order. this is especially important
+        // for photo stories which require a specific chronologic order.
+        // this is why we have the the second parameter "id"
+        returnList = DatabaseImages.getInstance().selectByWhereClause(subselect,"id",-1);
       } catch (Exception e) {
         theLog.printDebugInfo("-- get images failed " + e.toString());
         throw new StorageObjectException("-- get images failed " + e.toString());
@@ -178,6 +190,9 @@ public class DatabaseContentToMedia extends Database implements StorageObject{
                                 " where content_id=" + id+")";
 
       try {
+        // media should stay in uploaded order. this is especially important
+        // for photo stories which require a specific chronologic order.
+        // this is why we have the the second parameter "id"
         returnList = DatabaseOther.getInstance().selectByWhereClause(subselect,
                                                                     "id");
       } catch (Exception e) {