From ebba11544370a698a34f30c066d21aa5f8b8bad2 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Sun, 26 May 2024 19:58:45 +0530 Subject: [PATCH 1/2] Fix for searcher not returning results --- headphones/searcher.py | 52 +++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/headphones/searcher.py b/headphones/searcher.py index d6c8478ec..254412d6e 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -38,13 +38,13 @@ import headphones from headphones.common import USER_AGENT from headphones.helpers import ( - bytes_to_mb, - has_token, - piratesize, + bytes_to_mb, + has_token, + piratesize, replace_all, - replace_illegal_chars, - sab_replace_dots, - sab_replace_spaces, + replace_illegal_chars, + sab_replace_dots, + sab_replace_spaces, sab_sanitize_foldername, split_string ) @@ -52,13 +52,13 @@ from headphones import logger, db, classes, sab, nzbget, request from headphones import ( bandcamp, - deluge, - notifiers, - qbittorrent, - rutracker, + deluge, + notifiers, + qbittorrent, + rutracker, soulseek, - transmission, - utorrent, + transmission, + utorrent ) # Magnet to torrent services, for Black hole. Stolen from CouchPotato. @@ -329,26 +329,21 @@ def do_sorted_search(album, new, losslessOnly, choose_specific_download=False): else: - nzb_results = None - torrent_results = None - bandcamp_results = None + nzb_results = [] + torrent_results = [] + bandcamp_results = [] if NZB_PROVIDERS and NZB_DOWNLOADERS: - nzb_results = searchNZB(album, new, losslessOnly, albumlength, choose_specific_download) + nzb_results = searchNZB(album, new, losslessOnly, + albumlength, choose_specific_download) if TORRENT_PROVIDERS: - torrent_results = searchTorrent(album, new, losslessOnly, albumlength, - choose_specific_download) + torrent_results = searchTorrent(album, new, losslessOnly, + albumlength, choose_specific_download) if headphones.CONFIG.BANDCAMP: bandcamp_results = searchBandcamp(album, new, albumlength) - if not nzb_results: - nzb_results = [] - - if not torrent_results: - torrent_results = [] - results = nzb_results + torrent_results + bandcamp_results if choose_specific_download: @@ -370,7 +365,6 @@ def do_sorted_search(album, new, losslessOnly, choose_specific_download=False): (data, result) = preprocess(sorted_search_results) if data and result: - #print(f'going to send stuff to downloader. data: {data}, album: {album}') send_to_downloader(data, result, album) @@ -876,15 +870,15 @@ def send_to_downloader(data, result, album): except Exception as e: logger.error('Couldn\'t write NZB file: %s', e) return + elif kind == 'bandcamp': folder_name = bandcamp.download(album, result) logger.info("Setting folder_name to: {}".format(folder_name)) - elif kind == 'soulseek': soulseek.download(user=result.user, filelist=result.files) - folder_name = result.folder - + folder_name = result.folder + else: folder_name = '%s - %s [%s]' % ( unidecode(album['ArtistName']).replace('/', '_'), @@ -1983,7 +1977,7 @@ def preprocess(resultlist): if result.kind == 'soulseek': return True, result - + if result.kind == 'torrent': # rutracker always needs the torrent data From ace2b4f26a586dfdcf3c41bb9a260c9ff452f8ec Mon Sep 17 00:00:00 2001 From: rembo10 Date: Sun, 26 May 2024 21:12:09 +0530 Subject: [PATCH 2/2] Update changelog for v0.6.3 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01e9909a2..4f1edc21c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## v0.6.3 + Released 26 May 2024 + +Highlights: +* Hotfix for searcher not returning results + +The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.6.2...v0.6.3). + ## v0.6.2 Released 26 May 2024