Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix store negative value for search delay #9822

Merged
merged 2 commits into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion medusa/server/api/v2/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ def _set_common_settings(provider, config):
if hasattr(provider, 'search_delay'):
try:
search_delay = float(config['search']['delay']['duration'])
provider.search_delay = (search_delay, 30)[search_delay < 30]
provider.search_delay = search_delay
except (AttributeError, KeyError, ValueError):
provider.search_delay = 480

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@

<config-toggle-slider v-model="editProvider.config.search.delay.enabled" label="Enable search delay" :name="`${editProvider.id}_enable_search_delay`" :id="`${editProvider.id}_enable_search_delay`">
<p>Enable to delay downloads for this provider for an x amount of hours. The provider will start snatching results for a specific episode after a delay has expired, compared to when it first got a result for the specific episode.</p>
<p>Searches for PROPER releases are exempted from the delay.</p>
<p>A negative value will have the daily search accepts results before the episode scheduled air date/time.</p>
<p>Proper and Backlog searches are exempted from the delay.</p>
</config-toggle-slider>

<config-textbox-number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@

<config-toggle-slider v-model="editProvider.config.search.delay.enabled" label="Enable search delay" :name="`${editProvider.id}_enable_search_delay`" :id="`${editProvider.id}_enable_search_delay`">
<p>Enable to delay downloads for this provider for an x amount of hours. The provider will start snatching results for a specific episode after a delay has expired, compared to when it first got a result for the specific episode.</p>
<p>Searches for PROPER releases are exempted from the delay.</p>
<p>A negative value will have the daily search accepts results before the episode scheduled air date/time.</p>
<p>Proper and Backlog searches are exempted from the delay.</p>
</config-toggle-slider>

<config-textbox-number
v-if="editProvider.config.search.delay.enabled" :value="editProvider.config.search.delay.duration / 60.0"
label="Search delay (hours)" :id="`${editProvider.id}_search_delay_duration`" :min="0.5" :step="0.5"
label="Search delay (hours)" :id="`${editProvider.id}_search_delay_duration`" :step="0.5"
@input="editProvider.config.search.delay.duration = $event * 60"
>
<p>Amount of hours to wait for downloading a result compared to the first result for a specific episode.</p>
Expand Down
8 changes: 4 additions & 4 deletions themes/dark/assets/js/medusa-runtime.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions themes/light/assets/js/medusa-runtime.js

Large diffs are not rendered by default.