mirror of
https://github.com/cranci1/Sora.git
synced 2026-03-11 17:45:37 +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 {
|
group.addTask {
|
||||||
let fetchedChapters = try? await JSController.shared.extractChapters(moduleId: module.id.uuidString, href: href)
|
let fetchedChapters = try? await JSController.shared.extractChapters(moduleId: module.id.uuidString, href: href)
|
||||||
DispatchQueue.main.async {
|
await MainActor.run {
|
||||||
if let fetchedChapters = fetchedChapters {
|
if let fetchedChapters = fetchedChapters {
|
||||||
Logger.shared.log("setupInitialData: fetchedChapters count = \(fetchedChapters.count)", type: "Debug")
|
Logger.shared.log("setupInitialData: fetchedChapters count = \(fetchedChapters.count)", type: "Debug")
|
||||||
Logger.shared.log("setupInitialData: fetchedChapters = \(fetchedChapters)", type: "Debug")
|
Logger.shared.log("setupInitialData: fetchedChapters = \(fetchedChapters)", type: "Debug")
|
||||||
|
|
@ -903,33 +903,38 @@ struct MediaInfoView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
group.addTask {
|
group.addTask {
|
||||||
await withCheckedContinuation { continuation in
|
await MainActor.run {
|
||||||
self.fetchDetails()
|
self.fetchDetails()
|
||||||
var checkDetails: (() -> Void)?
|
}
|
||||||
checkDetails = {
|
await withCheckedContinuation { (continuation: CheckedContinuation<Void, Never>) in
|
||||||
if !(self.synopsis.isEmpty && self.aliases.isEmpty && self.airdate.isEmpty) {
|
func checkDetails() {
|
||||||
detailsLoaded = true
|
Task { @MainActor in
|
||||||
continuation.resume()
|
if !(self.synopsis.isEmpty && self.aliases.isEmpty && self.airdate.isEmpty) {
|
||||||
} else if Date().timeIntervalSince(start) > timeout {
|
detailsLoaded = true
|
||||||
detailsLoaded = true
|
continuation.resume()
|
||||||
continuation.resume()
|
} else if Date().timeIntervalSince(start) > timeout {
|
||||||
} else {
|
detailsLoaded = true
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
continuation.resume()
|
||||||
checkDetails?()
|
} else {
|
||||||
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||||
|
checkDetails()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
checkDetails?()
|
checkDetails()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
group.addTask {
|
group.addTask {
|
||||||
try? await Task.sleep(nanoseconds: UInt64(timeout * 1_000_000_000))
|
try? await Task.sleep(nanoseconds: UInt64(timeout * 1_000_000_000))
|
||||||
DispatchQueue.main.async {
|
await MainActor.run {
|
||||||
chaptersLoaded = true
|
chaptersLoaded = true
|
||||||
detailsLoaded = 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)
|
try? await Task.sleep(nanoseconds: 100_000_000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue