Skip to content

Commit

Permalink
[1] 391 bug sync up missing items from config yml template (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
bullmoose20 authored and actions-user committed Feb 19, 2025
1 parent 236ef9f commit 6bbe835
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.4.0-build1
16 changes: 10 additions & 6 deletions modules/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,21 @@ def build_oauth_dict(source, form_data):
final_key = key.replace(source + "_", "", 1)
value = form_data[key]

if (
(final_key == "client_id")
or (final_key == "client_secret")
or (final_key == "pin")
if final_key in (
"client_id",
"client_secret",
"pin",
"cache_expiration",
"localhost_url",
):
data[source][final_key] = value
data[source][final_key] = value # Store outside authorization
elif final_key == "validated":
data[final_key] = value
else:
if final_key != "url":
data[source]["authorization"][final_key] = value
data[source]["authorization"][
final_key
] = value # Everything else goes into authorization

return data

Expand Down
2 changes: 1 addition & 1 deletion templates/020-tmdb.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</div>

<div class="input-group mb-2">
<span class="input-group-text" id="tmdb_cache_expiration_text"" style="width: 170px; justify-content: space-between;">
<span class="input-group-text" id="tmdb_cache_expiration_text" style="width: 170px; justify-content: space-between;">
Cache Expiration
<span class="text-info" data-bs-toggle="tooltip" data-bs-html="true" style="margin-left: 10px;"
title="Set the number of days before TMDb cache expires.<br><br>Setting it to 0 disables caching.">
Expand Down
36 changes: 36 additions & 0 deletions templates/120-sonarr.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,42 @@
</select>
</div>

<div class="input-group mb-2">
<span class="input-group-text" id="sonarr_tag_text" style="width: 170px; justify-content: space-between;">
Tag
<span class="text-info" data-bs-toggle="tooltip" data-bs-html="true" style="margin-left: 10px;"
title="Enter a tag that will be applied to all movies added through Radarr.">
<i class="bi bi-info-circle-fill"></i>
</span>
</span>
<input type="text" class="form-control" id="sonarr_tag" name="sonarr_tag"
value="{{ data['sonarr']['tag'] }}" aria-describedby="sonarr_tag_text">
</div>

<div class="input-group mb-2">
<span class="input-group-text" id="sonarr_sonarr_path_text" style="width: 170px; justify-content: space-between;">
Sonarr Path
<span class="text-info" data-bs-toggle="tooltip" data-bs-html="true" style="margin-left: 10px;"
title="Specify the path Sonarr should use when adding movies.">
<i class="bi bi-info-circle-fill"></i>
</span>
</span>
<input type="text" class="form-control" id="sonarr_sonarr_path" name="sonarr_sonarr_path"
value="{{ data['sonarr']['sonarr_path'] }}" aria-describedby="sonarr_sonarr_path_text">
</div>

<div class="input-group mb-2">
<span class="input-group-text" id="sonarr_plex_path_text" style="width: 170px; justify-content: space-between;">
Plex Path
<span class="text-info" data-bs-toggle="tooltip" data-bs-html="true" style="margin-left: 10px;"
title="Set the path where Plex will find the movies added through Sonarr.">
<i class="bi bi-info-circle-fill"></i>
</span>
</span>
<input type="text" class="form-control" id="sonarr_plex_path" name="sonarr_plex_path"
value="{{ data['sonarr']['plex_path'] }}" aria-describedby="sonarr_plex_path_text">
</div>

<div class="input-group mb-2">
<span class="input-group-text" id="sonarr_monitor_text" style="width: 171px; justify-content: space-between;">
Monitor
Expand Down
13 changes: 13 additions & 0 deletions templates/140-mal.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@
Authorize <i id="spinner_retrieve" class="spinner-border spinner-border-sm" style="display:none;"></i>
</button>
</div>

<div class="input-group mb-2">
<span class="input-group-text" id="mal_cache_expiration_text" style="width: 170px; justify-content: space-between;">
Cache Expiration
<span class="text-info" data-bs-toggle="tooltip" data-bs-html="true" style="margin-left: 10px;"
title="Set the number of days before MyAnimeList cache expires.<br><br>Setting it to 0 disables caching.">
<i class="bi bi-info-circle-fill"></i>
</span>
</span>
<input type="number" class="form-control" id="mal_cache_expiration" name="mal_cache_expiration"
value="{{ data['mal']['cache_expiration'] }}" min="0" aria-describedby="mal_cache_expiration_text">
</div>

<input type="hidden" class="form-control" id="mal_url" name="mal_url" readonly oninput="enableLocalURLButton(this)">

<div class="input-group mb-2" id="localhost_url_field">
Expand Down
28 changes: 26 additions & 2 deletions templates/150-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,30 @@ <h6 class="fw-bold mt-3"><u>Collection Settings</u></h6>
</div>
</div>

<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="delete_below_minimum" name="delete_below_minimum" value="true"
{% if data['settings']['delete_below_minimum']|string|lower=='true' %}checked{% endif %}>
<input type="hidden" name="delete_below_minimum" value="false">
<label class="form-check-label" for="delete_below_minimum">
Delete Below Minimum
<i class="bi bi-info-circle-fill text-info" data-bs-toggle="tooltip" data-bs-html="true"
title="Used to delete collections below minimum items. When a collection is run, delete the collection if it is below the minimum number specified by minimum_items.">
</i>
</label>
</div>

<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="delete_not_scheduled" name="delete_not_scheduled" value="true"
{% if data['settings']['delete_not_scheduled']|string|lower=='true' %}checked{% endif %}>
<input type="hidden" name="delete_not_scheduled" value="false">
<label class="form-check-label" for="delete_not_scheduled">
Delete Not Scheduled
<i class="bi bi-info-circle-fill text-info" data-bs-toggle="tooltip" data-bs-html="true"
title="Used to delete collections not scheduled. If a collection is skipped due to it not being scheduled, delete the collection.">
</i>
</label>
</div>

<div class="col-md-8">
<div class="input-group mb-2">
<span class="input-group-text" style="width: 256px; justify-content: space-between;">
Expand Down Expand Up @@ -374,9 +398,9 @@ <h6 class="fw-bold mt-3"><u>Playlist Settings</u></h6>
title="Enable this setting to print out a playlist report at the end of the log.">
</i>
</label>

</div>
<!-- Button to open the modal for playlist_sync_to_users -->

<!-- Button to open the modal for playlist_sync_to_users -->
<div class="form-floating mb-2">
<!-- Button to open the modal for playlist_sync_to_users -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#syncUsersModal">
Expand Down

0 comments on commit 6bbe835

Please sign in to comment.