Closed cwilvx closed 2 years ago
I used os.scandir
to fetch tracks within that folder. Then those files are fetched from api.TRACKS
list and returned. The folders are processed in a similar manner. Read by the scandir function and tracks in the folders counted and then returned.
Instead of using multiprocessing, using the smarter useBisection
class to fetch them works wonders. Fetching 125 files takes 0.04s
... f*kn impressive.
Apparently, I've discovered that there might be an issue if track tags are updated using other apps.
If tags are changed, we don't have any way of knowing. So, you'll still be seeing the old tags in the app. To fix this, I think we should try fetching the tags on demand for the folder endpoints.
This might not uniform (same response time for every endpoint) but it can be made faster by using either
multiprocessing.Pool()
ormultithreading.ThreadPool()
. Tests are need to see which is faster.