This reduces some code duplication, and ensures that cur_entry.last_duration is always set.
Attach a file by drag & drop or click to upload