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

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-11-06 15:33:59 +01:00
parent e51ac4876f
commit baa0de428f
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
2 changed files with 18 additions and 1 deletions

View file

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

View file

@ -2288,6 +2288,23 @@ public class FileContentProvider extends ContentProvider {
if (!upgraded) {
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));
}
}
}
}