]> granicus.if.org Git - handbrake/commitdiff
MacGui: serialize the queue item status to disk.
authorDamiano Galassi <damiog@gmail.com>
Tue, 12 Feb 2019 08:28:09 +0000 (09:28 +0100)
committerDamiano Galassi <damiog@gmail.com>
Tue, 12 Feb 2019 08:28:09 +0000 (09:28 +0100)
macosx/HBQueueItem.m

index 3e993281f6e39b6530d6bc5a5af7df0ef9e9e1b9..9a24385a25b5fe32bba379a682ec1bd35aa0a932 100644 (file)
@@ -78,6 +78,7 @@ static NSString *versionKey = @"HBQueueItemVersion";
 - (void)encodeWithCoder:(nonnull NSCoder *)coder
 {
     [coder encodeInt:1 forKey:versionKey];
+    encodeInt(_state);
     encodeObject(_job);
     encodeObject(_uuid);
 }
@@ -88,6 +89,11 @@ static NSString *versionKey = @"HBQueueItemVersion";
 
     if (version == 1 && (self = [super init]))
     {
+        decodeInt(_state);
+        if (_state > HBQueueItemStateFailed)
+        {
+            goto fail;
+        }
         decodeObjectOrFail(_job, HBJob);
         decodeObjectOrFail(_uuid, NSString);
         return self;