FutureMillennium / Screenshot-YouTube

Chrome extension: Take a screenshot of any YouTube video with one click.
https://chrome.google.com/webstore/detail/screenshot-youtube/gjoijpfmdhbjkkgnmahganhoinjjpohk
132 stars 28 forks source link

Timestamp format does not preserve order for long (> 1 hour) videos #28

Open pranavmarla opened 1 year ago

pranavmarla commented 1 year ago

Due to the way that timestamps are currently formatted in the screenshot names, the order of the screenshots is not preserved for videos greater than 1 hour.

For example, let's say I am watching a video called MyVideo, which is > 1 hour long. I take two screenshots:

Ideally, the screenshots should be named in such a way that screenshot A is sorted before screenshot B. However, the opposite happens -- the later screenshot (B) is sorted before the earlier screenshot (A). This is because the screenshots are named like this:

Since 1 < 5, Windows incorrectly sorts screenshot B first.

Instead, if a video is > 1 hour long, there should be an extra 0- at the start of the timestamp (for screenshots taken before the 1 hour mark) to ensure the order is preserved. In the above example, that means the new names would be:

Now, since 0 < 1, Windows would correctly sort screenshot A first.