Open PVince81 opened 6 years ago
at least two possible approaches:
For approach 2:
from what I see the fileid is available in the sync db:
phash|pathlen|path|inode|uid|gid|mode|modtime|type|md5|fileid|remotePerm|filesize|ignoredChildrenRemote|content
so it might just be a matter of:
1) check every parent folder for the sync db, file with format ._sync_$hash.db
and remember this as the sync root
2) compute the relative path based on sync root
3) open the DB file
4) select fileid from metadata where path='$relativePath'
=> $fileid
5) find the $baseUrl somewhere in main config ???
6) create private link based on known format: "$baseUrl/f/$fileid".
hmm or first go and read the configs in .local/share/data/ownCloud/owncloud.cfg
to find all sync configs and find the root path, which incidentally also contains the path to the sync DB.
ok, depending what the client devs say I might spend some spare time writing up a quick python script to do just that :-)
Use case:
Current flow:
dolphin .
Expected flow:
owncloud-cli show-private-link test.txt