mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 09:16:39 +00:00
improved zip file
This commit is contained in:
@@ -182,13 +182,18 @@ public static class ExtendedRouteTests
|
||||
Console.WriteLine($" - {path}");
|
||||
}
|
||||
|
||||
var pathParts = firstEntry.FullName.Split('/');
|
||||
if (pathParts.Length < 4)
|
||||
if (!firstEntry.FullName.StartsWith("tiles/"))
|
||||
{
|
||||
throw new Exception($"Expected directory structure like '18/158/91/tile_xxx.jpg' but got '{firstEntry.FullName}'");
|
||||
throw new Exception($"Expected path to start with 'tiles/' but got '{firstEntry.FullName}'");
|
||||
}
|
||||
|
||||
Console.WriteLine($" ✓ Directory structure preserved (zoom/{pathParts[0]}/x-bucket/{pathParts[1]}/y-bucket/{pathParts[2]}/file)");
|
||||
var pathParts = firstEntry.FullName.Split('/');
|
||||
if (pathParts.Length < 5)
|
||||
{
|
||||
throw new Exception($"Expected directory structure like 'tiles/18/158/91/tile_xxx.jpg' but got '{firstEntry.FullName}'");
|
||||
}
|
||||
|
||||
Console.WriteLine($" ✓ Directory structure preserved ({pathParts[0]}/zoom/{pathParts[1]}/x-bucket/{pathParts[2]}/y-bucket/{pathParts[3]}/file)");
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
|
||||
@@ -718,12 +718,13 @@ public class RouteProcessingService : BackgroundService
|
||||
|
||||
if (fullPath.StartsWith(normalizedBasePath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
entryName = fullPath.Substring(normalizedBasePath.Length + 1);
|
||||
entryName = entryName.Replace(Path.DirectorySeparatorChar, '/');
|
||||
var relativePath = fullPath.Substring(normalizedBasePath.Length + 1);
|
||||
relativePath = relativePath.Replace(Path.DirectorySeparatorChar, '/');
|
||||
entryName = "tiles/" + relativePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
entryName = Path.GetFileName(tile.FilePath);
|
||||
entryName = "tiles/" + Path.GetFileName(tile.FilePath);
|
||||
}
|
||||
|
||||
zipArchive.CreateEntryFromFile(tile.FilePath, entryName, CompressionLevel.Optimal);
|
||||
|
||||
Reference in New Issue
Block a user