Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #160 and settings view being too wide on iPad #163

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/EeveeSpotify/Lyrics/Helpers/LyricsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LyricsHelper {
lyricLines = lines.map { line in

let match = line.firstMatch(
"\\[(?<minute>\\d{2}):(?<seconds>\\d{2}\\.\\d{2})\\] ?(?<content>.*)"
"\\[(?<minute>\\d{2}):(?<seconds>\\d{2}\\.?\\d*)\\] ?(?<content>.*)"
)!

var captures: [String: String] = [:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ extension UserDefaults {
static var lyricsSource: LyricsSource {
get {
if let rawValue = defaults.object(forKey: lyricsSourceKey) as? Int {
return LyricsSource(rawValue: rawValue)!
if let source = LyricsSource(rawValue: rawValue) {
return source
} else {
return .lrclib
}

}

return .lrclib
Expand Down
2 changes: 1 addition & 1 deletion Sources/EeveeSpotify/Tweak.x.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ProfileSettingsSectionHook: ClassHook<NSObject> {
"RootSettingsViewController"
)!

let eeveeSettingsController = EeveeSettingsViewController()
let eeveeSettingsController = EeveeSettingsViewController(rootSettingsController.view.bounds)
eeveeSettingsController.title = "EeveeSpotify"

rootSettingsController.navigationController!.pushViewController(
Expand Down
12 changes: 11 additions & 1 deletion Sources/EeveeSpotify/Views/EeveeSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ import SwiftUI
import UIKit

class EeveeSettingsViewController: UIViewController {

let frame: CGRect
init(_ frame: CGRect) {
self.frame = frame
super.init(nibName: nil, bundle: nil)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func conforms(to aProtocol: Protocol) -> Bool {

Expand All @@ -24,7 +34,7 @@ class EeveeSettingsViewController: UIViewController {
super.viewDidLoad()

let hostingController = UIHostingController(rootView: EeveeSettingsView())
hostingController.view.frame = view.bounds
hostingController.view.frame = frame

view.addSubview(hostingController.view)
addChild(hostingController)
Expand Down
Loading