Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
* dev:
  add: sign sparkle script
  bump version
  small fix
  update: entitlements file
  update: save search request for future comparison
  add build time to info.plist to avoid MAS review check.
  add playback control to touchbar
  update: dependency
  update: rpath
  • Loading branch information
ddddxxx committed May 12, 2019
2 parents aec0ca2 + 7c3fe7c commit 29c49b7
Show file tree
Hide file tree
Showing 11 changed files with 191 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
github "ddddxxx/LyricsProvider" == 0.7.0

github "ddddxxx/MusicPlayer" == 0.4.0
github "ddddxxx/MusicPlayer" == 0.4.1

github "ddddxxx/GenericID" == 0.5.0

Expand Down
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github "SnapKit/SnapKit" "4.2.0"
github "SnapKit/SnapKit" "5.0.0"
github "ddddxxx/GenericID" "v0.5.0"
github "ddddxxx/LyricsProvider" "v0.7.0"
github "ddddxxx/MusicPlayer" "v0.4.0"
github "ddddxxx/MusicPlayer" "v0.4.1"
github "ddddxxx/Semver" "v0.1.2"
github "ddddxxx/SwiftyOpenCC" "v1.0.0"
github "ddddxxx/TouchBarHelper" "v1.0.0"
Expand Down
79 changes: 71 additions & 8 deletions LyricsX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/* Begin PBXBuildFile section */
BB03C8891FDF6FC000FBE0DA /* ChineseConverter+Singleton.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB03C8881FDF6FC000FBE0DA /* ChineseConverter+Singleton.swift */; };
BB063B2E1E8A93C900A25C3E /* KaraokeLyricsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB063B2D1E8A93C900A25C3E /* KaraokeLyricsView.swift */; };
BB0A3AE122803B1D006C2E52 /* TouchBarPlaybackControlViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB63C24E22774B47008CFFBB /* TouchBarPlaybackControlViewController.swift */; };
BB0B296A1E7FBA2D00B1D6C9 /* PreferenceFilterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB0B29691E7FBA2D00B1D6C9 /* PreferenceFilterViewController.swift */; };
BB0B296C1E80CB0600B1D6C9 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB0B296B1E80CB0600B1D6C9 /* AboutViewController.swift */; };
BB0BE9561F444C9E0068FF67 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = BB0BE9581F444C9E0068FF67 /* Localizable.strings */; };
Expand Down Expand Up @@ -72,7 +73,7 @@
BB50787722014C3900B695C3 /* Then.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBE8FC741F6BEA6200122AFA /* Then.swift */; };
BB50787822014C3900B695C3 /* Updater.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB34F7E51F21911700B7C484 /* Updater.swift */; };
BB50787922014C3900B695C3 /* Regex.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB1A3184207B261500406E32 /* Regex.swift */; };
BB50787A22014C3900B695C3 /* TouchBarArtworkItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB58640621F2B7500084D2C0 /* TouchBarArtworkItem.swift */; };
BB50787A22014C3900B695C3 /* TouchBarArtworkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB58640621F2B7500084D2C0 /* TouchBarArtworkViewController.swift */; };
BB50787B22014C3900B695C3 /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBC1D35E1E499A6D002538A2 /* Global.swift */; };
BB50787C22014C3900B695C3 /* StdExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB1B300220E878AE002F1AF8 /* StdExtension.swift */; };
BB50787D22014C3900B695C3 /* AutoActivateWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB58B07E1E82901800598D4F /* AutoActivateWindowController.swift */; };
Expand Down Expand Up @@ -118,7 +119,7 @@
BB5863F321EFFD9F0084D2C0 /* TouchBarLyricsItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB5863F221EFFD9F0084D2C0 /* TouchBarLyricsItem.swift */; };
BB58640421F2A85A0084D2C0 /* DFRPrivate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BB58640221F2A8570084D2C0 /* DFRPrivate.framework */; };
BB58640521F2A85A0084D2C0 /* DFRPrivate.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BB58640221F2A8570084D2C0 /* DFRPrivate.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
BB58640721F2B7500084D2C0 /* TouchBarArtworkItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB58640621F2B7500084D2C0 /* TouchBarArtworkItem.swift */; };
BB58640721F2B7500084D2C0 /* TouchBarArtworkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB58640621F2B7500084D2C0 /* TouchBarArtworkViewController.swift */; };
BB58B07F1E82901800598D4F /* AutoActivateWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB58B07E1E82901800598D4F /* AutoActivateWindowController.swift */; };
BB58B0821E82971400598D4F /* UserDefaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB58B0811E82971400598D4F /* UserDefaults.plist */; };
BB58B0841E82B82F00598D4F /* OpenCC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BB58B0831E82B82F00598D4F /* OpenCC.framework */; };
Expand All @@ -132,6 +133,7 @@
BB6139741FCCFA6700CBD808 /* Perference.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BB6139761FCCFA6700CBD808 /* Perference.storyboard */; };
BB63C24C226AFCE7008CFFBB /* Dictionary in Resources */ = {isa = PBXBuildFile; fileRef = BB63C24B226AFCE7008CFFBB /* Dictionary */; };
BB63C24D226AFCE7008CFFBB /* Dictionary in Resources */ = {isa = PBXBuildFile; fileRef = BB63C24B226AFCE7008CFFBB /* Dictionary */; };
BB63C24F22774B47008CFFBB /* TouchBarPlaybackControlViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB63C24E22774B47008CFFBB /* TouchBarPlaybackControlViewController.swift */; };
BB72784A20996DE900231C63 /* PreferenceLabViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB72784920996DE900231C63 /* PreferenceLabViewController.swift */; };
BB7EC7B21E4E018C00A0AC3F /* LyricsHUDViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7EC7B11E4E018C00A0AC3F /* LyricsHUDViewController.swift */; };
BB89089E21ED69410078F522 /* Lyrics+Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB89089D21ED69410078F522 /* Lyrics+Language.swift */; };
Expand Down Expand Up @@ -254,7 +256,7 @@
BB5078AD22014C3900B695C3 /* LyricsX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LyricsX.app; sourceTree = BUILT_PRODUCTS_DIR; };
BB5863F221EFFD9F0084D2C0 /* TouchBarLyricsItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchBarLyricsItem.swift; sourceTree = "<group>"; };
BB58640221F2A8570084D2C0 /* DFRPrivate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DFRPrivate.framework; path = Carthage/Build/Mac/DFRPrivate.framework; sourceTree = "<group>"; };
BB58640621F2B7500084D2C0 /* TouchBarArtworkItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchBarArtworkItem.swift; sourceTree = "<group>"; };
BB58640621F2B7500084D2C0 /* TouchBarArtworkViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchBarArtworkViewController.swift; sourceTree = "<group>"; };
BB58B07E1E82901800598D4F /* AutoActivateWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutoActivateWindowController.swift; sourceTree = "<group>"; };
BB58B0811E82971400598D4F /* UserDefaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = UserDefaults.plist; sourceTree = "<group>"; };
BB58B0831E82B82F00598D4F /* OpenCC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenCC.framework; path = Carthage/Build/Mac/OpenCC.framework; sourceTree = "<group>"; };
Expand All @@ -269,6 +271,7 @@
BB6139751FCCFA6700CBD808 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Perference.storyboard; sourceTree = "<group>"; };
BB6139781FCCFAC800CBD808 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Perference.strings"; sourceTree = "<group>"; };
BB63C24B226AFCE7008CFFBB /* Dictionary */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Dictionary; sourceTree = "<group>"; };
BB63C24E22774B47008CFFBB /* TouchBarPlaybackControlViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchBarPlaybackControlViewController.swift; sourceTree = "<group>"; };
BB72784920996DE900231C63 /* PreferenceLabViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferenceLabViewController.swift; sourceTree = "<group>"; };
BB7EC7B11E4E018C00A0AC3F /* LyricsHUDViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyricsHUDViewController.swift; sourceTree = "<group>"; };
BB89089D21ED69410078F522 /* Lyrics+Language.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Lyrics+Language.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -500,7 +503,8 @@
BB458C62201C5F4500740C3B /* LyricsMetaData+Extension.swift */,
BB89089D21ED69410078F522 /* Lyrics+Language.swift */,
BB5863F221EFFD9F0084D2C0 /* TouchBarLyricsItem.swift */,
BB58640621F2B7500084D2C0 /* TouchBarArtworkItem.swift */,
BB58640621F2B7500084D2C0 /* TouchBarArtworkViewController.swift */,
BB63C24E22774B47008CFFBB /* TouchBarPlaybackControlViewController.swift */,
);
path = Component;
sourceTree = "<group>";
Expand All @@ -512,11 +516,13 @@
isa = PBXNativeTarget;
buildConfigurationList = BB4141B91E458BA900A51775 /* Build configuration list for PBXNativeTarget "LyricsX" */;
buildPhases = (
BB0A3AE02280312A006C2E52 /* Update Build Time */,
BB4141A61E458BA800A51775 /* Sources */,
BB4141A71E458BA800A51775 /* Frameworks */,
BB4141A81E458BA800A51775 /* Resources */,
BB4141CA1E46CDD700A51775 /* Embed Frameworks */,
BB60F3111E889FC000BA1FD2 /* Copy Helper */,
BB0A3AE2228058B3006C2E52 /* Sign Sparkle */,
BB9163341F36371700E4E01C /* Fabric Script */,
BB0BE9531F444BE20068FF67 /* Update Localization */,
BBC1D5811E4AFE64008869EC /* Bump Build */,
Expand All @@ -534,6 +540,7 @@
isa = PBXNativeTarget;
buildConfigurationList = BB5078AA22014C3900B695C3 /* Build configuration list for PBXNativeTarget "LyricsX MAS" */;
buildPhases = (
BB0A3ADF22802E30006C2E52 /* Update Build Time */,
BB50786322014C3900B695C3 /* Sources */,
BB50788922014C3900B695C3 /* Frameworks */,
BB50789422014C3900B695C3 /* Resources */,
Expand Down Expand Up @@ -688,6 +695,60 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
BB0A3ADF22802E30006C2E52 /* Update Build Time */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Update Build Time";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/usr/libexec/PlistBuddy -c \"Set :LX_BUILD_TIME $(date +\"%s\")\" \"${PROJECT_DIR}/${INFOPLIST_FILE}\"\n";
};
BB0A3AE02280312A006C2E52 /* Update Build Time */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Update Build Time";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/usr/libexec/PlistBuddy -c \"Set :LX_BUILD_TIME $(date +\"%s\")\" \"${PROJECT_DIR}/${INFOPLIST_FILE}\"\n";
};
BB0A3AE2228058B3006C2E52 /* Sign Sparkle */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Sign Sparkle";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "LOCATION=\"${BUILT_PRODUCTS_DIR}\"/\"${FRAMEWORKS_FOLDER_PATH}\"\n\n# By default, use the configured code signing identity for the project/target\nIDENTITY=\"${EXPANDED_CODE_SIGN_IDENTITY_NAME}\"\nif [ \"$IDENTITY\" == \"\" ]\nthen\n# If a code signing identity is not specified, use ad hoc signing\nIDENTITY=\"-\"\nfi\ncodesign --verbose --force --deep -o runtime --sign \"$IDENTITY\" \"$LOCATION/Sparkle.framework/Versions/A/Resources/AutoUpdate.app\"\ncodesign --verbose --force -o runtime --sign \"$IDENTITY\" \"$LOCATION/Sparkle.framework/Versions/A\"\n";
};
BB0BE9531F444BE20068FF67 /* Update Localization */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -814,11 +875,12 @@
BBE8FC751F6BEA6200122AFA /* Then.swift in Sources */,
BB34F7E61F21911700B7C484 /* Updater.swift in Sources */,
BB1A3185207B261500406E32 /* Regex.swift in Sources */,
BB58640721F2B7500084D2C0 /* TouchBarArtworkItem.swift in Sources */,
BB58640721F2B7500084D2C0 /* TouchBarArtworkViewController.swift in Sources */,
BBC1D35F1E499A6D002538A2 /* Global.swift in Sources */,
BB1B300320E878AE002F1AF8 /* StdExtension.swift in Sources */,
BB58B07F1E82901800598D4F /* AutoActivateWindowController.swift in Sources */,
BB4919361F00CD800054EA09 /* PreferenceShortcutViewController.swift in Sources */,
BB63C24F22774B47008CFFBB /* TouchBarPlaybackControlViewController.swift in Sources */,
E91F76EB21211B8D00755698 /* PreferenceViewController.swift in Sources */,
BB063B2E1E8A93C900A25C3E /* KaraokeLyricsView.swift in Sources */,
BB0B296C1E80CB0600B1D6C9 /* AboutViewController.swift in Sources */,
Expand Down Expand Up @@ -858,7 +920,7 @@
BB50787722014C3900B695C3 /* Then.swift in Sources */,
BB50787822014C3900B695C3 /* Updater.swift in Sources */,
BB50787922014C3900B695C3 /* Regex.swift in Sources */,
BB50787A22014C3900B695C3 /* TouchBarArtworkItem.swift in Sources */,
BB50787A22014C3900B695C3 /* TouchBarArtworkViewController.swift in Sources */,
BB50787B22014C3900B695C3 /* Global.swift in Sources */,
BB50787C22014C3900B695C3 /* StdExtension.swift in Sources */,
BB50787D22014C3900B695C3 /* AutoActivateWindowController.swift in Sources */,
Expand All @@ -873,6 +935,7 @@
BB50788622014C3900B695C3 /* AppController.swift in Sources */,
BB50788722014C3900B695C3 /* PreferenceFilterViewController.swift in Sources */,
BB50788822014C3900B695C3 /* Lyrics+Language.swift in Sources */,
BB0A3AE122803B1D006C2E52 /* TouchBarPlaybackControlViewController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1080,7 +1143,7 @@
"$(PROJECT_DIR)/LyricsX/Frameworks",
);
INFOPLIST_FILE = "LyricsX/Supporting Files/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = ddddxxx.LyricsX;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -1106,7 +1169,7 @@
"$(PROJECT_DIR)/LyricsX/Frameworks",
);
INFOPLIST_FILE = "LyricsX/Supporting Files/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = ddddxxx.LyricsX;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
7 changes: 4 additions & 3 deletions LyricsX/Component/AppController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class AppController: NSObject, MusicPlayerManagerDelegate {
}
}

var searchRequest: LyricsSearchRequest?
var searchProgress: Progress?

var currentLineIndex: Int?
Expand Down Expand Up @@ -206,6 +207,7 @@ class AppController: NSObject, MusicPlayerManagerDelegate {
duration: duration,
limit: 5,
timeout: 10)
searchRequest = req
searchProgress = lyricsManager.searchLyrics(request: req, using: self.lyricsReceived)
Answers.logCustomEvent(withName: "Search Lyrics Automatically", customAttributes: ["override": currentLyrics == nil ? 0 : 1])
}
Expand Down Expand Up @@ -238,9 +240,8 @@ class AppController: NSObject, MusicPlayerManagerDelegate {
// MARK: LyricsSourceDelegate

func lyricsReceived(lyrics: Lyrics) {
let track = playerManager.player?.currentTrack
guard lyrics.metadata.title == track?.title ?? "",
lyrics.metadata.artist == track?.artist ?? "" else {
guard let req = searchRequest,
lyrics.metadata.request == req else {
return
}
if defaults[.StrictSearchEnabled] && !lyrics.isMatched() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,6 @@
import AppKit
import MusicPlayer

@available(OSX 10.12.2, *)
class TouchBarArtworkItem: NSCustomTouchBarItem {

override init(identifier: NSTouchBarItem.Identifier) {
super.init(identifier: identifier)
commonInit()
}

required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit()
}

func commonInit() {
viewController = TouchBarArtworkViewController()
customizationLabel = "Artwork"
}
}

@available(OSX 10.12.2, *)
class TouchBarArtworkViewController: NSViewController {

let artworkView = NSImageView()
Expand Down
73 changes: 73 additions & 0 deletions LyricsX/Component/TouchBarPlaybackControlViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
// TouchBarPlaybackControlItem.swift
//
// This file is part of LyricsX
// Copyright (C) 2017 Xander Deng - https://github.com/ddddxxx/LyricsX
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

import AppKit
import MusicPlayer
import SnapKit

@available(OSX 10.12.2, *)
class TouchBarPlaybackControlViewController: NSViewController {

override func loadView() {
let rewindImage = NSImage(named: NSImage.touchBarRewindTemplateName)!
let rewindButton = NSButton(image: rewindImage, target: self, action: #selector(rewindAction(_:)))
let playPauseImage = NSImage(named: NSImage.touchBarPlayPauseTemplateName)!
let playPauseButton = NSButton(image: playPauseImage, target: self, action: #selector(playPauseAction(_:)))
let fastForwardImage = NSImage(named: NSImage.touchBarFastForwardTemplateName)!
let fastForwardButton = NSButton(image: fastForwardImage, target: self, action: #selector(fastForwardAction(_:)))
view = NSView()
view.addSubview(rewindButton)
view.addSubview(playPauseButton)
view.addSubview(fastForwardButton)
rewindButton.snp.makeConstraints { make in
make.top.left.bottom.equalToSuperview()
make.width.equalTo(playPauseButton.snp.width)
make.width.equalTo(fastForwardButton.snp.width)
make.width.equalTo(50)
}
playPauseButton.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.left.equalTo(rewindButton.snp.right).offset(2)
make.right.equalTo(fastForwardButton.snp.left).offset(-2)
}
fastForwardButton.snp.makeConstraints { make in
make.top.right.bottom.equalToSuperview()
}
}

@IBAction func rewindAction(_ sender: Any?) {
guard let player = AppController.shared.playerManager.player else {
return
}
if player.playerPosition > 5 {
player.playerPosition = 0
} else {
player.skipToPreviousItem()
}
}

@IBAction func playPauseAction(_ sender: Any?) {
AppController.shared.playerManager.player?.playPause()
}

@IBAction func fastForwardAction(_ sender: Any?) {
AppController.shared.playerManager.player?.skipToNextItem()
}
}
7 changes: 7 additions & 0 deletions LyricsX/Component/Updater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ var localVersion: Semver {
#if IS_FOR_MAS

func checkForMASReview(force: Bool = false) {
if let buildTime = Bundle.main.infoDictionary?["LX_BUILD_TIME"] as? Double {
let dt = Date().timeIntervalSince1970 - buildTime
if dt > masReviewPeriodLimit {
defaults[.isInMASReview] = false
return
}
}
guard force || (defaults[.isInMASReview] == nil) else {
return
}
Expand Down
Loading

0 comments on commit 29c49b7

Please sign in to comment.