Skip to content
Merged
6 changes: 4 additions & 2 deletions src/Files.App/ViewModels/Properties/BaseProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ public abstract class BaseProperties
public async void GetOtherProperties(IStorageItemExtraProperties properties)
{
string dateAccessedProperty = "System.DateAccessed";
List<string> propertiesName = new List<string>();
propertiesName.Add(dateAccessedProperty);
List<string> propertiesName = new()
{
dateAccessedProperty
};
IDictionary<string, object> extraProperties = await properties.RetrievePropertiesAsync(propertiesName);

// Cannot get date and owner in MTP devices
Expand Down
11 changes: 10 additions & 1 deletion src/Files.App/ViewModels/Properties/FileProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ public async void GetSystemFileProperties()

list.Find(x => x.ID == "address").Value = await GetAddressFromCoordinatesAsync((double?)list.Find(x => x.Property == "System.GPS.LatitudeDecimal").Value,
(double?)list.Find(x => x.Property == "System.GPS.LongitudeDecimal").Value);
// Find Encoding Bitrate property and convert it to kbps
var encodingBitrate = list.Find(x => x.Property == "System.Audio.EncodingBitrate");
if (encodingBitrate is not null)
{
var sizes = new string[] { "Bps", "KBps", "MBps", "GBps" };
var order = (int)Math.Floor(Math.Log((uint)encodingBitrate.Value, 1024));
var readableSpeed = (uint)encodingBitrate.Value / Math.Pow(1024, order);
encodingBitrate.Value = $"{readableSpeed:0.##} {sizes[order]}";
}

var query = list
.Where(fileProp => !(fileProp.Value is null && fileProp.IsReadOnly))
Expand Down Expand Up @@ -326,4 +335,4 @@ private async void ViewModel_PropertyChanged(object sender, System.ComponentMode
}
}

}
}