Przeglądaj źródła

Reset eTag so that capability get parsed again, so status is set

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 4 lat temu
rodzic
commit
baa0de428f

+ 1 - 1
src/main/java/com/owncloud/android/db/ProviderMeta.java

@@ -35,7 +35,7 @@ import java.util.List;
  */
  */
 public class ProviderMeta {
 public class ProviderMeta {
     public static final String DB_NAME = "filelist";
     public static final String DB_NAME = "filelist";
-    public static final int DB_VERSION = 60;
+    public static final int DB_VERSION = 61;
 
 
     private ProviderMeta() {
     private ProviderMeta() {
         // No instance
         // No instance

+ 17 - 0
src/main/java/com/owncloud/android/providers/FileContentProvider.java

@@ -2288,6 +2288,23 @@ public class FileContentProvider extends ContentProvider {
             if (!upgraded) {
             if (!upgraded) {
                 Log_OC.i(SQL, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
                 Log_OC.i(SQL, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
             }
             }
+
+            if (oldVersion < 61 && newVersion >= 61) {
+                Log_OC.i(SQL, "Entering in the #61 reset eTag to force capability refresh");
+                db.beginTransaction();
+                try {
+                    db.execSQL("UPDATE capabilities SET etag = '' WHERE 1=1");
+
+                    upgraded = true;
+                    db.setTransactionSuccessful();
+                } finally {
+                    db.endTransaction();
+                }
+            }
+
+            if (!upgraded) {
+                Log_OC.i(SQL, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
+            }
         }
         }
     }
     }
 }
 }