string FilelistInfo::formatState(const DirectoryListingPtr& aList) noexcept { if (aList->getDownloadState() == DirectoryListing::STATE_DOWNLOADED) { return aList->isLoaded() ? "loaded" : "loading"; } return Serializer::serializeDownloadState(*aList.get()); }
json FilelistInfo::serializeState(const DirectoryListingPtr& aList) noexcept { if (aList->getDownloadState() == DirectoryListing::STATE_DOWNLOADED) { bool loading = !aList->getCurrentLocationInfo().directory || aList->getCurrentLocationInfo().directory->getLoading(); return { { "id", loading ? "loading" : "loaded" }, { "str", loading ? "Parsing data" : "Loaded" }, }; } return Serializer::serializeDownloadState(*aList.get()); }