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

Improve sorting by popularity in tag selector #6

Open
mdrlzy opened this issue Apr 30, 2023 · 0 comments
Open

Improve sorting by popularity in tag selector #6

mdrlzy opened this issue Apr 30, 2023 · 0 comments

Comments

@mdrlzy
Copy link
Member

mdrlzy commented Apr 30, 2023

Right now, every time we change tags, we count their popularity by resources in TagsSelectorPresenter.
We can collect this statistics in StatsStorage and use it right away
But before that, we need to make sure that statistics are collected correctly.
For example, deleting a resource without our app. In this case, we need to reduce popularity of tags of this resource.

    private fun sortByPopularity(
        tagsOfSelectedResources: List<TagItem>,
        tagsOfUnselectedResources: List<TagItem>,
        tagItemsByResources: Map<ResourceId, Set<TagItem>>
    ) {
        val tagsOfSelectedResPopularity = Popularity
            .calculate(tagsOfSelectedResources)

        val tagsOfUnselectedResPopularity = Popularity
            .calculate(tagsOfUnselectedResources)

        val tagsPopularity = Popularity
            .calculate(tagItemsByResources.values.flatten())
@kirillt kirillt transferred this issue from ARK-Builders/ARK-Navigator Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant