[Metadata] Fix assigning Unsigned property

The PlaylistEntry class needs a compatibility wrapper for the Unsigned
member, as it is assigned by all of the inputs. Case sensitivity and all
that is. And unfortunately, Core Data requires all model members to
start with a lower case letter.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
swiftingly
Christopher Snowhill 2022-06-16 17:05:52 -07:00
parent 72c4dddf18
commit c71021fc9b
2 changed files with 18 additions and 1 deletions

View File

@ -27,6 +27,7 @@
+ (NSSet *_Nonnull)keyPathsForValuesAffectingYearText;
+ (NSSet *_Nonnull)keyPathsForValuesAffectingCuesheetPresent;
+ (NSSet *_Nonnull)keyPathsForValuesAffectingGainCorrection;
+ (NSSet *_Nonnull)keyPathsForValuesAffectingUnsigned;
@property(nonatomic, readonly) NSString *_Nonnull display;
@property(nonatomic, retain, readonly) NSNumber *_Nonnull length;
@ -42,7 +43,7 @@
@property(nonatomic, readonly) NSString *_Nonnull yearText;
@property(nonatomic, readonly) NSString *_Nonnull title;
@property(nonatomic) NSString *_Nonnull title;
@property(nonatomic, readonly) NSString *_Nonnull trackText;
@ -62,6 +63,8 @@
@property(nonatomic) NSData *_Nullable albumArtInternal;
@property(nonatomic) BOOL Unsigned;
- (void)setMetadata:(NSDictionary *_Nonnull)metadata;
@end

View File

@ -99,6 +99,10 @@ extern NSMutableDictionary<NSString *, AlbumArtwork *> *__artworkDictionary;
return [NSSet setWithObjects:@"replayGainAlbumGain", @"replayGainAlbumPeak", @"replayGainTrackGain", @"replayGainTrackPeak", @"volume", nil];
}
+ (NSSet *)keyPathsForValuesAffectingUnsigned {
return [NSSet setWithObject:@"unSigned"];
}
- (NSString *)description {
return [NSString stringWithFormat:@"PlaylistEntry %lli:(%@)", self.index, self.url];
}
@ -457,6 +461,16 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
return nil;
}
// Gotta love that requirement of Core Data that everything starts with a lower case letter
@dynamic Unsigned;
- (BOOL)Unsigned {
return self.unSigned;
}
- (void)setUnsigned:(BOOL)Unsigned {
self.unSigned = Unsigned;
}
- (void)setMetadata:(NSDictionary *)metadata {
if(metadata == nil) {
self.error = YES;