mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-18 07:02:45 +00:00
better
This commit is contained in:
parent
c95c249843
commit
ebe38209bb
2 changed files with 13 additions and 4 deletions
|
|
@ -778,8 +778,8 @@ struct EpisodeCell: View {
|
|||
let episodeNum = episodeID + 1
|
||||
let urlString = "https://api.themoviedb.org/3/tv/\(tmdbID)/season/\(season)/episode/\(episodeNum)?api_key=738b4edd0a156cc126dc4a4b8aea4aca"
|
||||
guard let url = URL(string: urlString) else { return }
|
||||
|
||||
let tmdbImageWidth = UserDefaults.standard.string(forKey: "tmdbImageWidth") ?? "w780"
|
||||
|
||||
let tmdbImageWidth = UserDefaults.standard.string(forKey: "tmdbImageWidth") ?? "780"
|
||||
|
||||
URLSession.custom.dataTask(with: url) { data, _, error in
|
||||
guard let data = data, error == nil else { return }
|
||||
|
|
@ -787,7 +787,16 @@ struct EpisodeCell: View {
|
|||
if let json = try JSONSerialization.jsonObject(with: data) as? [String: Any] {
|
||||
let name = json["name"] as? String ?? ""
|
||||
let stillPath = json["still_path"] as? String
|
||||
let imageUrl = stillPath != nil ? "https://image.tmdb.org/t/p/\(tmdbImageWidth)\(stillPath!)" : ""
|
||||
let imageUrl: String
|
||||
if let stillPath = stillPath {
|
||||
if tmdbImageWidth == "original" {
|
||||
imageUrl = "https://image.tmdb.org/t/p/original\(stillPath)"
|
||||
} else {
|
||||
imageUrl = "https://image.tmdb.org/t/p/w\(tmdbImageWidth)\(stillPath)"
|
||||
}
|
||||
} else {
|
||||
imageUrl = ""
|
||||
}
|
||||
DispatchQueue.main.async {
|
||||
self.episodeTitle = name
|
||||
self.episodeImageUrl = imageUrl
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ struct SettingsViewGeneral: View {
|
|||
@AppStorage("currentAppIcon") private var currentAppIcon = "Default"
|
||||
|
||||
private let metadataProvidersList = ["AniList", "TMDB"]
|
||||
private let TMDBimageWidhtList = ["w300", "w500", "w780", "w1280", "original"]
|
||||
private let TMDBimageWidhtList = ["300", "500", "780", "1280", "original"]
|
||||
private let sortOrderOptions = ["Ascending", "Descending"]
|
||||
@EnvironmentObject var settings: Settings
|
||||
@State private var showAppIconPicker = false
|
||||
|
|
|
|||
Loading…
Reference in a new issue