Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Code Explanations #1

@ashishkharcheiu

Description

@ashishkharcheiu

In addPendingUploads() method, you have added id as it which is the url of image like file://image/path

How does passing url of image path which is equal to it in id works inside AlbumImage?
I see both link and id has it and I am confused on how the code is working here.

Could you please explain the above query?

` fun addPendingUploads(albumId: String, urls: List, onAdded: (() -> Unit)?) {

    val newImages: List<AlbumImage> = urls.map {

        
        AlbumImage(
            id = it,
            datetime = (System.currentTimeMillis() / 1000).toInt(),
            link = it,
            albumId = albumId,
            queuedForUpload = true
        )

    }
    executors.diskIO().execute {
        Log.d(TAG, "addPendingUploads: inside executors.diskIO().execute")
        imageDao.insertAll(newImages)
        if (onAdded != null) {
            Log.d(TAG, "addPendingUploads: onAdded != null")
            onAdded()
        }
    }
    rateLimiter.reset(rateLimitKey(albumId))
}

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions