mirror of
https://github.com/cranci1/Sora.git
synced 2026-01-11 20:10:24 +00:00
Build fix (will flush commits after this) (#210)
* Quick Czech fix * Bookmark collection system + migration system (Video in discord)) * Check discord * Fix mediainfoview * Title always expanded * Reader header enhancements * Fix tab bar gradient * MORE/LESS below synopsis instead of next to it (less wasted space)) * Font + Weight + Size buttons for reader (with correct UI)) * Change icon * Theming and auto scroll * fucking cool shit * added new theme for reader * Fixed reader header * Added italian * made italian usable * changed credits * finally fucking italian works * Fix novel details * Fix loading issue * made chapter cells less tall * Fix current label * Create ios.yml * Delete .github/workflows/ios.yml * Hopefully fixed building error
This commit is contained in:
parent
e348ed243f
commit
fc1cff477b
1 changed files with 21 additions and 16 deletions
|
|
@ -893,7 +893,7 @@ struct MediaInfoView: View {
|
|||
|
||||
group.addTask {
|
||||
let fetchedChapters = try? await JSController.shared.extractChapters(moduleId: module.id.uuidString, href: href)
|
||||
DispatchQueue.main.async {
|
||||
await MainActor.run {
|
||||
if let fetchedChapters = fetchedChapters {
|
||||
Logger.shared.log("setupInitialData: fetchedChapters count = \(fetchedChapters.count)", type: "Debug")
|
||||
Logger.shared.log("setupInitialData: fetchedChapters = \(fetchedChapters)", type: "Debug")
|
||||
|
|
@ -903,33 +903,38 @@ struct MediaInfoView: View {
|
|||
}
|
||||
}
|
||||
group.addTask {
|
||||
await withCheckedContinuation { continuation in
|
||||
await MainActor.run {
|
||||
self.fetchDetails()
|
||||
var checkDetails: (() -> Void)?
|
||||
checkDetails = {
|
||||
if !(self.synopsis.isEmpty && self.aliases.isEmpty && self.airdate.isEmpty) {
|
||||
detailsLoaded = true
|
||||
continuation.resume()
|
||||
} else if Date().timeIntervalSince(start) > timeout {
|
||||
detailsLoaded = true
|
||||
continuation.resume()
|
||||
} else {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||
checkDetails?()
|
||||
}
|
||||
await withCheckedContinuation { (continuation: CheckedContinuation<Void, Never>) in
|
||||
func checkDetails() {
|
||||
Task { @MainActor in
|
||||
if !(self.synopsis.isEmpty && self.aliases.isEmpty && self.airdate.isEmpty) {
|
||||
detailsLoaded = true
|
||||
continuation.resume()
|
||||
} else if Date().timeIntervalSince(start) > timeout {
|
||||
detailsLoaded = true
|
||||
continuation.resume()
|
||||
} else {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||
checkDetails()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
checkDetails?()
|
||||
checkDetails()
|
||||
}
|
||||
}
|
||||
group.addTask {
|
||||
try? await Task.sleep(nanoseconds: UInt64(timeout * 1_000_000_000))
|
||||
DispatchQueue.main.async {
|
||||
await MainActor.run {
|
||||
chaptersLoaded = true
|
||||
detailsLoaded = true
|
||||
}
|
||||
}
|
||||
while !(chaptersLoaded && detailsLoaded) {
|
||||
while true {
|
||||
let loaded = await MainActor.run { chaptersLoaded && detailsLoaded }
|
||||
if loaded { break }
|
||||
try? await Task.sleep(nanoseconds: 100_000_000)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue