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

Convert Quality Chooser to SFC #6737

Merged
merged 16 commits into from
Jun 2, 2019
Merged
Prev Previous commit
Next Next commit
Move "initial quality" code to main.mako
  • Loading branch information
sharkykh committed Jun 2, 2019
commit edc652e71f2f71142f5fbcc02450c7ce774d073d
11 changes: 1 addition & 10 deletions themes-default/slim/src/components/helpers/quality-chooser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,9 @@
/*
<%!
import json
from medusa import app
from medusa.common import Quality, qualityPresets, qualityPresetStrings
%>
<%
if show is not UNDEFINED:
__quality = int(show.quality)
else:
__quality = int(app.QUALITY_DEFAULT)
allowed_qualities, preferred_qualities = Quality.split_quality(__quality)
overall_quality = Quality.combine_qualities(allowed_qualities, preferred_qualities)

def convert(obj):
## This converts the keys to strings as keys can't be ints
if isinstance(obj, dict):
Expand All @@ -80,8 +72,7 @@ export default {
props: {
overallQuality: {
type: Number,
// FIXME: Python conversion
// default: ${overall_quality}
default: window.qualityChooserInitialQuality
},
keep: {
type: String,
Expand Down
3 changes: 3 additions & 0 deletions themes-default/slim/views/layouts/main.mako
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
% else:
window.username = '';
% endif

// [Temporary] Used by the QualityChooser component on some pages
window.qualityChooserInitialQuality = ${int(show.quality) if show is not UNDEFINED else int(app.QUALITY_DEFAULT)};
</script>
<script>
if ('${bool(app.DEVELOPER)}' === 'True') {
Expand Down