From ce2691872c7f07f3ae7504a25aea25c8f3eb4d77 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 17 Jun 2002 10:24:50 +0000 Subject: [PATCH] change the oderBy from the usual last update to ID no. for media. --- .../mircoders/storage/DatabaseContentToMedia.java | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/source/mircoders/storage/DatabaseContentToMedia.java b/source/mircoders/storage/DatabaseContentToMedia.java index 5807ea5b..82d4ed30 100755 --- a/source/mircoders/storage/DatabaseContentToMedia.java +++ b/source/mircoders/storage/DatabaseContentToMedia.java @@ -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) { -- 2.11.0