yeah not really much kinda yes

This commit is contained in:
cranci1 2025-06-12 15:22:30 +02:00
parent c0742c6e20
commit 853ed19507
5 changed files with 19 additions and 49 deletions

View file

@ -58,7 +58,7 @@ class DownloadManager: NSObject, ObservableObject {
localPlaybackURL = localURL
}
} catch {
print("Error loading local content: \(error)")
Logger.shared.log("Error loading local content: \(error)", type: "Error")
}
}
}
@ -71,7 +71,6 @@ extension DownloadManager: AVAssetDownloadDelegate {
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) {
guard let error = error else { return }
print("Download error: \(error.localizedDescription)")
activeDownloadTasks.removeValue(forKey: task)
}

View file

@ -38,15 +38,6 @@ extension JSController {
showPosterURL: URL? = nil,
completionHandler: ((Bool, String) -> Void)? = nil
) {
print("---- STREAM TYPE DOWNLOAD PROCESS STARTED ----")
print("Original URL: \(url.absoluteString)")
print("Stream Type: \(module.metadata.streamType)")
print("Headers: \(headers)")
print("Title: \(title ?? "None")")
print("Is Episode: \(isEpisode), Show: \(showTitle ?? "None"), Season: \(season?.description ?? "None"), Episode: \(episode?.description ?? "None")")
if let subtitle = subtitleURL {
print("Subtitle URL: \(subtitle.absoluteString)")
}
let streamType = module.metadata.streamType.lowercased()
if streamType == "hls" || streamType == "m3u8" || url.absoluteString.contains(".m3u8") {

View file

@ -62,9 +62,7 @@ class JSController: NSObject, ObservableObject {
}
func updateMaxConcurrentDownloads(_ newLimit: Int) {
print("Updating max concurrent downloads from \(maxConcurrentDownloads) to \(newLimit)")
if !downloadQueue.isEmpty && !isProcessingQueue {
print("Processing download queue due to increased concurrent limit. Queue has \(downloadQueue.count) items.")
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
@ -75,7 +73,7 @@ class JSController: NSObject, ObservableObject {
}
}
} else {
print("No queued downloads to process or queue is already being processed")
Logger.shared.log("No queued downloads to process or queue is already being processed")
}
}
}

View file

@ -471,7 +471,6 @@ private extension EpisodeCell {
}
private extension EpisodeCell {
func setupOnAppear() {
updateProgress()
updateDownloadStatus()
@ -537,8 +536,6 @@ private extension EpisodeCell {
func tryNextDownloadMethod(methodIndex: Int, downloadID: UUID, softsub: Bool) {
guard isDownloading else { return }
print("[Download] Trying download method #\(methodIndex+1) for Episode \(episodeID + 1)")
switch methodIndex {
case 0:
if module.metadata.asyncJS == true {

View file

@ -1165,41 +1165,26 @@ struct MediaInfoView: View {
private func fetchMetadataIDIfNeeded() {
let provider = UserDefaults.standard.string(forKey: "metadataProviders") ?? "TMDB"
let cleaned = cleanTitle(title)
itemID = nil
tmdbID = nil
if provider == "TMDB" {
tmdbID = nil
tmdbFetcher.fetchBestMatchID(for: cleaned) { id, type in
tmdbFetcher.fetchBestMatchID(for: cleaned) { id, type in
DispatchQueue.main.async {
self.tmdbID = id
self.tmdbType = type
Logger.shared.log("Fetched TMDB ID: \(id ?? -1) (\(type?.rawValue ?? "unknown")) for title: \(cleaned)", type: "Debug")
}
}
fetchItemID(byTitle: cleaned) { result in
switch result {
case .success(let id):
DispatchQueue.main.async {
self.tmdbID = id
self.tmdbType = type
Logger.shared.log("Fetched TMDB ID: \(id ?? -1) (\(type?.rawValue ?? "unknown")) for title: \(cleaned)", type: "Debug")
}
}
itemID = nil
fetchItemID(byTitle: cleaned) { result in
switch result {
case .success(let id):
DispatchQueue.main.async {
self.itemID = id
Logger.shared.log("Fetched AniList ID: \(id) for title: \(cleaned)", type: "Debug")
}
case .failure(let error):
Logger.shared.log("Failed to fetch AniList ID: \(error)", type: "Error")
}
}
} else if provider == "Anilist" {
itemID = nil
fetchItemID(byTitle: cleaned) { result in
switch result {
case .success(let id):
DispatchQueue.main.async {
self.itemID = id
Logger.shared.log("Fetched AniList ID: \(id) for title: \(cleaned)", type: "Debug")
}
case .failure(let error):
Logger.shared.log("Failed to fetch AniList ID: \(error)", type: "Error")
self.itemID = id
Logger.shared.log("Fetched AniList ID: \(id) for title: \(cleaned)", type: "Debug")
}
case .failure(let error):
Logger.shared.log("Failed to fetch AniList ID: \(error)", type: "Error")
}
}
}