Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 0ba1b18

Browse files
authored
Merge pull request #138 from nnsnodnb/develop
Release 2.4.1
2 parents 7d51b78 + 7de61e1 commit 0ba1b18

File tree

10 files changed

+75
-69
lines changed

10 files changed

+75
-69
lines changed

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ github "RxSwiftCommunity/Action" "4.0.1"
77
github "SVProgressHUD/SVProgressHUD" "2.2.5"
88
github "SnapKit/SnapKit" "5.0.0"
99
github "ishkawa/APIKit" "5.0.0"
10-
github "kean/Nuke" "8.0"
10+
github "kean/Nuke" "8.0.1"
1111
github "kishikawakatsumi/KeychainAccess" "v3.2.0"
1212
github "nnsnodnb/Feeder" "1.0.0"
1313
github "noppefoxwolf/Swifter" "4a2c0db2ee21a798b0056e1bd97cc2da9e51792c"

Gemfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ GEM
88
thread_safe (~> 0.3, >= 0.3.4)
99
tzinfo (~> 1.1)
1010
atomos (0.1.3)
11-
claide (1.0.2)
12-
cocoapods (1.7.4)
11+
claide (1.0.3)
12+
cocoapods (1.7.5)
1313
activesupport (>= 4.0.2, < 5)
1414
claide (>= 1.0.2, < 2.0)
15-
cocoapods-core (= 1.7.4)
15+
cocoapods-core (= 1.7.5)
1616
cocoapods-deintegrate (>= 1.0.3, < 2.0)
1717
cocoapods-downloader (>= 1.2.2, < 2.0)
1818
cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -28,7 +28,7 @@ GEM
2828
nap (~> 1.0)
2929
ruby-macho (~> 1.4)
3030
xcodeproj (>= 1.10.0, < 2.0)
31-
cocoapods-core (1.7.4)
31+
cocoapods-core (1.7.5)
3232
activesupport (>= 4.0.2, < 6)
3333
fuzzy_match (~> 2.0.4)
3434
nap (~> 1.0)
@@ -59,7 +59,7 @@ GEM
5959
thread_safe (0.3.6)
6060
tzinfo (1.2.5)
6161
thread_safe (~> 0.1)
62-
xcodeproj (1.11.0)
62+
xcodeproj (1.12.0)
6363
CFPropertyList (>= 2.3.3, < 4.0)
6464
atomos (~> 0.1.3)
6565
claide (>= 1.0.2, < 2.0)

