clean seafile api

This commit is contained in:
shell committed 2026-07-21 22:49:56 +08:00
1 parent 3e4694ceb5
commit f0c5de374e
4 files changed
+30 -38

No files matched your search

+3 -4
View File
@@ -54,7 +54,6 @@ namespace seafile::fs
const auto authToken = api->auth(username, password);
if (authToken.has_value())
{
this->token = authToken.value().token;
if (const auto repo = api->defaultRepo(); repo.has_value())
{
this->repo_id = repo.value().repo_id.value_or("");
@@ -140,7 +139,7 @@ namespace seafile::fs
auto repo = api->repoInfo(repo_id);
if (!repo.has_value())
return STATUS_OBJECT_NAME_NOT_FOUND;
const auto ctx = new SeaFileContext{repo->id, path, SeaFileContext::Type::DIRECTORY, 0, ""};
const auto ctx = new SeaFileContext{repo->id, path, SeaFileContext::Type::DIRECTORY, 0};
*PFileContext = ctx;
SetFileInfo(FileInfo, FILE_ATTRIBUTE_DIRECTORY, repo->size, repo->mtime);
spdlog::info(std::format("open directory {} success", path));
@@ -150,7 +149,7 @@ namespace seafile::fs
if (const auto dirInfo = api->dirDetail(repo_id, path); dirInfo.has_value())
{
const auto& info = dirInfo.value();
const auto ctx = new SeaFileContext{info.repo_id, info.path, SeaFileContext::Type::DIRECTORY, 0, ""};
const auto ctx = new SeaFileContext{info.repo_id, info.path, SeaFileContext::Type::DIRECTORY, 0};
*PFileContext = ctx;
SetFileInfo(FileInfo,FILE_ATTRIBUTE_DIRECTORY, 0, 0);
spdlog::info(std::format("open directory {} success", path));
@@ -161,7 +160,7 @@ namespace seafile::fs
if (const auto fileInfo = api->fileDetail(repo_id, path); fileInfo.has_value())
{
const auto& info = fileInfo.value();
const auto ctx = new SeaFileContext(repo_id, path, SeaFileContext::Type::FILE, info.size, "");
const auto ctx = new SeaFileContext(repo_id, path, SeaFileContext::Type::FILE, info.size);
*PFileContext = ctx;
SetFileInfo(FileInfo,FILE_ATTRIBUTE_ARCHIVE, info.size, 0);
spdlog::info(std::format("open file {} success", path));