Fix single-volume archive Volume.FileName resolution

Agent-Logs-Url: https://github.com/adamhathcock/sharpcompress/sessions/afd8cfa5-472e-4624-bb56-1412aaa04e90

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-25 09:29:52 +00:00
committed by GitHub
parent 5185cbb765
commit 48ff579bc8
4 changed files with 24 additions and 38 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using SharpCompress.IO;
using SharpCompress.Readers;
@@ -42,7 +43,9 @@ public abstract partial class Volume : IVolume, IAsyncDisposable
public virtual int Index { get; internal set; }
public string? FileName => (_baseStream as FileStream)?.Name;
public string? FileName =>
(_baseStream as FileStream)?.Name
?? (_baseStream as SourceStream)?.Files.FirstOrDefault()?.FullName;
/// <summary>
/// RarArchive is part of a multi-part archive.

View File

@@ -286,9 +286,9 @@
"net10.0": {
"Microsoft.NET.ILLink.Tasks": {
"type": "Direct",
"requested": "[10.0.7, )",
"resolved": "10.0.7",
"contentHash": "AA/yhzFHNtQZXLdqjzujPy25G8EWwGWsAnxOE2zYSBoT/8QHP6ketN3CToD3DFreO653ipUwnKHo22B8AlBMCw=="
"requested": "[10.0.8, )",
"resolved": "10.0.8",
"contentHash": "dVbSXGIFNR5nZcv2tOLoWI+a9T4jtFd77IYjuND+QVe360qWgAF7H0WtoopYhRw/+SgpGUTyrkrh+65+ClNnfw=="
},
"Microsoft.NETFramework.ReferenceAssemblies": {
"type": "Direct",
@@ -388,9 +388,9 @@
"net8.0": {
"Microsoft.NET.ILLink.Tasks": {
"type": "Direct",
"requested": "[8.0.26, )",
"resolved": "8.0.26",
"contentHash": "o7/yVssM2r9Wyln2s9edBd5ANZXqdSdBI+g7JqXkyJmXrhs2WsJp25K5yPnYrTgdKBCjKB8bg+O2oew4sgzFaA=="
"requested": "[8.0.27, )",
"resolved": "8.0.27",
"contentHash": "rQi9TxifHRnXP7lVRZH05DxD2/XGbJp12q0ozcbrlBlBnyyzssFTH/2vLhtKWUp2CT1qVscTrcYTFiwTyKPKRg=="
},
"Microsoft.NETFramework.ReferenceAssemblies": {
"type": "Direct",