NowPlaying.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@
953953
);
954954
runOnlyForDeploymentPostprocessing = 0;
955955
shellPath = /bin/sh;
956-
shellScript = "if [ ! -e /usr/local/bin/license-plist ]; then\nexit 0\nfi\nif [ $CONFIGURATION = \"Debug\" ]; then\n${PODS_ROOT}/LicensePlist/license-plist --output-path ${SRCROOT}/${PRODUCT_NAME}/Resources/Settings.bundle --github-token \"${GITHUB_ACCESS_TOKEN}\" --config-path ${SRCROOT}/${PRODUCT_NAME}/Resources/license_plist.yml --prefix moe.nnsnodnb.NowPlaying\nfi\n";
956+
shellScript = "if [ ! -e /usr/local/bin/license-plist ]; then\nexit 0\nfi\nif [ $CONFIGURATION = \"Debug\" ]; then\n${PODS_ROOT}/LicensePlist/license-plist --output-path ${SRCROOT}/${PRODUCT_NAME}/Resources/Settings.bundle --github-token \"${GITHUB_ACCESS_TOKEN}\" --config-path ${SRCROOT}/${PRODUCT_NAME}/Resources/license_plist.yml --prefix moe.nnsnodnb.NowPlaying --force --suppress-opening-directory\nfi\n";
957957
};
958958
CF4D73D31F7A979400E72FBF /* Crashlytics */ = {
959959
isa = PBXShellScriptBuildPhase;

NowPlaying/Resources/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundlePackageType</key>
2222
<string>APPL</string>
2323
<key>CFBundleShortVersionString</key>
24-
<string>2.4.0</string>
24+
<string>2.4.1</string>
2525
<key>CFBundleURLTypes</key>
2626
<array>
2727
<dict>
@@ -42,7 +42,7 @@
4242
</dict>
4343
</array>
4444
<key>CFBundleVersion</key>
45-
<string>19</string>
45+
<string>20</string>
4646
<key>Fabric</key>
4747
<dict>
4848
<key>APIKey</key>

NowPlaying/Resources/Settings.bundle/Root.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</dict>
1515
<dict>
1616
<key>DefaultValue</key>
17-
<string>2.4.0</string>
17+
<string>2.4.1</string>
1818
<key>Key</key>
1919
<string>sbVersion</string>
2020
<key>Title</key>

Podfile.lock

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
11
PODS:
2-
- Crashlytics (3.13.3):
2+
- Crashlytics (3.13.4):
33
- Fabric (~> 1.10.2)
44
- DTTJailbreakDetection (0.4.0)
55
- Fabric (1.10.2)
6-
- Firebase/AdMob (6.4.0):
6+
- Firebase/AdMob (6.5.0):
77
- Firebase/CoreOnly
8-
- Google-Mobile-Ads-SDK (~> 7.46)
9-
- Firebase/Analytics (6.4.0):
8+
- Google-Mobile-Ads-SDK (~> 7.47)
9+
- Firebase/Analytics (6.5.0):
1010
- Firebase/Core
11-
- Firebase/Auth (6.4.0):
11+
- Firebase/Auth (6.5.0):
1212
- Firebase/CoreOnly
13-
- FirebaseAuth (~> 6.2.0)
14-
- Firebase/Core (6.4.0):
13+
- FirebaseAuth (~> 6.2.1)
14+
- Firebase/Core (6.5.0):
1515
- Firebase/CoreOnly
16-
- FirebaseAnalytics (= 6.0.3)
17-
- Firebase/CoreOnly (6.4.0):
18-
- FirebaseCore (= 6.0.4)
19-
- Firebase/Database (6.4.0):
16+
- FirebaseAnalytics (= 6.0.4)
17+
- Firebase/CoreOnly (6.5.0):
18+
- FirebaseCore (= 6.1.0)
19+
- Firebase/Database (6.5.0):
2020
- Firebase/CoreOnly
2121
- FirebaseDatabase (~> 6.0.0)
22-
- FirebaseAnalytics (6.0.3):
23-
- FirebaseCore (~> 6.0)
22+
- FirebaseAnalytics (6.0.4):
23+
- FirebaseCore (~> 6.1)
2424
- FirebaseInstanceID (~> 4.2)
25-
- GoogleAppMeasurement (= 6.0.3)
25+
- GoogleAppMeasurement (= 6.0.4)
2626
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
2727
- GoogleUtilities/MethodSwizzler (~> 6.0)
2828
- GoogleUtilities/Network (~> 6.0)
2929
- "GoogleUtilities/NSData+zlib (~> 6.0)"
3030
- nanopb (~> 0.3)
31-
- FirebaseAuth (6.2.0):
31+
- FirebaseAuth (6.2.1):
3232
- FirebaseAuthInterop (~> 1.0)
3333
- FirebaseCore (~> 6.0)
3434
- GoogleUtilities/AppDelegateSwizzler (~> 6.2)
3535
- GoogleUtilities/Environment (~> 6.2)
3636
- GTMSessionFetcher/Core (~> 1.1)
3737
- FirebaseAuthInterop (1.0.0)
38-
- FirebaseCore (6.0.4):
38+
- FirebaseCore (6.1.0):
3939
- GoogleUtilities/Environment (~> 6.0)
4040
- GoogleUtilities/Logger (~> 6.0)
4141
- FirebaseDatabase (6.0.0):
4242
- FirebaseAuthInterop (~> 1.0)
4343
- FirebaseCore (~> 6.0)
4444
- leveldb-library (~> 1.18)
45-
- FirebaseInstanceID (4.2.1):
45+
- FirebaseInstanceID (4.2.2):
4646
- FirebaseCore (~> 6.0)
4747
- GoogleUtilities/Environment (~> 6.0)
4848
- GoogleUtilities/UserDefaults (~> 6.0)
49-
- Google-Mobile-Ads-SDK (7.46.0):
49+
- Google-Mobile-Ads-SDK (7.48.0):
5050
- GoogleAppMeasurement (~> 6.0)
51-
- GoogleAppMeasurement (6.0.3):
51+
- GoogleAppMeasurement (6.0.4):
5252
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
5353
- GoogleUtilities/MethodSwizzler (~> 6.0)
5454
- GoogleUtilities/Network (~> 6.0)
5555
- "GoogleUtilities/NSData+zlib (~> 6.0)"
5656
- nanopb (~> 0.3)
57-
- GoogleUtilities/AppDelegateSwizzler (6.2.1):
57+
- GoogleUtilities/AppDelegateSwizzler (6.2.3):
5858
- GoogleUtilities/Environment
5959
- GoogleUtilities/Logger
6060
- GoogleUtilities/Network
61-
- GoogleUtilities/Environment (6.2.1)
62-
- GoogleUtilities/Logger (6.2.1):
61+
- GoogleUtilities/Environment (6.2.3)
62+
- GoogleUtilities/Logger (6.2.3):
6363
- GoogleUtilities/Environment
64-
- GoogleUtilities/MethodSwizzler (6.2.1):
64+
- GoogleUtilities/MethodSwizzler (6.2.3):
6565
- GoogleUtilities/Logger
66-
- GoogleUtilities/Network (6.2.1):
66+
- GoogleUtilities/Network (6.2.3):
6767
- GoogleUtilities/Logger
6868
- "GoogleUtilities/NSData+zlib"
6969
- GoogleUtilities/Reachability
70-
- "GoogleUtilities/NSData+zlib (6.2.1)"
71-
- GoogleUtilities/Reachability (6.2.1):
70+
- "GoogleUtilities/NSData+zlib (6.2.3)"
71+
- GoogleUtilities/Reachability (6.2.3):
7272
- GoogleUtilities/Logger
73-
- GoogleUtilities/UserDefaults (6.2.1):
73+
- GoogleUtilities/UserDefaults (6.2.3):
7474
- GoogleUtilities/Logger
7575
- GTMSessionFetcher/Core (1.2.2)
7676
- leveldb-library (1.20)
@@ -85,7 +85,7 @@ PODS:
8585
- R.swift.Library (~> 5.0.0)
8686
- R.swift.Library (5.0.1)
8787
- ScrollFlowLabel (1.0.0)
88-
- SwiftLint (0.33.1)
88+
- SwiftLint (0.34.0)
8989

9090
DEPENDENCIES:
9191
- Crashlytics
@@ -127,19 +127,19 @@ SPEC REPOS:
127127
- SwiftLint
128128

129129
SPEC CHECKSUMS:
130-
Crashlytics: 2aa08cd61fb1d62718c4e653169461d1d7377de2
130+
Crashlytics: 2dfd686bcb918dc10ee0e76f7f853fe42c7bd552
131131
DTTJailbreakDetection: 5e356c5badc17995f65a83ed9483f787a0057b71
132132
Fabric: 706c8b8098fff96c33c0db69cbf81f9c551d0d74
133-
Firebase: 9445469655a98e9010737f4bc4720e5bda465873
134-
FirebaseAnalytics: 69fe25866d2ec87c6f02d72c3c9a82bce9c065a0
135-
FirebaseAuth: 68cfa47997f53d29ce978e7a615fb78d7925fcbe
133+
Firebase: dedc9e48ea3f3649ad5f6b982f8a0c73508a14b5
134+
FirebaseAnalytics: 3fb375bc9d13779add4039716f868d233a473fad
135+
FirebaseAuth: a06ad63e9bf4c86165b54cceb1c14d4f4c38d419
136136
FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc
137-
FirebaseCore: 7ea99e200f0024262650be56623fbe6a7bef1707
137+
FirebaseCore: aecf02fb2274ec361b9bebeac112f5daa18273bd
138138
FirebaseDatabase: f48e067716864be2b855cf716b927ef375d6cfa0
139-
FirebaseInstanceID: 9782fcfb89e4d7da76cc28eac4b8543dc7be4a4b
140-
Google-Mobile-Ads-SDK: 4bff3a7d621555f2317813e495fecce745681f7e
141-
GoogleAppMeasurement: 1e45fa601e6280c180880d57010390f6679cd971
142-
GoogleUtilities: c7a0b08bda3bf808be823ed151f0e28ac6866e71
139+
FirebaseInstanceID: 662b8108a09fe9ed01aafdedba100fde8536b0f6
140+
Google-Mobile-Ads-SDK: 709fa768c3ba8e8b260d8cb085c607097fd3f79d
141+
GoogleAppMeasurement: 183bd916af7f80deb67c01888368f1108d641832
142+
GoogleUtilities: d2b0e277a95962e09bb27f5cd42f5f0b6a506c7d
143143
GTMSessionFetcher: 61bb0f61a4cb560030f1222021178008a5727a23
144144
leveldb-library: 08cba283675b7ed2d99629a4bc5fd052cd2bb6a5
145145
LicensePlist: e5f8f2e3465620e53ec4c669955a5a7d0692b9cb
@@ -148,8 +148,8 @@ SPEC CHECKSUMS:
148148
R.swift: f5a87643b91ea569d23d6afb3eee9c743edde239
149149
R.swift.Library: cfe85d569d9bae6cb262922db130e7c3a7a5fad1
150150
ScrollFlowLabel: 3c2aaff7030240745028425912a1c27aca53745d
151-
SwiftLint: 9fc1143bbacec37f94994a7d0d2a85b2154b6294
151+
SwiftLint: 79d48a17c6565dc286c37efb8322c7b450f95c67
152152

153153
PODFILE CHECKSUM: a67191c219c873dd98ef8ba5ad4da203c5e7174e
154154

155-
COCOAPODS: 1.7.4
155+
COCOAPODS: 1.7.5

TodayExtension/Base.lproj/MainInterface.storyboard

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DPH-Xa-Ygv">
2525
<rect key="frame" x="0.0" y="0.0" width="320" height="100"/>
2626
<subviews>
27-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TT0-Xe-wAb">
27+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TT0-Xe-wAb">
2828
<rect key="frame" x="16" y="8" width="84" height="84"/>
2929
<constraints>
3030
<constraint firstAttribute="height" constant="84" id="4tN-Xi-Tei"/>
@@ -44,7 +44,7 @@
4444
<userDefinedRuntimeAttribute type="boolean" keyPath="imageView.layer.masksToBounds" value="YES"/>
4545
</userDefinedRuntimeAttributes>
4646
</button>
47-
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="OnT-iE-X21">
47+
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="OnT-iE-X21">
4848
<rect key="frame" x="116" y="23" width="188" height="54"/>
4949
<subviews>
5050
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iEL-ba-EiL" customClass="ScrollFlowLabel" customModule="ScrollFlowLabel">
@@ -62,9 +62,6 @@
6262
</constraints>
6363
</view>
6464
</subviews>
65-
<constraints>
66-
<constraint firstAttribute="width" constant="188" id="v1t-vA-7PT"/>
67-
</constraints>
6865
</stackView>
6966
</subviews>
7067
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>

TodayExtension/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>XPC!</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>2.4.0</string>
20+
<string>2.4.1</string>
2121
<key>CFBundleVersion</key>
22-
<string>19</string>
22+
<string>20</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionMainStoryboard</key>

TodayExtension/Screen/TodayViewController.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ final class TodayViewController: UIViewController {
1717
@IBOutlet private weak var commonView: UIView!
1818
@IBOutlet private weak var artworkImageButton: UIButton! {
1919
didSet {
20+
artworkImageButton.imageView?.contentMode = .scaleAspectFit
21+
artworkImageButton.contentHorizontalAlignment = .fill
22+
artworkImageButton.contentVerticalAlignment = .fill
2023
artworkImageButton.rx.tap
2124
.subscribe(onNext: { [unowned self] (_) in
22-
guard let url = URL(string: "nowplaying-ios-nnsnodnb://") else { return }
25+
let url = URL(string: "nowplaying-ios-nnsnodnb://")!
2326
self.extensionContext?.open(url, completionHandler: nil)
2427
})
2528
.disposed(by: disposeBag)
@@ -28,7 +31,7 @@ final class TodayViewController: UIViewController {
2831
@IBOutlet private weak var songNameScrollLabel: ScrollFlowLabel! {
2932
didSet {
3033
songNameScrollLabel.textColor = .black
31-
songNameScrollLabel.textAlignment = .center
34+
songNameScrollLabel.textAlignment = .left
3235
songNameScrollLabel.font = .boldSystemFont(ofSize: 20)
3336
songNameScrollLabel.pauseInterval = 2
3437
songNameScrollLabel.scrollDirection = .left
@@ -38,7 +41,7 @@ final class TodayViewController: UIViewController {
3841
@IBOutlet private weak var artistNameScrollLabel: ScrollFlowLabel! {
3942
didSet {
4043
artistNameScrollLabel.textColor = .black
41-
artistNameScrollLabel.textAlignment = .center
44+
artistNameScrollLabel.textAlignment = .left
4245
artistNameScrollLabel.font = .systemFont(ofSize: 17)
4346
artistNameScrollLabel.pauseInterval = 2
4447
artistNameScrollLabel.scrollDirection = .left
@@ -55,8 +58,7 @@ final class TodayViewController: UIViewController {
5558
override func viewDidLoad() {
5659
super.viewDidLoad()
5760
viewModel.outputs.nowPlayingItem
58-
.observeOn(MainScheduler.instance)
59-
.subscribe(onNext: { [weak self] (item) in
61+
.drive(onNext: { [weak self] (item) in
6062
guard let wself = self else { return }
6163
let image = item.artwork?.image(at: wself.artworkImageButton.frame.size)
6264
wself.artworkImageButton.setImage(image, for: .normal)
@@ -67,16 +69,17 @@ final class TodayViewController: UIViewController {
6769

6870
viewModel.outputs.viewType
6971
.map { $0 == .common }
70-
.subscribe(onNext: { [weak self] (isCommon) in
72+
.drive(onNext: { [weak self] (isCommon) in
7173
self?.commonView.isHidden = !isCommon
72-
self?.deniedView.isHidden = !isCommon
74+
self?.deniedView.isHidden = isCommon
7375
})
7476
.disposed(by: disposeBag)
7577
}
7678

7779
override func viewDidAppear(_ animated: Bool) {
7880
super.viewDidAppear(animated)
7981
viewModel.inputs.accessMusicLibraryTrigger.accept(())
82+
viewModel.inputs.getNowPlayingItem()
8083
}
8184
}
8285

TodayExtension/Screen/TodayViewModel.swift

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ enum ViewType {
1919
protocol TodayViewModelInput {
2020

2121
var accessMusicLibraryTrigger: PublishRelay<Void> { get }
22+
func getNowPlayingItem()
2223
}
2324

2425
// MARK: - TodayViewModelOutput
2526

2627
protocol TodayViewModelOutput {
2728

28-
var nowPlayingItem: Observable<MPMediaItem> { get }
29-
var viewType: Observable<ViewType> { get }
29+
var nowPlayingItem: Driver<MPMediaItem> { get }
30+
var viewType: Driver<ViewType> { get }
3031
}
3132

3233
// MARK: - TodayViewModelType
@@ -44,8 +45,8 @@ final class TodayViewModel: TodayViewModelType {
4445
var outputs: TodayViewModelOutput { return self }
4546

4647
let accessMusicLibraryTrigger = PublishRelay<Void>()
47-
let nowPlayingItem: Observable<MPMediaItem>
48-
let viewType: Observable<ViewType>
48+
let nowPlayingItem: Driver<MPMediaItem>
49+
let viewType: Driver<ViewType>
4950

5051
private let disposeBag = DisposeBag()
5152
private let _nowPlayingItem = PublishSubject<MPMediaItem?>()
@@ -54,8 +55,9 @@ final class TodayViewModel: TodayViewModelType {
5455
init() {
5556
MPMusicPlayerController.systemMusicPlayer.beginGeneratingPlaybackNotifications()
5657

57-
nowPlayingItem = _nowPlayingItem.compactMap { $0 }.asObservable()
58-
viewType = _viewType.observeOn(MainScheduler.instance).asObservable()
58+
nowPlayingItem = _nowPlayingItem.compactMap { $0 }
59+
.asDriver(onErrorDriveWith: .empty())
60+
viewType = _viewType.asDriver(onErrorJustReturn: .denied)
5961

6062
inputs.accessMusicLibraryTrigger
6163
.subscribe(onNext: { [weak self] in
@@ -76,6 +78,10 @@ final class TodayViewModel: TodayViewModelType {
7678
deinit {
7779
MPMusicPlayerController.systemMusicPlayer.endGeneratingPlaybackNotifications()
7880
}
81+
82+
func getNowPlayingItem() {
83+
_nowPlayingItem.onNext(MPMusicPlayerController.systemMusicPlayer.nowPlayingItem)
84+
}
7985
}
8086

8187
// MARK: - Private method

0 commit comments

Comments
 (0)