Add doc for buildOCFilesFromShares

Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
alperozturk 2024-09-10 11:21:49 +02:00
parent 9a32ddb508
commit 60aa0a0b99
No known key found for this signature in database
GPG key ID: 4E577DC593B59BDF

View file

@ -16,11 +16,13 @@ object OCShareToOCFileConverter {
private const val MILLIS_PER_SECOND = 1000
/**
* Generates a list of incomplete [OCFile] from a list of [OCShare]
* Generates a list of incomplete [OCFile] from a list of [OCShare]. Retrieving OCFile directly by path may fail in cases like
* when a shared file is located at a/b/c/d/a.txt. To display a.txt in the shared tab, the device needs the OCFile.
* On first launch, the app may not be aware of the file until the exact path is accessed.
*
* This is actually pretty complex as we get one [OCShare] item for each shared instance for the same folder
* Server implementation needed to get file size, thumbnails e.g. : <a href="https://github.com/nextcloud/server/issues/4456g</a>.
*
* **THIS ONLY WORKS WITH FILES SHARED *BY* THE USER, NOT FOR SHARES *WITH* THE USER**
* Note: This works only for files shared *by* the user, not files shared *with* the user.
*/
@JvmStatic
fun buildOCFilesFromShares(shares: List<OCShare>): List<OCFile> {