How to stop Everything from showing leading zeros in time format

Discussion related to "Everything" 1.5 Alpha.
Post Reply
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

How to stop Everything from showing leading zeros in time format

Post by SuperDude »

I am (probably wrongly) using the following to prevent Everything from showing “hour” leading zeros whenever an audio or video file is selected in the Result List: duration_format=h:mm:ss

I have the Length column header included in my column headers group, and have the following file types properties indexed: *.avi;*.flac;*.flv;*.m4a;*.mkv;*.mp3;*.mp4;*.ogg;*.ts;*.wav;*.webm;*.wma

What I'd like to do is disable all leading zeros that are not needed:

1. For media files that are 1 to 59 seconds in length, show length as 0:01 → 0:59 instead of 0:00:1 → 0:00:59

2. For files that are 1:00 to 59:59, show these times without the “hour” leading zero (don't show as 0:01:00 → 0:59:59). Files that are longer than 1:00:00 (1 hour) or more are fine.

Thank you!
horst.epp
Posts: 1445
Joined: Fri Apr 04, 2014 3:24 pm

Re: How to stop Everything from showing leading zeros in time format

Post by horst.epp »

Removing leading zeros would no longer align the values in a column
and makes it impossible to sort according to such column.
therube
Posts: 4972
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to stop Everything from showing leading zeros in time format

Post by therube »

Part of what you see will depend on system (OS) settings.

Like I have Time set to hh:mm:ss tt, in which case causes "hour" videos to display as "01:30:25".
(I.e. a leading zero - even while "minute" videos show as "07:09" or "43:30").

Maybe if you set System Time to "h:mm tt" ?


Can you set an output format for the Length column (like you can with the Status bar)?


Length is right aligned (as it should be), so display shouldn't be an issue.
And I wouldn't think that sorting would be an issue either.
void
Developer
Posts: 16733
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to stop Everything from showing leading zeros in time format

Post by void »

The default duration_format is quite close to what you want.
Although, there is still a leading zero..

To set the default duration_format:
  • Copy and paste the following into your Everything search box:
    /duration_format=
  • Press ENTER in your Everything search box.
  • If successful, duration_format= is shown in the status bar for a few seconds.
If the duration is larger than or equal to one day, the following format is used:
d:hh:mm:ss

If the duration is larger than or equal to one hour, the following format is used:
hh:mm:ss

Otherwise, the following format is used:
mm:ss

Example output:
987:65:43:21
87:65:43:21
7:65:43:21
65:43:21
05:43:21
43:21
03:21
00:21
00:01



I think you are asking for an option to remove the first leading zero?

If the duration is larger than or equal to one day, the following format is used:
d:hh:mm:ss

If the duration is larger than or equal to one hour, the following format is used:
h:mm:ss

Otherwise, the following format is used:
m:ss

For example:
987:65:43:21
87:65:43:21
7:65:43:21
65:43:21
5:43:21 (instead of 05:43:21)
43:21
3:21 (instead of 03:21)
0:21 (instead of 00:21)
0:01 (instead of 00:01)



The duration format doesn't affect the sort order.
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

Re: How to stop Everything from showing leading zeros in time format

Post by SuperDude »

Thanks for the tips. It appears that Directory Opus also displays the same times (Length) as Everything. Both will sometimes display a video file's length (Duration in Directory Opus) with a leading zero, and sometimes not. For example, I have a video file that is 45:49 minutes long (no leading zero), while another video that is 8:21 minutes long is displayed as 08:21.

I have my Time Settings configured as follows: h:mm:ss tt → I don't know if this is relevant.

One last thing: How do I make Everything select the first file in a Result List automatically?

As always, thank you!
void
Developer
Posts: 16733
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to stop Everything from showing leading zeros in time format

Post by void »

I'll add options for more control over the formatting in the next alpha update.

I'll make another post here once this is ready for testing...


One last thing: How do I make Everything select the first file in a Result List automatically?
Everything doesn't have an option to do this.

Everything will select the first result when you focus the result list.
From the Search box, please press Arrow Down to focus the top result or ENTER to select the most run result.

Is there a reason you want the first result selected immediately?
void
Developer
Posts: 16733
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to stop Everything from showing leading zeros in time format

Post by void »

Everything 1.5.0.1327a adds the following ini settings:

duration_auto_format_days
duration_auto_format_hours
duration_auto_format_minutes

When duration_format is empty, Everything will use one of the above formats depending on the length of the duration.

If the duration is a day or longer, Everything will use the duration_auto_format_days format.
If the duration is an hour or longer, Everything will use the duration_auto_format_hours format.
Otherwise, Everything will use the duration_auto_format_minutes format.



To hide the leading zero:
  • Copy and paste the following into your Everything search box:
    /duration_format=
  • Press ENTER in your Everything search box.
  • If successful, duration_format= is shown in the status bar for a few seconds.
    ---
  • Copy and paste the following into your Everything search box:
    /duration_auto_format_hours=h:mm:ss
  • Press ENTER in your Everything search box.
  • If successful, duration_auto_format_hours=h:mm:ss is shown in the status bar for a few seconds.
    ---
  • Copy and paste the following into your Everything search box:
    /duration_auto_format_minutes=m:ss
  • Press ENTER in your Everything search box.
  • If successful, duration_auto_format_minutes=m:ss is shown in the status bar for a few seconds.


The default values are:
duration_format=
duration_auto_format_days=d:hh:mm:ss
duration_auto_format_hours=hh:mm:ss
duration_auto_format_minutes=mm:ss
SuperDude
Posts: 221
Joined: Thu Sep 25, 2014 7:57 pm

Re: How to stop Everything from showing leading zeros in time format

Post by SuperDude »

@void: Thank you for adding the leading zero remover feature!
Post Reply