From: Damiano Galassi Date: Tue, 12 Feb 2019 08:28:09 +0000 (+0100) Subject: MacGui: serialize the queue item status to disk. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b183dc8e884920228ca1e626a91cce0ea48a6297;p=handbrake MacGui: serialize the queue item status to disk. --- diff --git a/macosx/HBQueueItem.m b/macosx/HBQueueItem.m index 3e993281f..9a24385a2 100644 --- a/macosx/HBQueueItem.m +++ b/macosx/HBQueueItem.m @@ -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;