testfkught build

This commit is contained in:
cranci1 2025-03-14 17:02:10 +01:00
parent 801390ca70
commit 04cf2c00fa
5 changed files with 17 additions and 33 deletions

View file

@ -15,10 +15,6 @@ struct ContentView: View {
.tabItem {
Label("Library", systemImage: "books.vertical")
}
DownloadView()
.tabItem {
Label("Downloads", systemImage: "arrow.down.circle.fill")
}
SearchView()
.tabItem {
Label("Search", systemImage: "magnifyingglass")

View file

@ -20,7 +20,7 @@ struct EpisodeCell: View {
let episodeID: Int
let progress: Double
let itemID: Int
let onTap: (String) -> Void
let onMarkAllPrevious: () -> Void
@ -28,18 +28,16 @@ struct EpisodeCell: View {
@State private var episodeImageUrl: String = ""
@State private var isLoading: Bool = true
@State private var currentProgress: Double = 0.0
var body: some View {
HStack {
ZStack {
KFImage(URL(string: episodeImageUrl.isEmpty
? "https://raw.githubusercontent.com/cranci1/Sora/refs/heads/main/assets/banner2.png"
: episodeImageUrl))
.resizable()
.aspectRatio(16/9, contentMode: .fill)
.frame(width: 100, height: 56)
.cornerRadius(8)
KFImage(URL(string: episodeImageUrl.isEmpty ? "https://raw.githubusercontent.com/cranci1/Sora/refs/heads/main/assets/banner2.png" : episodeImageUrl))
.resizable()
.aspectRatio(16/9, contentMode: .fill)
.frame(width: 100, height: 56)
.cornerRadius(8)
if isLoading {
ProgressView()
.progressViewStyle(CircularProgressViewStyle())
@ -69,7 +67,6 @@ struct EpisodeCell: View {
}
}
// Only show reset if progress is nonzero
if progress != 0 {
Button(action: resetProgress) {
Label("Reset Progress", systemImage: "arrow.counterclockwise")
@ -111,7 +108,7 @@ struct EpisodeCell: View {
let totalTime = UserDefaults.standard.double(forKey: "totalTime_\(episode)")
currentProgress = totalTime > 0 ? lastPlayedTime / totalTime : 0
}
private func fetchEpisodeDetails() {
guard let url = URL(string: "https://api.ani.zip/mappings?anilist_id=\(itemID)") else {
isLoading = false

View file

@ -56,8 +56,6 @@ struct MediaInfoView: View {
} else {
ScrollView {
VStack(alignment: .leading, spacing: 16) {
// MARK: - Top media info
HStack(alignment: .top, spacing: 10) {
KFImage(URL(string: imageUrl))
.placeholder {
@ -125,7 +123,6 @@ struct MediaInfoView: View {
}
}
// MARK: - Synopsis section
if !synopsis.isEmpty {
VStack(alignment: .leading, spacing: 2) {
HStack(alignment: .center) {
@ -149,7 +146,6 @@ struct MediaInfoView: View {
}
}
// MARK: - Action buttons
HStack {
Button(action: {
playFirstUnwatchedEpisode()
@ -210,7 +206,6 @@ struct MediaInfoView: View {
}
}
//MARK: - Mark all prevoius logic
ForEach(episodeLinks.indices.filter { selectedRange.contains($0) }, id: \.self) { i in
let ep = episodeLinks[i]
let lastPlayedTime = UserDefaults.standard.double(forKey: "lastPlayedTime_\(ep.href)")
@ -240,11 +235,11 @@ struct MediaInfoView: View {
UserDefaults.standard.set(99999999.0, forKey: "lastPlayedTime_\(href)")
UserDefaults.standard.set(99999999.0, forKey: "totalTime_\(href)")
}
refreshTrigger.toggle() // Force the UI to refresh
refreshTrigger.toggle()
Logger.shared.log("Marked \(ep.number) episodes watched within anime \"\(title)\".", type: "General")
}
)
.id(refreshTrigger) // Attaches the refresh trigger so that changes re-create the cell
.id(refreshTrigger)
.disabled(isFetchingEpisode)
}
}
@ -523,11 +518,7 @@ struct MediaInfoView: View {
}
let subtitleFileURL = subtitles != nil ? URL(string: subtitles!) : nil
DownloadManager.shared.downloadAndConvertHLS(from: streamURL, title: title, episode: selectedEpisodeNumber, subtitleURL: subtitleFileURL, module: module) { success, fileURL in
return
}
let externalPlayer = UserDefaults.standard.string(forKey: "externalPlayer") ?? "Default"
let externalPlayer = UserDefaults.standard.string(forKey: "externalPlayer") ?? "Sora"
var scheme: String?
switch externalPlayer {

View file

@ -71,10 +71,10 @@ struct SettingsViewGeneral: View {
}
}
Section(header: Text("Downloads"), footer: Text("Note that the modules will be replaced only if there is a different version string inside the JSON file.")) {
Toggle("Multi Threads conversion", isOn: $multiThreadsEnabled)
.tint(.accentColor)
}
//Section(header: Text("Downloads"), footer: Text("Note that the modules will be replaced only if there is a different version string inside the JSON file.")) {
// Toggle("Multi Threads conversion", isOn: $multiThreadsEnabled)
// .tint(.accentColor)
//}
Section(header: Text("Modules"), footer: Text("Note that the modules will be replaced only if there is a different version string inside the JSON file.")) {
Toggle("Refresh Modules on Launch", isOn: $refreshModulesOnLaunch)

View file

@ -86,7 +86,7 @@ struct SettingsView: View {
}
}
}
Section(footer: Text("Running Sora 0.2.1 - cranci1")) {}
Section(footer: Text("Running Sora 0.2.0 - cranci1")) {}
}
.navigationTitle("Settings")
}