Skip to content

Commit

Permalink
impl contents count
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXiaoM committed Dec 5, 2023
1 parent 722f745 commit 6625050
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RemoteFilesWrapper(
val data = botWrapper.impl.getGroupRootFiles(id).data

val root = FolderWrapper(
this, null, "/", "/", 0, 0, 0,
this, null, "/", "/", 0, 0, 0, data.files.size
)
root.folders.addAll(data.folders.toMiraiFolders(this))
root.files.addAll(data.files.toMiraiFiles(this))
Expand All @@ -41,6 +41,7 @@ class FolderWrapper(
override val lastModifiedTime: Long,
override val uploadTime: Long,
override val uploaderId: Long,
override var contentsCount: Int,
) : AbsoluteFolder {
val folders: MutableList<FolderWrapper> = mutableListOf()
val files: MutableList<FileWrapper> = mutableListOf()
Expand Down Expand Up @@ -78,9 +79,6 @@ class FolderWrapper(
TODO("Not yet implemented")
}

override val contentsCount: Int
get() = TODO("Not yet implemented")

override suspend fun children(): Flow<AbsoluteFileFolder> {
TODO("Not yet implemented")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fun List<GroupFilesResp.Files>.toMiraiFiles(group: GroupWrapper, parent: FolderW
fun List<GroupFilesResp.Folders>.toMiraiFolders(group: GroupWrapper, parent: FolderWrapper? = null): List<FolderWrapper> {
return map {
FolderWrapper(group, parent,
it.folderId, it.folderName, it.createTime, it.createTime, it.creator
it.folderId, it.folderName, it.createTime, it.createTime, it.creator, it.totalFileCount
)
}
}

0 comments on commit 6625050

Please sign in to comment.