Skip to content
This repository was archived by the owner on Dec 11, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/RemarkableFS.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ public function typeToIcon($type)
*/
protected function calcPath($id)
{
if (!isset($this->index[$id])) throw new \Exception("Unknown ID $id. Inconsitent meta data");
if($id == "trash")
return "";
Copy link

@ohad ohad Dec 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a proposed different fix. Later, change as follows:

         if ($item['Parent'] === '') {
             // top level item
             $item['Path'] = '/' . $item['VissibleName'];
+        } else {if ($item['Parent'] === 'trash') {
+           // trash item
+           $item['Path'] = 'trash/' . $item['VissibleName'];
         } else {
             // recursion
             $item['Path'] = $this->calcPath($item['Parent']) . '/' . $item['VissibleName'];
-        }
+        }}

This doesn't actually work (though it stops crashing on my machine), but the point is to return a sensible path rather than an empty path.
(Unless the empty path is actually correct --- I'm not an expert in this API, just proposing a slightly different way to do this.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, I just needed a solution that works and I thougt I'd share it if someone is interested 😊 I don't know either what's the right solution here 🤷‍♀️


if (!isset($this->index[$id]))
throw new \Exception("Unknown ID $id. Inconsitent meta data");

$item =& $this->index[$id];

// path already set?
Expand All @@ -178,4 +183,4 @@ protected function calcPath($id)

return $item['Path'];
}
}
}