Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
  • Loading branch information
tobiasKaminsky committed Dec 2, 2022
1 parent bd38438 commit 6e6ea14
Show file tree
Hide file tree
Showing 11 changed files with 1,150 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"formatVersion": 1,
"database": {
"version": 66,
"identityHash": "97be4a2bf1d8d2a4db027a996a823010",
"identityHash": "be969fd72e75dd6116b4fa746bcf5b6a",
"entities": [
{
"tableName": "arbitrary_data",
Expand Down Expand Up @@ -408,7 +408,7 @@
},
{
"tableName": "filelist",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `filename` TEXT, `encrypted_filename` TEXT, `path` TEXT, `path_decrypted` TEXT, `parent` INTEGER, `created` INTEGER, `modified` INTEGER, `content_type` TEXT, `content_length` INTEGER, `media_path` TEXT, `file_owner` TEXT, `last_sync_date` INTEGER, `last_sync_date_for_data` INTEGER, `modified_at_last_sync_for_data` INTEGER, `etag` TEXT, `etag_on_server` TEXT, `share_by_link` INTEGER, `permissions` TEXT, `remote_id` TEXT, `update_thumbnail` INTEGER, `is_downloading` INTEGER, `favorite` INTEGER, `is_encrypted` INTEGER, `etag_in_conflict` TEXT, `shared_via_users` INTEGER, `mount_type` INTEGER, `has_preview` INTEGER, `unread_comments_count` INTEGER, `owner_id` TEXT, `owner_display_name` TEXT, `note` TEXT, `sharees` TEXT, `rich_workspace` TEXT, `metadata_size` TEXT, `locked` INTEGER, `lock_type` INTEGER, `lock_owner` TEXT, `lock_owner_display_name` TEXT, `lock_owner_editor` TEXT, `lock_timestamp` INTEGER, `lock_timeout` INTEGER, `lock_token` TEXT)",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `filename` TEXT, `encrypted_filename` TEXT, `path` TEXT, `path_decrypted` TEXT, `parent` INTEGER, `created` INTEGER, `modified` INTEGER, `content_type` TEXT, `content_length` INTEGER, `media_path` TEXT, `file_owner` TEXT, `last_sync_date` INTEGER, `last_sync_date_for_data` INTEGER, `modified_at_last_sync_for_data` INTEGER, `etag` TEXT, `etag_on_server` TEXT, `share_by_link` INTEGER, `permissions` TEXT, `remote_id` TEXT, `local_id` INTEGER, `update_thumbnail` INTEGER, `is_downloading` INTEGER, `favorite` INTEGER, `is_encrypted` INTEGER, `etag_in_conflict` TEXT, `shared_via_users` INTEGER, `mount_type` INTEGER, `has_preview` INTEGER, `unread_comments_count` INTEGER, `owner_id` TEXT, `owner_display_name` TEXT, `note` TEXT, `sharees` TEXT, `rich_workspace` TEXT, `metadata_size` TEXT, `locked` INTEGER, `lock_type` INTEGER, `lock_owner` TEXT, `lock_owner_display_name` TEXT, `lock_owner_editor` TEXT, `lock_timestamp` INTEGER, `lock_timeout` INTEGER, `lock_token` TEXT)",
"fields": [
{
"fieldPath": "id",
Expand Down Expand Up @@ -530,6 +530,12 @@
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localId",
"columnName": "local_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "updateThumbnail",
"columnName": "update_thumbnail",
Expand Down Expand Up @@ -1118,7 +1124,7 @@
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '97be4a2bf1d8d2a4db027a996a823010')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'be969fd72e75dd6116b4fa746bcf5b6a')"
]
}
}
1,130 changes: 1,130 additions & 0 deletions app/schemas/com.nextcloud.client.database.NextcloudDatabase/67.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import com.owncloud.android.db.ProviderMeta
],
version = ProviderMeta.DB_VERSION,
autoMigrations = [
AutoMigration(from = 65, to = 66)
AutoMigration(from = 65, to = 67)
],
exportSchema = true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ data class FileEntity(
val permissions: String?,
@ColumnInfo(name = ProviderTableMeta.FILE_REMOTE_ID)
val remoteId: String?,
@ColumnInfo(name = ProviderTableMeta.FILE_LOCAL_ID)
val localId: Long?,
@ColumnInfo(name = ProviderTableMeta.FILE_UPDATE_THUMBNAIL)
val updateThumbnail: Int?,
@ColumnInfo(name = ProviderTableMeta.FILE_IS_DOWNLOADING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ private ContentValues createContentValuesBase(OCFile fileOrFolder) {
cv.put(ProviderTableMeta.FILE_SHARED_WITH_SHAREE, fileOrFolder.isSharedWithSharee() ? 1 : 0);
cv.put(ProviderTableMeta.FILE_PERMISSIONS, fileOrFolder.getPermissions());
cv.put(ProviderTableMeta.FILE_REMOTE_ID, fileOrFolder.getRemoteId());
cv.put(ProviderTableMeta.FILE_LOCAL_ID, fileOrFolder.getLocalId());
cv.put(ProviderTableMeta.FILE_FAVORITE, fileOrFolder.isFavorite());
cv.put(ProviderTableMeta.FILE_UNREAD_COMMENTS_COUNT, fileOrFolder.getUnreadCommentsCount());
cv.put(ProviderTableMeta.FILE_OWNER_ID, fileOrFolder.getOwnerId());
Expand Down Expand Up @@ -994,6 +995,7 @@ private OCFile createFileInstance(Cursor cursor) {
ocFile.setSharedWithSharee(cursor.getInt(cursor.getColumnIndexOrThrow(ProviderTableMeta.FILE_SHARED_WITH_SHAREE)) == 1);
ocFile.setPermissions(cursor.getString(cursor.getColumnIndexOrThrow(ProviderTableMeta.FILE_PERMISSIONS)));
ocFile.setRemoteId(cursor.getString(cursor.getColumnIndexOrThrow(ProviderTableMeta.FILE_REMOTE_ID)));
ocFile.setLocalId(cursor.getLong(cursor.getColumnIndexOrThrow(ProviderTableMeta.FILE_LOCAL_ID)));
ocFile.setUpdateThumbnailNeeded(cursor.getInt(cursor.getColumnIndexOrThrow(ProviderTableMeta.FILE_UPDATE_THUMBNAIL)) == 1);
ocFile.setDownloading(cursor.getInt(cursor.getColumnIndexOrThrow(ProviderTableMeta.FILE_IS_DOWNLOADING)) == 1);
ocFile.setEtagInConflict(cursor.getString(cursor.getColumnIndexOrThrow(ProviderTableMeta.FILE_ETAG_IN_CONFLICT)));
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/owncloud/android/db/ProviderMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
public class ProviderMeta {
public static final String DB_NAME = "filelist";
public static final int DB_VERSION = 66;
public static final int DB_VERSION = 67;

private ProviderMeta() {
// No instance
Expand Down Expand Up @@ -149,6 +149,7 @@ static public class ProviderTableMeta implements BaseColumns {
FILE_SHARED_WITH_SHAREE,
FILE_PERMISSIONS,
FILE_REMOTE_ID,
FILE_LOCAL_ID,
FILE_UPDATE_THUMBNAIL,
FILE_IS_DOWNLOADING,
FILE_ETAG_IN_CONFLICT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ public void onMessageEvent(EncryptionEvent event) {
}
}

private void encryptFolder(String localId, String remoteId, String remotePath, boolean shouldBeEncrypted) {
private void encryptFolder(long localId, String remoteId, String remotePath, boolean shouldBeEncrypted) {
try {
User user = accountManager.getUser();
OwnCloudClient client = clientFactory.create(user);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public void streamMediaFile(OCFile file) {
fileActivity.showLoadingDialog(fileActivity.getString(R.string.wait_a_moment));
final User user = currentAccount.getUser();
new Thread(() -> {
StreamMediaFileOperation sfo = new StreamMediaFileOperation(file.getRemoteId());
StreamMediaFileOperation sfo = new StreamMediaFileOperation(file.getLocalId());
RemoteOperationResult result = sfo.execute(user, fileActivity);

fileActivity.dismissLoadingDialog();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ private void playVideo() {
playVideoUri(getFile().getStorageUri());
} else {
try {
new LoadStreamUrl(this, user, clientFactory).execute(getFile().getRemoteId());
new LoadStreamUrl(this, user, clientFactory).execute(getFile().getLocalId());
} catch (Exception e) {
Log_OC.e(TAG, "Loading stream url not possible: " + e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public static OCFile fillOCFile(RemoteFile remote) {
file.setEtag(remote.getEtag());
file.setPermissions(remote.getPermissions());
file.setRemoteId(remote.getRemoteId());
file.setLocalId(remote.getLocalId());
file.setFavorite(remote.isFavorite());
if (file.isFolder()) {
file.setEncrypted(remote.isEncrypted());
Expand Down
Empty file.

0 comments on commit 6e6ea14

Please sign in to comment.