Skip to content

Commit

Permalink
Fixed issue with detecting content type.
Browse files Browse the repository at this point in the history
  • Loading branch information
elgatito committed Mar 7, 2024
1 parent 439cef9 commit bb18fc8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions burst/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,23 @@ def get_enabled_providers(method):
list: All available enabled provider IDs
"""
results = []
content_type = 'Shows' # if method == 'season' or method == 'episode' or method == 'anime'
content_type_string = 'Shows' # if method == 'season' or method == 'episode' or method == 'anime'
content_typt_int = '2'
if method == 'general':
content_type = 'All'
content_type_string = 'All'
content_typt_int = '0'
elif method == 'movie':
content_type = 'Movies'
content_type_string = 'Movies'
content_typt_int = '1'
for provider in definitions:
if 'enabled' in definitions[provider] and not definitions[provider]['enabled']:
continue

if get_setting('use_%s' % provider, bool):
contains = get_setting('%s_contains' % provider, choices=('All', 'Movies', 'Shows'))
if not contains or contains == 'All': # treat absence of setting as All
if not contains or contains == 'All' or contains == '0': # treat absence of setting as All
results.append(provider)
elif contains == content_type:
elif contains == content_type_string or contains == content_typt_int:
results.append(provider)
if 'custom' in definitions[provider] and definitions[provider]['custom']:
results.append(provider)
Expand Down

0 comments on commit bb18fc8

Please sign in to comment.