From 392c6b39c15b85a12f29ee19131a3f1884a82b66 Mon Sep 17 00:00:00 2001 From: b123400 Date: Wed, 26 Oct 2022 15:06:32 +0900 Subject: [PATCH] Store bitrate as number --- Sonar/API Client/BRSonicAPISong.h | 2 +- Sonar/API Client/BRSonicAPISong.m | 2 +- Sonar/MediaDB/Song.h | 2 +- Sonar/Player/PlayerWindowController.m | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sonar/API Client/BRSonicAPISong.h b/Sonar/API Client/BRSonicAPISong.h index c14d190..445a97c 100644 --- a/Sonar/API Client/BRSonicAPISong.h +++ b/Sonar/API Client/BRSonicAPISong.h @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong) NSString *coverArt; @property (nonatomic, strong) NSString *contentType; @property (nonatomic, strong) NSString *suffix; -@property (nonatomic, strong) NSString *bitRate; +@property (nonatomic, assign) NSInteger bitRate; @property (nonatomic, strong) NSString *path; @property (nonatomic, strong) NSString *albumId; @property (nonatomic, strong) NSString *artistId; diff --git a/Sonar/API Client/BRSonicAPISong.m b/Sonar/API Client/BRSonicAPISong.m index e8e13ac..a7a57c8 100644 --- a/Sonar/API Client/BRSonicAPISong.m +++ b/Sonar/API Client/BRSonicAPISong.m @@ -21,7 +21,7 @@ self.coverArt = [[element attributeForName:@"coverArt"] stringValue]; self.contentType = [[element attributeForName:@"contentType"] stringValue]; self.suffix = [[element attributeForName:@"suffix"] stringValue]; - self.bitRate = [[element attributeForName:@"bitRate"] stringValue]; + self.bitRate = [[[element attributeForName:@"bitRate"] stringValue] integerValue]; self.path = [[element attributeForName:@"path"] stringValue]; self.albumId = [[element attributeForName:@"albumId"] stringValue]; self.artistId = [[element attributeForName:@"artistId"] stringValue]; diff --git a/Sonar/MediaDB/Song.h b/Sonar/MediaDB/Song.h index 1afe26d..0876064 100644 --- a/Sonar/MediaDB/Song.h +++ b/Sonar/MediaDB/Song.h @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong) NSURL *coverArtURL; @property (nonatomic, strong) NSString *contentType; @property (nonatomic, strong) NSString *suffix; -@property (nonatomic, strong) NSString *bitRate; +@property (nonatomic, assign) NSInteger bitRate; @property (nonatomic, strong) NSString *path; @property (nonatomic, strong) NSURL *streamURL; diff --git a/Sonar/Player/PlayerWindowController.m b/Sonar/Player/PlayerWindowController.m index cc57cd2..195296b 100644 --- a/Sonar/Player/PlayerWindowController.m +++ b/Sonar/Player/PlayerWindowController.m @@ -609,7 +609,7 @@ typedef enum : NSUInteger { } else if ([[tableColumn identifier] isEqualToString:@"artist"]) { return song.artist; } else if ([[tableColumn identifier] isEqualToString:@"bitRate"]) { - return song.bitRate; + return @(song.bitRate); } else if ([[tableColumn identifier] isEqualToString:@"contentType"]) { return song.contentType; } else if ([[tableColumn identifier] isEqualToString:@"starred"]) { -- 2.45.2