diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 013a5ac5..9a0c320f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: mkdir Sparkle tar -xf Sparkle*.tar.xz -C Sparkle - - uses: apple-actions/import-codesign-certs@v1 + - uses: apple-actions/import-codesign-certs@v2 with: p12-file-base64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} p12-password: ${{ secrets.P12_PASSWORD }} @@ -44,8 +44,18 @@ jobs: - name: Prepare create-dmg run: npm install --global create-dmg - - name: Prepare Dependencies - run: bash InstallDeps.sh + - name: Prepare WebFiles Dependencies + run: | + cd IINA+/WebFiles/ + npm install + + - name: Download Plugin + uses: robinraju/release-downloader@v1.8 + with: + repository: 'xjbeta/iina-plugin-danmaku' + tag: "0.1.7" + fileName: "iina-plugin-danmaku.iinaplgz" + out-file-path: "IINA+" - name: SPM run: xcodebuild -resolvePackageDependencies diff --git a/IINA+.xcodeproj/project.pbxproj b/IINA+.xcodeproj/project.pbxproj index e69c3d05..baf972f6 100644 --- a/IINA+.xcodeproj/project.pbxproj +++ b/IINA+.xcodeproj/project.pbxproj @@ -993,7 +993,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.7.0; + MARKETING_VERSION = 0.7.1; PRODUCT_BUNDLE_IDENTIFIER = "com.xjbeta.iina-plus"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1018,7 +1018,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.14; - MARKETING_VERSION = 0.7.0; + MARKETING_VERSION = 0.7.1; PRODUCT_BUNDLE_IDENTIFIER = "com.xjbeta.iina-plus"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/IINA+/Utils/IINAApp.swift b/IINA+/Utils/IINAApp.swift index a266be8d..19a8014e 100644 --- a/IINA+/Utils/IINAApp.swift +++ b/IINA+/Utils/IINAApp.swift @@ -99,8 +99,13 @@ class IINAApp: NSObject { func pluginFolder() throws -> String { // /Users/xxx/Library/Application Support/com.colliderli.iina/plugins - let url = try FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: false) + let fm = FileManager.default + let url = try fm.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: false) let path = url.path + "/com.colliderli.iina/plugins/" + + if !fm.fileExists(atPath: path) { + try fm.createDirectory(atPath: path, withIntermediateDirectories: true) + } return path } diff --git a/IINA+/Utils/VideoDecoder/Huya.swift b/IINA+/Utils/VideoDecoder/Huya.swift index 63f5e939..8251d822 100644 --- a/IINA+/Utils/VideoDecoder/Huya.swift +++ b/IINA+/Utils/VideoDecoder/Huya.swift @@ -347,8 +347,10 @@ struct HuyaInfoM: Unmarshaling, LiveInfo { let bitRateInfos: [BitRateInfo] = try object.value(for: "roomInfo.tLiveInfo.tLiveStreamInfo.vBitRateInfo.value") let urls = streamInfos.sorted { i1, i2 -> Bool in - i1.sCdnType == defaultCDN - }.compactMap { + i1.sCdnType == defaultCDN + }.sorted { i1, i2 -> Bool in + !i1.sFlvUrl.contains("txdirect.flv.huya.com") + }.compactMap { $0.url } diff --git a/IINA+/Views/Preferences/GereralViewController.swift b/IINA+/Views/Preferences/GereralViewController.swift index 109583b6..db89aa3c 100644 --- a/IINA+/Views/Preferences/GereralViewController.swift +++ b/IINA+/Views/Preferences/GereralViewController.swift @@ -108,16 +108,21 @@ class GereralViewController: NSViewController, NSMenuDelegate { } override func prepare(for segue: NSStoryboardSegue, sender: Any?) { - guard let vc = segue.destinationController as? FontSelectorViewController else { return } - checkFontWeight() - - let name = pref.danmukuFontFamilyName - vc.delegate = self - vc.families = NSFontManager.shared.availableFontFamilies - vc.family = name - vc.styles = fontWeights(ofFontFamily: name) - vc.style = pref.danmukuFontWeight - vc.size = pref.danmukuFontSize + if let vc = segue.destinationController as? FontSelectorViewController { + checkFontWeight() + + let name = pref.danmukuFontFamilyName + vc.delegate = self + vc.families = NSFontManager.shared.availableFontFamilies + vc.family = name + vc.styles = fontWeights(ofFontFamily: name) + vc.style = pref.danmukuFontWeight + vc.size = pref.danmukuFontSize + } else if let vc = segue.destinationController as? PluginViewController { + vc.updatePlugin = { + self.initPluginInfo() + } + } } func fontWeights(ofFontFamily name: String) -> [String] { diff --git a/IINA+/Views/Preferences/PluginViewController.swift b/IINA+/Views/Preferences/PluginViewController.swift index a260c2c3..5843eb11 100644 --- a/IINA+/Views/Preferences/PluginViewController.swift +++ b/IINA+/Views/Preferences/PluginViewController.swift @@ -28,7 +28,9 @@ class PluginViewController: NSViewController { } catch let error { Log(error) } + initStates() + updatePlugin?() } @IBOutlet weak var enableDanmakuState: NSButton! @@ -41,7 +43,7 @@ class PluginViewController: NSViewController { @IBOutlet weak var tapsTextField: NSTextField! - + var updatePlugin: (() -> Void)? let iina = Processes.shared.iina enum PlistKeys: String {