Tracks loading efficiency on album page
Steps to reproduce
For a album with hundreds of tracks, it takes quite a long time to call apis to load all of them, and the page becomes available only after we finished loading the tracks.
What happens?
when we visited library/albums/{album_id}
it takes about 1 seconds on my server to load the first page of tracks, then load the second page according to next
field of the previous response and so on
so if I have a album with 400 tracks, 50 tracks per page, then I have to wait for 8 seconds to see the track list become available
Also there is no significant difference in the time taken between loading 50 items per page and loading 400 items per page, both taking around 1 second
It takes about 900ms per page for a album of 357 tracks, 520ms for 142, 400ms for 99, and 220ms for 27 ones.
BTW, there is typo on next
field of API api/v1/tracks/
,
for example, it will be api/v1/tracks/?album=430&include_channels=true&ordering=disc_number%2Cposition&page=2&page_size=50
for the second page,
and api/v1/tracks/?album=430&album=430&include_channels=true&include_channels=true&ordering=disc_number%2Cposition&ordering=disc_number%2Cposition&page=3&page_size=50&page_size=50
for the third page
the larger the page number is, the longer the url is.
What is expected?
a better page loading efficiency is expected
Paginate can be finished on font-end, not backend
Context
Funkwhale version(s) affected: 1.3.1+git.cc7fde67