mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[FileTools, SimpleSort, ZipFile/Entry] TorrentZip works! Mostly!
Writing to torrentzip works but for some reason the compressed streams are not being generated at the correct size. This is odd and seems to only affect newly added files and not ones copied from other archives. Also, found some glaring flaws in the headered output that explains why I was having issues previously. Typos D=
This commit is contained in:
@@ -86,6 +86,10 @@ namespace SabreTools.Helper
|
||||
{
|
||||
return _entries[i].SHA1;
|
||||
}
|
||||
public bool Contains(string n)
|
||||
{
|
||||
return _entries.Contains(new ZipFileEntry(new MemoryStream(), n, true));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -658,6 +662,8 @@ namespace SabreTools.Helper
|
||||
torrentZip &= zfe.TorrentZip;
|
||||
}
|
||||
|
||||
_centerDirSize = (ulong)_zipstream.Position - _centerDirStart;
|
||||
|
||||
// Then get the central directory hash
|
||||
OptimizedCRC ocrc = new OptimizedCRC();
|
||||
byte[] buffer = new byte[_centerDirSize];
|
||||
@@ -674,7 +680,6 @@ namespace SabreTools.Helper
|
||||
_zipstream.Position = currentPosition;
|
||||
|
||||
// Now set more of the information
|
||||
_centerDirSize = (ulong)_zipstream.Position - _centerDirStart;
|
||||
_fileComment = (torrentZip ? Encoding.ASCII.GetBytes(("TORRENTZIPPED-" + calculatedCrc).ToCharArray()) : new byte[0]);
|
||||
_zipStatus = (torrentZip ? ZipStatus.TorrentZip : ZipStatus.None);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user