[x] The app should get the duration of audio files in queue / complete if it doesn't have any value yet (duration == -1)
📝 Summary
Usually, we call get duration when the user has drag/import files in. As we moved the logic to get file duration in the background thread, and there might be a chance that we didn't get the duration and update it in time before the user leaves the app.
I have changed the query for no duration files from "only query the files in prepare tab" => to be "query all the audio files that doesn't have duration yet"
🛑 Problems
There might still be slow if there are a lot of files to update the duration as it will get the duration of all files at once, and make 1 update to the database.
✅ DoD
📝 Summary
Usually, we call get duration when the user has drag/import files in. As we moved the logic to get file duration in the background thread, and there might be a chance that we didn't get the duration and update it in time before the user leaves the app.
I have changed the query for no duration files from "only query the files in prepare tab" => to be "query all the audio files that doesn't have duration yet"
🛑 Problems
There might still be slow if there are a lot of files to update the duration as it will get the duration of all files at once, and make 1 update to the database.