mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
77c2e9cd9e
UI: remove trackertable from the Search tab and reorder widgets to correct layout. Tab helper: add QLayout directly instead of wrapping it in a temporary QWidget to avoid extra nesting. Search helper: clear the trackertable rows and reset state.posts when starting a new search to ensure fresh results. Minor: import check_space in main and simplify an unused loop variable in libtorrent_int for clarity/linting.
27 lines
828 B
Python
27 lines
828 B
Python
from utils.logging.logs import consoleLog
|
|
from utils.data.state import state
|
|
from data.sources import SCRAPERS
|
|
|
|
for scraper in SCRAPERS:
|
|
state.trackers[scraper.name] = scraper
|
|
|
|
def run_search(self) -> None:
|
|
state.trackertable.setRowCount(0)
|
|
self.show_empty_results(False)
|
|
|
|
search_text = self.searchbar.text()
|
|
# Check for empty search
|
|
if search_text == "":
|
|
consoleLog("Error: Can't search for nothing")
|
|
return
|
|
|
|
state.posts = []
|
|
self.searchbar.setEnabled(False)
|
|
consoleLog(f"User searched for: {search_text}")
|
|
|
|
# Get current tracker and call its search function
|
|
scraper = state.trackers[state.currenttracker]
|
|
state.posts = scraper.search(search_text)
|
|
|
|
# Update GUI headers to match the current scraper
|
|
self.search_results_signal.emit(scraper.headers) |