feat(backend): store download state in database instead of memory
Currently, IDM works with in-memory listing of items for waiting list and downloading list. We should store this state inside the database.
For this
- We should rely on a new table in database
- Every modification in memory should lead to database operation
- When requesting for list of item (waiting & download), the result should be fetched from Database and not only from memory
- For SSE, we should use a PostgreSQL functionality "Listen / Notify" to stream modification on items in waiting list: https://jdbc.postgresql.org/documentation/81/listennotify.html & https://github.com/jOOQ/jOOQ/issues/1847
Edited by Davin Kevin