Skip to content

Commit a7c57d1

Browse files
authored
Feature: Added support for displaying total duration when selecting multiple video files (#15476)
1 parent b5c1816 commit a7c57d1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Files.App/ViewModels/Properties/Items/CombinedFileProperties.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ await LocationHelpers.GetAddressFromCoordinatesAsync((double?)list.Find(
5151
var props = queries.SelectMany(query => query!.First(section => section.Key == group.Key));
5252
foreach (FileProperty prop in group)
5353
{
54-
if (props.Where(x => x.Property == prop.Property).Any(x => !Equals(x.Value, prop.Value)))
54+
if (prop.Property == "System.Media.Duration")
55+
{
56+
ulong totalDuration = 0;
57+
props.Where(x => x.Property == prop.Property).ForEach(x => totalDuration += (ulong)x.Value);
58+
prop.Value = totalDuration;
59+
}
60+
else if (props.Where(x => x.Property == prop.Property).Any(x => !Equals(x.Value, prop.Value)))
5561
{
5662
// Has multiple values
5763
prop.Value = prop.IsReadOnly ? "MultipleValues".GetLocalizedResource() : null;

0 commit comments

Comments
 (0)