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

revert some rabbitai damage #8596

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 9 additions & 3 deletions sickchill/gui/slick/views/history.mako
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@
<label>
<span>${_('Limit')}:</span>
<select name="history_limit" id="history_limit" class="form-control form-control-inline input-sm" title="Limit">
% for val in [10, 25, 50, 100, 250, 500, 750, 1000, 0]:
<option value="${val}}" ${selected(limit == val)}>${(0, _(All))[val == 0]}</option>
% endfor
BKSteve marked this conversation as resolved.
Show resolved Hide resolved
<option value="10" ${('', 'selected="selected"')[limit == 10]}>10</option>
<option value="25" ${('', 'selected="selected"')[limit == 25]}>25</option>
<option value="50" ${('', 'selected="selected"')[limit == 50]}>50</option>
<option value="100" ${('', 'selected="selected"')[limit == 100]}>100</option>
<option value="250" ${('', 'selected="selected"')[limit == 250]}>250</option>
<option value="500" ${('', 'selected="selected"')[limit == 500]}>500</option>
<option value="750" ${('', 'selected="selected"')[limit == 750]}>750</option>
<option value="1000" ${('', 'selected="selected"')[limit == 1000]}>1000</option>
<option value="0" ${('', 'selected="selected"')[limit == 0 ]}>All</option>
</select>
&nbsp
</label>
Expand Down
6 changes: 3 additions & 3 deletions sickchill/gui/slick/views/inc_qualityChooser.mako
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ selected = None
<select id="qualityPreset" name="quality_preset" class="form-control input-sm input100" title="qualityPreset">
<option value="0">Custom</option>
% for curPreset in qualityPresets:
<option value="${curPreset}" ${selected(curPreset == overall_quality)} ${('', 'style="padding-left: 15px;"')[qualityPresetStrings[curPreset].endswith("0p")]}>${qualityPresetStrings[curPreset]}</option>
<option value="${curPreset}" ${('', 'selected="selected"')[curPreset == overall_quality]} ${('', 'style="padding-left: 15px;"')[qualityPresetStrings[curPreset].endswith("0p")]}>${qualityPresetStrings[curPreset]}</option>
Copy link
Contributor

@miigotu miigotu Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too? Instead of <input ... selected="selected>" the value is now just <input ... selected> which is html5. Can you tell me what the issue is? SickChill needs restarted after the update to this new code, because the selected function is added in the context of the webserver side.

Copy link
Collaborator Author

@BKSteve BKSteve Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gives a nonetype mako error in the 3 locations

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File /home/stephenr/PycharmProjects/SickChill/sickchill/views/common.py:87, in render:
return self.template.render_unicode(*args, **context)
File /home/stephenr/.local/lib/python3.10/site-packages/mako/template.py:444, in render_unicode:
return runtime._render(
File /home/stephenr/.local/lib/python3.10/site-packages/mako/runtime.py:874, in _render:
_render_context(
File /home/stephenr/.local/lib/python3.10/site-packages/mako/runtime.py:916, in _render_context:
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File /home/stephenr/.local/lib/python3.10/site-packages/mako/runtime.py:943, in _exec_template:
callable_(context, *args, **kwargs)
File /home/stephenr/PycharmProjects/SickChill/sickchill/gui/slick/views/layouts/main.mako:333, in render_body:
<%block name="content" />
File /home/stephenr/PycharmProjects/SickChill/sickchill/gui/slick/views/editShow.mako:94, in render_content:
<%include file="/inc_qualityChooser.mako" />
File /home/stephenr/.local/lib/python3.10/site-packages/mako/runtime.py:793, in _include_file:
callable_(ctx, **kwargs)
File /home/stephenr/PycharmProjects/SickChill/sickchill/gui/slick/views/inc_qualityChooser.mako:22, in render_body:
${qualityPresetStrings[curPreset]}

TypeError: 'NoneType' object is not callable

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one's beyond me.

% endfor
</select>
</div>
Expand All @@ -35,7 +35,7 @@ selected = None
<% anyQualityList = [x for x in Quality.qualityStrings if x > Quality.NONE] %>
<select id="anyQualities" name="anyQualities" multiple="multiple" size="${len(anyQualityList)}" class="form-control form-control-inline input-sm" title="anyQualities">
% for curQuality in sorted(anyQualityList):
<option value="${curQuality}" ${selected(curQuality in anyQualities)}>${Quality.qualityStrings[curQuality]}</option>
<option value="${curQuality}" ${('', 'selected="selected"')[curQuality in anyQualities]}>${Quality.qualityStrings[curQuality]}</option>
% endfor
</select>
</div>
Expand All @@ -45,7 +45,7 @@ selected = None
<% bestQualityList = [x for x in Quality.qualityStrings if Quality.SDTV <= x < Quality.UNKNOWN] %>
<select id="bestQualities" name="bestQualities" multiple="multiple" size="${len(bestQualityList)}" class="form-control form-control-inline input-sm" title="bestQualities">
% for curQuality in sorted(bestQualityList):
<option value="${curQuality}" ${selected(curQuality in bestQualities)}>${Quality.qualityStrings[curQuality]}</option>
<option value="${curQuality}" ${('', 'selected="selected"')[curQuality in bestQualities]}>${Quality.qualityStrings[curQuality]}</option>
% endfor
</select>
</div>
Expand Down