Skip to content

Commit

Permalink
Fix store negative value for search delay (#9822)
Browse files Browse the repository at this point in the history
* Improve explanation

* Fix search delay negative value
  • Loading branch information
p0psicles authored Aug 24, 2021
1 parent 8a4084d commit 8e7fcc0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
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.

0 comments on commit 8e7fcc0

Please sign in to comment.