twlite / youtube-sr

A dead-simple youtube metadata scraper
https://npmjs.com/package/youtube-sr
MIT License
113 stars 16 forks source link

Fix Utils.durationString duration string generation bugs #33

Closed arnoldaz closed 2 years ago

arnoldaz commented 3 years ago

Utils.durationString method generates wrong duration string by skipping required zeroes (e.g. skipping 00 minutes part when there's more than 0 hours) and adding zero at the start of the string when it's not necessary (e.g. 02:30 instead of 2:30).

Wrong result examples:

  1. When data: {"days":0,"hours":3,"minutes":0,"seconds":59} Expected: 3:00:59, actual: 03:59.
  2. When data: {"days":0,"hours":0,"minutes":5,"seconds":0} Expected: 5:00, actual: 0:05.
  3. When data: {"days":0,"hours":0,"minutes":2,"seconds":48} Expected: 2:48, actual: 02:48.
twlite commented 2 years ago

Hello, sorry for being inactive. I will take a look at this soon.

arnoldaz commented 2 years ago

Hello, sorry for being inactive. I will take a look at this soon.

Bumping for attention. Can you take a look at this?

twlite commented 2 years ago

I will check this in few hours 👍