Parse and persist ServerCodecModeSupport attribute for hosts

This commit is contained in:
Cameron Gutman
2018-06-02 13:10:10 -07:00
parent 59506a2364
commit 2d2f71dcab
4 changed files with 9 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, retain) NSString *mac;
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *uuid;
@property (nonatomic) int serverCodecModeSupport;
@property (nonatomic, retain) NSMutableSet *appList;
- (id) initFromHost:(Host*)host;

View File

@@ -30,6 +30,7 @@
self.name = host.name;
self.uuid = host.uuid;
self.pairState = [host.pairState intValue];
self.serverCodecModeSupport = host.serverCodecModeSupport;
NSMutableSet *appList = [[NSMutableSet alloc] init];
@@ -61,6 +62,7 @@
}
parentHost.name = self.name;
parentHost.uuid = self.uuid;
parentHost.serverCodecModeSupport = self.serverCodecModeSupport;
parentHost.pairState = [NSNumber numberWithInt:self.pairState];
}

View File

@@ -14,6 +14,7 @@
<attribute name="mac" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="name" attributeType="String" syncable="YES"/>
<attribute name="pairState" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
<attribute name="serverCodecModeSupport" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES" syncable="YES"/>
<attribute name="uuid" optional="YES" attributeType="String" syncable="YES"/>
<relationship name="appList" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="App" inverseName="host" inverseEntity="App" syncable="YES"/>
</entity>

View File

@@ -39,6 +39,11 @@
} else {
host.pairState = PairStateUnknown;
}
NSString *serverCodecModeString = [self getStringTag:@"ServerCodecModeSupport"];
if (serverCodecModeString != nil) {
host.serverCodecModeSupport = [[serverCodecModeString trim] intValue];
}
}
@end