From ab92091f72f2aac9852d3ad91b5b91c03531e8b8 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 28 Sep 2025 02:44:52 +0100 Subject: [PATCH] Update ApplicationVersion to use GetInformationalVersion across multiple files --- Aaru.CommonTypes/Interop/Version.cs | 7 +++++++ Aaru.Core/Devices/Dumping/ATA.cs | 2 +- Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs | 12 +++++------- Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs | 2 +- Aaru.Core/Devices/Dumping/MiniDisc.cs | 2 +- .../Dumping/PlayStationPortable/MemoryStick.cs | 2 +- Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs | 2 +- Aaru.Core/Devices/Dumping/ResumeSupport.cs | 2 +- Aaru.Core/Devices/Dumping/SSC.cs | 12 +++++++----- Aaru.Core/Devices/Dumping/Sbc/Dump.cs | 2 +- Aaru.Core/Devices/Dumping/SecureDigital.cs | 2 +- Aaru.Core/Devices/Dumping/XGD.cs | 7 +++---- Aaru.Core/Statistics.cs | 2 +- Aaru.Devices/Remote/Remote.cs | 2 +- Aaru.Gui/ViewModels/Windows/ImageConvertViewModel.cs | 2 +- Aaru.Tests/Issues/OpticalImageConvertIssueTest.cs | 2 +- Aaru/Commands/Image/Convert.cs | 2 +- 17 files changed, 35 insertions(+), 29 deletions(-) diff --git a/Aaru.CommonTypes/Interop/Version.cs b/Aaru.CommonTypes/Interop/Version.cs index 12350bdd6..50fe2f62a 100644 --- a/Aaru.CommonTypes/Interop/Version.cs +++ b/Aaru.CommonTypes/Interop/Version.cs @@ -45,6 +45,13 @@ namespace Aaru.CommonTypes.Interop; /// Gets our own, or the runtime's version public static class Version { + /// Gets version string + /// Version + public static string GetInformationalVersion() => typeof(Version).Assembly + .GetCustomAttribute< + AssemblyInformationalVersionAttribute>() + ?.InformationalVersion.Split('+')[0]; + /// Gets version string /// Version public static string GetVersion() => typeof(Version).Assembly.GetName().Version?.ToString(); diff --git a/Aaru.Core/Devices/Dumping/ATA.cs b/Aaru.Core/Devices/Dumping/ATA.cs index b6e2f5f49..defe8eb85 100644 --- a/Aaru.Core/Devices/Dumping/ATA.cs +++ b/Aaru.Core/Devices/Dumping/ATA.cs @@ -686,7 +686,7 @@ public partial class Dump var metadata = new CommonTypes.Structs.ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion() + ApplicationVersion = Version.GetInformationalVersion() }; if(!outputFormat.SetImageInfo(metadata)) diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs index ce461f3c7..d2570ab8f 100644 --- a/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs +++ b/Aaru.Core/Devices/Dumping/CompactDisc/Dump.cs @@ -1079,9 +1079,8 @@ sealed partial class Dump foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub); if(_resume.NextBlock < blocks) - { - for(ulong i = _resume.NextBlock; i < blocks; i++) subchannelExtents.Add((int)i); - } + for(ulong i = _resume.NextBlock; i < blocks; i++) + subchannelExtents.Add((int)i); } if(_resume.NextBlock > 0) @@ -1496,9 +1495,8 @@ sealed partial class Dump supportsLongSectors); foreach(Tuple leadoutExtent in leadOutExtents.ToArray()) - { - for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) subchannelExtents.Remove((int)e); - } + for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) + subchannelExtents.Remove((int)e); if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel) { @@ -1568,7 +1566,7 @@ sealed partial class Dump var metadata = new CommonTypes.Structs.ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion() + ApplicationVersion = Version.GetInformationalVersion() }; if(!outputOptical.SetImageInfo(metadata)) diff --git a/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs b/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs index 5989b9408..e6dd64400 100644 --- a/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs +++ b/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs @@ -401,7 +401,7 @@ public partial class Dump var metadata = new CommonTypes.Structs.ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion() + ApplicationVersion = Version.GetInformationalVersion() }; if(!outputBai.SetImageInfo(metadata)) diff --git a/Aaru.Core/Devices/Dumping/MiniDisc.cs b/Aaru.Core/Devices/Dumping/MiniDisc.cs index 90f4704ec..4ebd66ebd 100644 --- a/Aaru.Core/Devices/Dumping/MiniDisc.cs +++ b/Aaru.Core/Devices/Dumping/MiniDisc.cs @@ -689,7 +689,7 @@ partial class Dump var metadata = new CommonTypes.Structs.ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion() + ApplicationVersion = Version.GetInformationalVersion() }; if(!outputFormat.SetImageInfo(metadata)) diff --git a/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs b/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs index e68fc7440..a82bdcc70 100644 --- a/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs +++ b/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs @@ -612,7 +612,7 @@ public partial class Dump var metadata = new CommonTypes.Structs.ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion() + ApplicationVersion = Version.GetInformationalVersion() }; if(!outputFormat.SetImageInfo(metadata)) diff --git a/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs b/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs index 9ab051480..57c24c612 100644 --- a/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs +++ b/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs @@ -627,7 +627,7 @@ public partial class Dump var metadata = new CommonTypes.Structs.ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion(), + ApplicationVersion = Version.GetInformationalVersion(), MediaPartNumber = mediaPartNumber }; diff --git a/Aaru.Core/Devices/Dumping/ResumeSupport.cs b/Aaru.Core/Devices/Dumping/ResumeSupport.cs index 187e32004..fcc2b6fe8 100644 --- a/Aaru.Core/Devices/Dumping/ResumeSupport.cs +++ b/Aaru.Core/Devices/Dumping/ResumeSupport.cs @@ -144,7 +144,7 @@ static class ResumeSupport if(oldTry.Software.Name != "Aaru" || oldTry.Software.OperatingSystem != platform.ToString() || - oldTry.Software.Version != Version.GetVersion()) + oldTry.Software.Version != Version.GetInformationalVersion()) continue; if(removable && diff --git a/Aaru.Core/Devices/Dumping/SSC.cs b/Aaru.Core/Devices/Dumping/SSC.cs index 1ae275ac1..207a80fc1 100644 --- a/Aaru.Core/Devices/Dumping/SSC.cs +++ b/Aaru.Core/Devices/Dumping/SSC.cs @@ -285,8 +285,9 @@ partial class Dump Modes.DecodedMode? decMode = null; if(!sense && !_dev.Error) - if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue) - decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType); + { + if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType); + } UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6); @@ -314,8 +315,9 @@ partial class Dump if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration); if(!sense && !_dev.Error) - if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue) - decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType); + { + if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType); + } // TODO: Check partitions page if(decMode.HasValue) @@ -1340,7 +1342,7 @@ partial class Dump var metadata = new CommonTypes.Structs.ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion() + ApplicationVersion = Version.GetInformationalVersion() }; if(!outputTape.SetImageInfo(metadata)) diff --git a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs index f3218ec6e..c0f33b4f3 100644 --- a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs +++ b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs @@ -1056,7 +1056,7 @@ partial class Dump var metadata = new CommonTypes.Structs.ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion() + ApplicationVersion = Version.GetInformationalVersion() }; if(!outputFormat.SetImageInfo(metadata)) diff --git a/Aaru.Core/Devices/Dumping/SecureDigital.cs b/Aaru.Core/Devices/Dumping/SecureDigital.cs index fad244bfe..22dee497d 100644 --- a/Aaru.Core/Devices/Dumping/SecureDigital.cs +++ b/Aaru.Core/Devices/Dumping/SecureDigital.cs @@ -864,7 +864,7 @@ public partial class Dump var metadata = new CommonTypes.Structs.ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion() + ApplicationVersion = Version.GetInformationalVersion() }; if(!outputFormat.SetImageInfo(metadata)) diff --git a/Aaru.Core/Devices/Dumping/XGD.cs b/Aaru.Core/Devices/Dumping/XGD.cs index 9a9cd9610..cea481dbc 100644 --- a/Aaru.Core/Devices/Dumping/XGD.cs +++ b/Aaru.Core/Devices/Dumping/XGD.cs @@ -1050,9 +1050,8 @@ partial class Dump List tmpList = []; foreach(ulong ur in _resume.BadBlocks) - { - for(ulong i = ur; i < ur + blocksToRead; i++) tmpList.Add(i); - } + for(ulong i = ur; i < ur + blocksToRead; i++) + tmpList.Add(i); tmpList.Sort(); @@ -1310,7 +1309,7 @@ partial class Dump var metadata = new CommonTypes.Structs.ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion() + ApplicationVersion = Version.GetInformationalVersion() }; if(!outputFormat.SetImageInfo(metadata)) diff --git a/Aaru.Core/Statistics.cs b/Aaru.Core/Statistics.cs index 5607ba26c..9f335b055 100644 --- a/Aaru.Core/Statistics.cs +++ b/Aaru.Core/Statistics.cs @@ -80,7 +80,7 @@ public static class Statistics ctx.Versions.Add(new Version { - Name = CommonTypes.Interop.Version.GetVersion(), + Name = CommonTypes.Interop.Version.GetInformationalVersion(), Synchronized = false, Count = 1 }); diff --git a/Aaru.Devices/Remote/Remote.cs b/Aaru.Devices/Remote/Remote.cs index a9a927c08..b36f65aba 100644 --- a/Aaru.Devices/Remote/Remote.cs +++ b/Aaru.Devices/Remote/Remote.cs @@ -166,7 +166,7 @@ public class Remote : IDisposable var clientHello = new AaruPacketHello { application = "Aaru", - version = Version.GetVersion(), + version = Version.GetInformationalVersion(), maxProtocol = Consts.MAX_PROTOCOL, sysname = DetectOS.GetPlatformName(DetectOS.GetRealPlatformID(), DetectOS.GetVersion()), release = DetectOS.GetVersion(), diff --git a/Aaru.Gui/ViewModels/Windows/ImageConvertViewModel.cs b/Aaru.Gui/ViewModels/Windows/ImageConvertViewModel.cs index a46e84c05..b426b35bc 100644 --- a/Aaru.Gui/ViewModels/Windows/ImageConvertViewModel.cs +++ b/Aaru.Gui/ViewModels/Windows/ImageConvertViewModel.cs @@ -545,7 +545,7 @@ public sealed partial class ImageConvertViewModel : ViewModelBase var metadata = new ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion(), + ApplicationVersion = Version.GetInformationalVersion(), Comments = CommentsText, Creator = CreatorText, DriveFirmwareRevision = DriveFirmwareRevisionText, diff --git a/Aaru.Tests/Issues/OpticalImageConvertIssueTest.cs b/Aaru.Tests/Issues/OpticalImageConvertIssueTest.cs index 03f4b3842..dc53f9bb9 100644 --- a/Aaru.Tests/Issues/OpticalImageConvertIssueTest.cs +++ b/Aaru.Tests/Issues/OpticalImageConvertIssueTest.cs @@ -92,7 +92,7 @@ public abstract class OpticalImageConvertIssueTest var metadata = new ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion(), + ApplicationVersion = Version.GetInformationalVersion(), Comments = inputFormat.Info.Comments, Creator = inputFormat.Info.Creator, DriveFirmwareRevision = inputFormat.Info.DriveFirmwareRevision, diff --git a/Aaru/Commands/Image/Convert.cs b/Aaru/Commands/Image/Convert.cs index 5a5abf9a6..da81e2129 100644 --- a/Aaru/Commands/Image/Convert.cs +++ b/Aaru/Commands/Image/Convert.cs @@ -567,7 +567,7 @@ sealed class ConvertImageCommand : Command var imageInfo = new ImageInfo { Application = "Aaru", - ApplicationVersion = Version.GetVersion(), + ApplicationVersion = Version.GetInformationalVersion(), Comments = settings.Comments ?? inputFormat.Info.Comments, Creator = settings.Creator ?? inputFormat.Info.Creator, DriveFirmwareRevision = settings.DriveFirmwareRevision ?? inputFormat.Info.DriveFirmwareRevision,