Skip to content

Commit

Permalink
chore: Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
tevincent committed Nov 15, 2024
1 parent a25602d commit 26d3e0a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ interface File {
val receivedSizeInBytes: Long
val path: String?
val thumbnailPath: String?
val parent: File?
val children: List<File>

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,6 @@ data class FileUi(
localPath = null,
)

// Init for folder
@OptIn(ExperimentalUuidApi::class)
constructor(folderName: String) : this(
uid = Uuid.random().toString(),
fileName = folderName,
isFolder = true,
fileSize = 0L,
mimeType = null,
localPath = null,
)

constructor(uploadFile: UploadFile) : this(
uid = uploadFile.url,
fileName = uploadFile.url.substringAfterLast("/"),
isFolder = false,
fileSize = 0L,
mimeType = null,
localPath = uploadFile.url,
)

fun toUploadFileSession(): UploadFileSession {
return object : UploadFileSession {
override val name: String = fileName
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.infomaniak.multiplatform_swisstransfer.common.interfaces.upload.Uploa
import io.realm.kotlin.ext.realmListOf
import io.realm.kotlin.types.RealmList
import io.realm.kotlin.types.RealmObject
import io.realm.kotlin.types.annotations.Ignore
import io.realm.kotlin.types.annotations.PrimaryKey
import kotlinx.datetime.Clock
import kotlin.uuid.ExperimentalUuidApi
Expand All @@ -45,7 +46,8 @@ class FileDB() : File, RealmObject {
override var receivedSizeInBytes: Long = 0
override var path: String? = ""
override var thumbnailPath: String? = ""
override var parent: FileDB? = null
@Ignore
var parent: FileDB? = null
override var children: RealmList<FileDB> = realmListOf()

constructor(file: File) : this() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,5 @@ class FileApi : File {
@Transient
override var thumbnailPath: String? = null
@Transient
override var parent: File? = null
@Transient
override var children: List<File> = emptyList()
}

0 comments on commit 26d3e0a

Please sign in to comment.