ho-dev / HattrickOrganizer

Assistant for Hattrick online football manager
https://ho-dev.github.io/HattrickOrganizer/
GNU Lesser General Public License v3.0
190 stars 77 forks source link

[BUG] Opening the team analyzer takes longer than 20 sec #2055

Closed wsbrenk closed 1 month ago

wsbrenk commented 2 months ago

If I analyze this correctly, a lot of information is downloaded from hattrick as soon as I start the analyzer. Especially the loading of the logo of the selected team takes a very long time.

        // Column 1
        val infoLabel = JLabel()
        infoLabel.icon = ImageIcon(details["LogoURL"])
tychobrailleur commented 2 months ago

That's odd, I don't see the dramatic delay you're experiencing, even after deleting the db and starting afresh.

On a side note, the label you're pointing to is not used yet, so it can be removed. I can create a PR.

tychobrailleur commented 2 months ago

Ah looks like you beat me to it by the time I finished typing this ob my phone 😁

wsbrenk commented 2 months ago

@tychobrailleur it seems to be a special problem with my first team - the unused logo download takes the long time and doesn't return any logo at all.

wsbrenk commented 2 months ago

@tychobrailleur what do you think about storing the cached team details of opponent teams in the database and starting downloads only on explicite user actions which should not be the opening of the main panels? (in HO9, since i don't like to change database during beta phase...)

tychobrailleur commented 2 months ago

Yes, I think that's the right way to go. And agree with the HO9 target. I can work on this.

tychobrailleur commented 2 months ago

@tychobrailleur it seems to be a special problem with my first team - the unused logo download takes the long time and doesn't return any logo at all.

Ah that could be it, it probably hangs until the request times out!