mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
21 lines
683 B
C#
21 lines
683 B
C#
using System.IO;
|
|
using System.IO.Compression;
|
|
using System.Threading.Tasks;
|
|
using Wabbajack.Common;
|
|
using Wabbajack.Paths;
|
|
using Wabbajack.Paths.IO;
|
|
|
|
namespace Wabbajack.App.Utilities
|
|
{
|
|
public class ModListUtilities
|
|
{
|
|
public static async Task<MemoryStream> GetModListImageStream(AbsolutePath modList)
|
|
{
|
|
await using var fs = modList.Open(FileMode.Open, FileAccess.Read, FileShare.Read);
|
|
using var ar = new ZipArchive(fs, ZipArchiveMode.Read);
|
|
var entry = ar.GetEntry("modlist-image.png");
|
|
await using var stream = entry!.Open();
|
|
return new MemoryStream(await stream.ReadAllAsync());
|
|
}
|
|
}
|
|
} |