mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ArchiveTools] Fix TorrentZip write
Apparently, only a very specific version of Zlib stuff will work for TZIP. This implementation is copied from RomVault for full compatibility.
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using OCRC;
|
||||
using Ionic.Crc;
|
||||
using Ionic.Zlib;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -137,20 +135,16 @@ namespace SabreTools.Helper
|
||||
/// </summary>
|
||||
/// <param name="zipstream">Stream representing the entry</param>
|
||||
/// <param name="filename">Internal filename to use</param>
|
||||
/// <param name="torrentZip">True if the file should be set with TorrentZip defaults (default), false otherwise</param>
|
||||
public ZipFileEntry(Stream zipstream, string filename, bool torrentZip = true)
|
||||
public ZipFileEntry(Stream zipstream, string filename)
|
||||
{
|
||||
_zip64 = false;
|
||||
_zipstream = zipstream;
|
||||
_generalPurposeBitFlag = GeneralPurposeBitFlag.DeflatingMaximumCompression;
|
||||
_compressionMethod = CompressionMethod.Deflated;
|
||||
FileName = filename;
|
||||
_lastModFileTime = 48128;
|
||||
_lastModFileDate = 8600;
|
||||
|
||||
if (torrentZip)
|
||||
{
|
||||
_lastModFileTime = 48128;
|
||||
_lastModFileDate = 8600;
|
||||
}
|
||||
FileName = filename;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user