Skip to content

Commit abac9b5

Browse files
committed
Merge branch 'develop'
2 parents b54218a + ace2b4f commit abac9b5

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## v0.6.3
4+
Released 26 May 2024
5+
6+
Highlights:
7+
* Hotfix for searcher not returning results
8+
9+
The full list of commits can be found [here](https://github.com/rembo10/headphones/compare/v0.6.2...v0.6.3).
10+
311
## v0.6.2
412
Released 26 May 2024
513

headphones/searcher.py

+23-29
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,27 @@
3838
import headphones
3939
from headphones.common import USER_AGENT
4040
from headphones.helpers import (
41-
bytes_to_mb,
42-
has_token,
43-
piratesize,
41+
bytes_to_mb,
42+
has_token,
43+
piratesize,
4444
replace_all,
45-
replace_illegal_chars,
46-
sab_replace_dots,
47-
sab_replace_spaces,
45+
replace_illegal_chars,
46+
sab_replace_dots,
47+
sab_replace_spaces,
4848
sab_sanitize_foldername,
4949
split_string
5050
)
5151
from headphones.types import Result
5252
from headphones import logger, db, classes, sab, nzbget, request
5353
from headphones import (
5454
bandcamp,
55-
deluge,
56-
notifiers,
57-
qbittorrent,
58-
rutracker,
55+
deluge,
56+
notifiers,
57+
qbittorrent,
58+
rutracker,
5959
soulseek,
60-
transmission,
61-
utorrent,
60+
transmission,
61+
utorrent
6262
)
6363

6464
# 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):
329329

330330
else:
331331

332-
nzb_results = None
333-
torrent_results = None
334-
bandcamp_results = None
332+
nzb_results = []
333+
torrent_results = []
334+
bandcamp_results = []
335335

336336
if NZB_PROVIDERS and NZB_DOWNLOADERS:
337-
nzb_results = searchNZB(album, new, losslessOnly, albumlength, choose_specific_download)
337+
nzb_results = searchNZB(album, new, losslessOnly,
338+
albumlength, choose_specific_download)
338339

339340
if TORRENT_PROVIDERS:
340-
torrent_results = searchTorrent(album, new, losslessOnly, albumlength,
341-
choose_specific_download)
341+
torrent_results = searchTorrent(album, new, losslessOnly,
342+
albumlength, choose_specific_download)
342343

343344
if headphones.CONFIG.BANDCAMP:
344345
bandcamp_results = searchBandcamp(album, new, albumlength)
345346

346-
if not nzb_results:
347-
nzb_results = []
348-
349-
if not torrent_results:
350-
torrent_results = []
351-
352347
results = nzb_results + torrent_results + bandcamp_results
353348

354349
if choose_specific_download:
@@ -370,7 +365,6 @@ def do_sorted_search(album, new, losslessOnly, choose_specific_download=False):
370365
(data, result) = preprocess(sorted_search_results)
371366

372367
if data and result:
373-
#print(f'going to send stuff to downloader. data: {data}, album: {album}')
374368
send_to_downloader(data, result, album)
375369

376370

@@ -876,15 +870,15 @@ def send_to_downloader(data, result, album):
876870
except Exception as e:
877871
logger.error('Couldn\'t write NZB file: %s', e)
878872
return
873+
879874
elif kind == 'bandcamp':
880875
folder_name = bandcamp.download(album, result)
881876
logger.info("Setting folder_name to: {}".format(folder_name))
882877

883-
884878
elif kind == 'soulseek':
885879
soulseek.download(user=result.user, filelist=result.files)
886-
folder_name = result.folder
887-
880+
folder_name = result.folder
881+
888882
else:
889883
folder_name = '%s - %s [%s]' % (
890884
unidecode(album['ArtistName']).replace('/', '_'),
@@ -1983,7 +1977,7 @@ def preprocess(resultlist):
19831977

19841978
if result.kind == 'soulseek':
19851979
return True, result
1986-
1980+
19871981
if result.kind == 'torrent':
19881982

19891983
# rutracker always needs the torrent data

0 commit comments

Comments
 (0)