mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
parent
c037387fc3
commit
58a6b2022b
1 changed files with 8 additions and 2 deletions
|
@ -548,21 +548,27 @@ def get_release(base_url, imdb_id=None, download_id=None, release_id=None):
|
||||||
|
|
||||||
# Narrow results by removing old releases by comparing their last_edit field
|
# Narrow results by removing old releases by comparing their last_edit field
|
||||||
if len(results) > 1:
|
if len(results) > 1:
|
||||||
|
rem_id = []
|
||||||
for id1, x1 in results.items():
|
for id1, x1 in results.items():
|
||||||
for x2 in results.values():
|
for x2 in results.values():
|
||||||
try:
|
try:
|
||||||
if x2['last_edit'] > x1['last_edit']:
|
if x2['last_edit'] > x1['last_edit']:
|
||||||
results.pop(id1)
|
rem_id.append(id1)
|
||||||
except Exception:
|
except Exception:
|
||||||
continue
|
continue
|
||||||
|
for id in rem_id:
|
||||||
|
results.pop(id)
|
||||||
|
|
||||||
# Search downloads on clients for a match to try and narrow our results down to 1
|
# Search downloads on clients for a match to try and narrow our results down to 1
|
||||||
if len(results) > 1:
|
if len(results) > 1:
|
||||||
|
rem_id = []
|
||||||
for cur_id, x in results.items():
|
for cur_id, x in results.items():
|
||||||
try:
|
try:
|
||||||
if not find_download(str(x['download_info']['downloader']).lower(), x['download_info']['id']):
|
if not find_download(str(x['download_info']['downloader']).lower(), x['download_info']['id']):
|
||||||
results.pop(cur_id)
|
rem_id.append(cur_id)
|
||||||
except Exception:
|
except Exception:
|
||||||
continue
|
continue
|
||||||
|
for id in rem_id:
|
||||||
|
results.pop(id)
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue