diff --git a/vrtnu/vrtnu/ContentView.swift b/vrtnu/vrtnu/ContentView.swift index 3bf7989..5cdb9b0 100644 --- a/vrtnu/vrtnu/ContentView.swift +++ b/vrtnu/vrtnu/ContentView.swift @@ -29,8 +29,31 @@ struct ContentView: View { } } - struct ShowView: View { + var show: Show + var body: some View { + NavigationView(){ + List{ + ForEach(show.getSeasons(), id: \.self){ season in + Section(header: Text(season.seasonName).font(.largeTitle)) { + ForEach(season.getEpisodes(), id:\.self){ episode in + NavigationLink(destination: VideoView(episode: episode)){ + HStack{ + AsyncImage(url: episode.imageURL,placeholder: { + //Image(name: "loading") + Text("Loading...") + },image:{Image(uiImage:$0).resizable()}).frame(width: 300, height: 300) + Text(episode.name) + } + } + } + }} + } + } + } +} + +struct VisibleShowView: View { var show: Show var body: some View { NavigationView(){ diff --git a/vrtnu/vrtnu/VrtNuLayout.swift b/vrtnu/vrtnu/VrtNuLayout.swift index 10cb1f5..4f49fce 100644 --- a/vrtnu/vrtnu/VrtNuLayout.swift +++ b/vrtnu/vrtnu/VrtNuLayout.swift @@ -168,7 +168,7 @@ struct Season: Hashable, Comparable{ episode = output[i].replacingOccurrences(of: "vrtnu/a-z/" + show.showName + "/" + seasonName + "/", with: "").replacingOccurrences(of: "/", with: "") print(episode) print(seasonName) - let image = URL(string: imageoutput[i].replacingOccurrences(of: "data-responsive-image=\"", with: "https:"))! + let image = URL(string: imageoutput[i].replacingOccurrences(of: "https:", with: "").replacingOccurrences(of: "http:", with: "").replacingOccurrences(of: "data-responsive-image=\"", with: "https:"))! myepisodes.append(Episode(season: self, episodeName: episode, imageURL: image)) } @@ -275,7 +275,7 @@ struct VRTNu { myshows = [] for i in 0 ..< output.count{ show = output[i].replacingOccurrences(of: ".relevant", with: "").replacingOccurrences(of: "a href=\"/vrtnu/a-z/", with: "") - image = imageoutput[i].replacingOccurrences(of: "data-responsive-image=\"", with: "https:") + image = imageoutput[i].replacingOccurrences(of: "https:", with: "").replacingOccurrences(of: "http:", with: "").replacingOccurrences(of: "data-responsive-image=\"", with: "https:") myshows.append(Show(showName: show, title: show, imageURL: URL(string: image)!)) } myshows.sort()