HelloZeroNet / ZeroNet

ZeroNet - Decentralized websites using Bitcoin crypto and BitTorrent network
https://zeronet.io
Other
18.37k stars 2.27k forks source link

I have no idea how to repair sidebar function on one of my sites. #2531

Open styromaniac opened 4 years ago

styromaniac commented 4 years ago

I deleted

"inner_path": "content.json",

from content.json and now the sidebar doesn't work.

I already reversed the change, but it didn't unbreak the sidebar.

Internal error: TypeError('an integer is required (got type bytes)'): an integer is required (got type bytes) UiWebsocket.py line 79 > 235 > Sidebar/SidebarPlugin.py line 529 > 195 > ContentManager.py line 350 > 348 > ContentDbDict.py line 61 > 29 > ThreadPool.py line 32 > 49 > event.py line 268 > 296 > 286 > 266 > 211 > gevent/_tblib.py line 371 > ... > 202

styromaniac commented 4 years ago

I fixed this by publishing an older version of the site on another device, but if not for that, another solution would help the next person.

ghost commented 4 years ago
        size_filetypes = {}
        size_total = 0
        contents = site.content_manager.listContents()  # Without user files
        for inner_path in contents:
            content = site.content_manager.contents[inner_path]
        for relative_path in list(self.contents[inner_path].get("includes", {}).keys()):
            include_inner_path = content_inner_dir + relative_path
            back += self.listContents(include_inner_path)
        return back

It's not a bug, it is just the result of stupidity. :roll_eyes:

styromaniac commented 4 years ago
        size_filetypes = {}
        size_total = 0
        contents = site.content_manager.listContents()  # Without user files
        for inner_path in contents:
            content = site.content_manager.contents[inner_path]
        for relative_path in list(self.contents[inner_path].get("includes", {}).keys()):
            include_inner_path = content_inner_dir + relative_path
            back += self.listContents(include_inner_path)
        return back

It's not a bug, it is just the result of stupidity.

Not even that I can't undo the change from the same device but have to publish from a device with an older copy?

styromaniac commented 4 years ago

Maybe signing and publishing shouldn't be allowed if you screw up content.json