From 789e8e432eeec8b46af04577a64bf53b941e0b66 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Thu, 16 Jun 2022 17:43:48 -0700 Subject: [PATCH] [Playlist Storage] Add another compatibility hook Add a compatibility getter/setter for URL, which was renamed to url, due to Core Storage having a requirement of all attributes starting with a lower case letter. Signed-off-by: Christopher Snowhill --- Playlist/PlaylistController.m | 2 +- Playlist/PlaylistEntry.h | 1 + Playlist/PlaylistEntry.m | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 030c0ac79..f75bd3d7a 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -1348,7 +1348,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc NSWorkspace *ws = [NSWorkspace sharedWorkspace]; - NSURL *url = [[self selectedObjects][0] URL]; + NSURL *url = [[self selectedObjects][0] url]; if([url isFileURL]) [ws selectFile:[url path] inFileViewerRootedAtPath:[url path]]; } diff --git a/Playlist/PlaylistEntry.h b/Playlist/PlaylistEntry.h index 68c17d090..259e08f61 100644 --- a/Playlist/PlaylistEntry.h +++ b/Playlist/PlaylistEntry.h @@ -64,6 +64,7 @@ @property(nonatomic) NSData *_Nullable albumArtInternal; @property(nonatomic) BOOL Unsigned; +@property(nonatomic) NSURL *URL; - (void)setMetadata:(NSDictionary *_Nonnull)metadata; diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index 6b1271fb6..3ae4a3c5c 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -471,6 +471,16 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) { self.unSigned = Unsigned; } +// More of the same +@dynamic URL; +- (NSURL *)URL { + return self.url; +} + +- (void)setURL:(NSURL *)URL { + self.url = URL; +} + - (void)setMetadata:(NSDictionary *)metadata { if(metadata == nil) { self.error = YES;