gargakshit / unpaprd

An audiobook 🎧 📔 app made using Flutter
GNU Affero General Public License v3.0
99 stars 25 forks source link

Error between a chapter finish and the beggining of a new one #5

Open costaalex opened 3 years ago

costaalex commented 3 years ago

When the chapter finishes and another one begins naturally, the app crushes because there is a division by 0 in the slider. Solved by adding 1 millisecond to the denominator so it doesn't start with 0:

components/player.dart file, row 402: value: position.inMilliseconds / duration.inMilliseconds, changed to value: position.inMilliseconds / (duration.inMilliseconds + 1),

costaalex commented 3 years ago

Actually the solution above doesn't solve the problem completely. Sometimes it crashes anyway when a new chapter begins