Skip to content

Commit

Permalink
BHD - prohibit SD if HD exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Dec 30, 2024
1 parent 974f2f5 commit f2cfac5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/trackers/BHD.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,16 @@ async def search_existing(self, meta, disctype):
category = "Movies"
elif category == "TV":
category = "TV"
if meta['is_disc'] == "DVD":
type = None
else:
type = await self.get_type(meta)

data = {
'action': 'search',
'tmdb_id': f"{tmdbID}/{meta['tmdb']}",
'categories': category,
'types': await self.get_type(meta)
'types': type
}
if meta['sd'] == 1:
data['categories'] = None
Expand Down
7 changes: 6 additions & 1 deletion src/trackers/COMMON.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ async def filter_dupes(self, dupes, meta, tracker_name):
is_dvd = meta['is_disc'] == "DVD"
web_dl = meta.get('type') == "WEBDL"
target_source = meta.get("source")
is_sd = meta.get('sd')

attribute_checks = [
{
Expand Down Expand Up @@ -723,11 +724,15 @@ async def process_exclusion(each):
await log_exclusion(f"Encoder '{has_encoder_in_name}' mismatch", each)
return False

if is_dvd:
if is_dvd and not tracker_name == "BHD":
if any(str(res) in each for res in [1080, 720, 2160]):
await log_exclusion(f"resolution '{target_resolution}' mismatch", each)
return True

if is_sd == 1 and tracker_name == "BHD":
if any(str(res) in each for res in [1080, 720, 2160]):
return False

for check in attribute_checks:
if check["key"] == "repack":
if has_repack_in_uuid and "repack" not in normalized:
Expand Down

0 comments on commit f2cfac5

Please sign in to comment.