[Android] Fix trigger for MRL table

Geoffrey Métais git at videolan.org
Thu Mar 5 11:27:44 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Mar  5 11:27:06 2015 +0100| [a9cb2eb4218d3d5d3e0aeca3e8b56fb665705c64] | committer: Geoffrey Métais

Fix trigger for MRL table

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=a9cb2eb4218d3d5d3e0aeca3e8b56fb665705c64
---

 vlc-android/src/org/videolan/vlc/MediaDatabase.java |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaDatabase.java b/vlc-android/src/org/videolan/vlc/MediaDatabase.java
index eb50962..06f2ef5 100644
--- a/vlc-android/src/org/videolan/vlc/MediaDatabase.java
+++ b/vlc-android/src/org/videolan/vlc/MediaDatabase.java
@@ -234,7 +234,8 @@ public class MediaDatabase {
                     MRL_URI + " TEXT PRIMARY KEY NOT NULL,"+
                     MRL_DATE + " DATETIME NOT NULL"
                     +");";
-            createMrlTableQuery += " CREATE TRIGGER mrl_history_trigger AFTER INSERT ON "+
+            db.execSQL(createMrlTableQuery);
+            createMrlTableQuery = " CREATE TRIGGER mrl_history_trigger AFTER INSERT ON "+
                     MRL_TABLE_NAME+ " BEGIN "+
                     " DELETE FROM "+MRL_TABLE_NAME+" where "+MRL_URI+" NOT IN (SELECT "+MRL_URI+
                     " from "+MRL_TABLE_NAME+" ORDER BY insertion_date DESC LIMIT "+MRL_TABLE_SIZE+");"+
@@ -310,6 +311,9 @@ public class MediaDatabase {
                 case 13:
                     createNetworkFavTableQuery(db);
                     break;
+                    case 17:
+                        dropMRLTableQuery(db);
+                        createMRLTableQuery(db);
                 default:
                     break;
                 }



More information about the Android mailing list