Skip to content

Commit

Permalink
Remove dead hosting userscloud.com
Browse files Browse the repository at this point in the history
Add support of nested folders for mega.nz
  • Loading branch information
zenden2k committed Aug 11, 2024
1 parent 99916fc commit 55f69a1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 85 deletions.
Binary file removed Data/Favicons/userscloud.ico
Binary file not shown.
69 changes: 0 additions & 69 deletions Data/Scripts/userscloud.nut

This file was deleted.

5 changes: 0 additions & 5 deletions Data/servers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@
</Actions>
<Result DownloadUrlTemplate="stub"/>
</Server>
<Server Name="userscloud.com" FileHost="1" Plugin="userscloud" WebsiteUrl="https://userscloud.com" RegistrationUrl="https://userscloud.com/signup">
<Actions>
</Actions>
<Result ImageUrlTemplate="stub" ThumbUrlTemplate="stub" DownloadUrlTemplate="stub"/>
</Server>
<!-- Blocked by Roskomnadzor -->
<Server Name="catbox.moe" Authorize="1" FileHost="1" MaxFileSize="200000000" PasswordLabel="userhash" WebsiteUrl="https://catbox.moe/"
RegistrationUrl="https://catbox.moe/user/register.php">
Expand Down
38 changes: 27 additions & 11 deletions Source/Core/Upload/MegaNzUploadEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,34 @@ int CMegaNzUploadEngine::getFolderList(CFolderList& FolderList) {
}
folderList_ = &FolderList;
if (ensureNodesFetched()) {
FolderList.AddFolder("/", "", std::string("/"), "", 0);
MegaNode *root = megaApi_->getRootNode();
MegaNodeList *list = megaApi_->getChildren(root);

for (int i = 0; i < list->size(); i++) {
MegaNode *node = list->get(i);
if (node->isFolder()) {
FolderList.AddFolder(node->getName(), "", std::string("/")+node->getName(), "/", 0);
std::string parentId = FolderList.parentFolder().getId();

if (parentId.empty()) {
FolderList.AddFolder("/", "", std::string("/"), "", 0);
} else {
MegaNode* parent = megaApi_->getNodeByPath(parentId.c_str());
if (parent) {
MegaNodeList* list = megaApi_->getChildren(parent);

if (list) {
for (int i = 0; i < list->size(); i++) {
MegaNode* node = list->get(i);
if (node->isFolder()) {
std::string nodeId = parentId;

// nodeId cannot be empty at this line, so we can avoid checking for emptiness here.
if (nodeId.back() != '/') {
nodeId.append("/");
}
nodeId += node->getName();
FolderList.AddFolder(node->getName(), "", nodeId, parentId, 0);
}
}
}
delete list;
delete parent;
}
}
delete list;
delete root;
}

return fetchNodesSuccess_ ? 1 : 0;
Expand Down Expand Up @@ -605,4 +621,4 @@ void MyListener::onNodesUpdate(MegaApi* api, MegaNodeList *nodes)

//std::cout << "***** There are " << nodes->size() << " new or updated node/s in your account" << std::endl;
}
#endif
#endif

0 comments on commit 55f69a1

Please sign in to comment.