This commit is contained in:
cranci1 2025-01-06 11:02:18 +01:00
parent 250d1cec9d
commit 0a14a550b9
2 changed files with 5 additions and 11 deletions

View file

@ -71,13 +71,7 @@ class JSController: ObservableObject {
}
func fetchInfoContent(href: String, module: ScrapingModule, completion: @escaping ([MediaItem]) -> Void) {
var baseUrl = module.metadata.baseUrl
if !baseUrl.hasSuffix("/") && !href.hasPrefix("/") {
baseUrl += "/"
}
baseUrl += href
guard let url = URL(string: baseUrl) else {
guard let url = URL(string: href) else {
completion([])
return
}

View file

@ -34,6 +34,10 @@ struct SearchView: View {
NavigationView {
ScrollView {
VStack(spacing: 0) {
SearchBar(text: $searchText, onSearchButtonClicked: performSearch)
.padding()
.disabled(selectedModule == nil)
if selectedModule == nil {
VStack(spacing: 8) {
Text("No Module Selected")
@ -48,10 +52,6 @@ struct SearchView: View {
.shadow(color: Color.black.opacity(0.1), radius: 2, y: 1)
}
SearchBar(text: $searchText, onSearchButtonClicked: performSearch)
.padding()
.disabled(selectedModule == nil)
if isSearching {
ProgressView()
.padding()