Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] New API method for getting some assets stats #1073

Open
fortunado opened this issue Jan 12, 2024 · 1 comment
Open

[Feature request] New API method for getting some assets stats #1073

fortunado opened this issue Jan 12, 2024 · 1 comment

Comments

@fortunado
Copy link

Platforms

Android, iOS

Description

I'd like to have a new method of getting assets statistics:
getStatAsync(assetPath, assetType: [RequestType.image, RequestType.video]) - getting stat by assetPath, and assetType filter in api call

Example result:

[
	["2023.12.01 00:00:00Z", 65], // Month in year (just first date of month), and count of assets
	["2023.11.01 00:00:00Z", 100],
        [...]
]

Why

I need this for building lazy gridView with some kind of indexed draggable scrollbar (for example A-Z scrollbar panel in contacts list), when knowing current offset I calculate asset index and show a hint about day or month where in time current scroll position located in gallery.

For now I'm calculating this data by loading and processing all the assets by page, but for large galleries this is becoming very lagging and memory consuming.

Similar request #594 - but I need aggregation by months, or may be days.

Thanks in advance.

@HenrikH96
Copy link

I managed to "improve" performance slightly by sampling the album instead of fetching all AssetEntities directly. However, this approach is still far from optimal in terms of efficiency.

I've submitted a related feature request (#1244) that proposes a more efficient solution for grouping assets, which might be of interest for this use case. Feel free to check it out and share your thoughts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants