Browse Source

Update for changes to Invercargill APIs

Billy Barrow 1 year ago
parent
commit
e0b4a61bbd
3 changed files with 5 additions and 5 deletions
  1. 2 2
      src/lib/Asset.vala
  2. 2 2
      src/lib/Builder.vala
  3. 1 1
      src/lib/Ppub.vala

+ 2 - 2
src/lib/Asset.vala

@@ -15,7 +15,7 @@ namespace Ppub {
                 return end_location - start_location;
             }
         }
-        public Collection<string> flags {get; set;}
+        public Vector<string> flags {get; set;}
 
         public Asset.from_string(string line) {
             var key_value = line.split(": ");
@@ -26,7 +26,7 @@ namespace Ppub {
             start_location = int.parse (data[1]);
             end_location = int.parse (data[2]);
 
-            flags = ate(data).skip(3).to_collection();
+            flags = ate(data).skip(3).to_vector();
         }
 
         public string to_string() {

+ 2 - 2
src/lib/Builder.vala

@@ -28,7 +28,7 @@ namespace Ppub {
                 asset.stream = stream;
 
                 // Exclude any gzip flags, as we will add that later if we are compressing the content
-                asset.flags = flags.where(f => f != "gzip").to_collection();
+                asset.flags = flags.where(f => f != "gzip").to_vector();
 
                 if(compression.compress) {
                     asset.flags.add("gzip");
@@ -52,7 +52,7 @@ namespace Ppub {
             stream.write(index_data);
 
             foreach (var asset in assets) {
-                if(asset.flags.contains("gzip")) {
+                if(asset.flags.any(f => f == "gzip")) {
                     var compressor = new ZlibCompressor(ZlibCompressorFormat.GZIP, 9);
                     var conv_stream = new ConverterInputStream(asset.stream, compressor);
                     stream.splice(conv_stream, OutputStreamSpliceFlags.CLOSE_SOURCE);

+ 1 - 1
src/lib/Ppub.vala

@@ -55,7 +55,7 @@ namespace Ppub {
             var stream = ppub_file.read();
             var asset_stream = new AssetStream(asset, stream, asset_offset + asset.start_location);
 
-            if(asset.flags.contains("gzip")) {
+            if(asset.flags.any(f => f == "gzip")) {
                 var converter = new ZlibDecompressor(GLib.ZlibCompressorFormat.GZIP);
                 return new ConverterInputStream(asset_stream, converter);
             }