Skip to content

Commit

Permalink
Convert Quality Chooser to SFC (#6737)
Browse files Browse the repository at this point in the history
* Fixes for `quality-chooser`

- Fix preset selector changing to a preset if the custom-selected qualities sum up to that preset.
- Fix empty custom view when previous preset was `keep`.
- Fix recalculating backlogged episodes after archiving.
- Fix backlogged episodes text always showing in red.
- Catch errors in async backlogged episodes computed prop.
- Use reduce instead of `filter`+`map` (more efficient)
- Remove unneeded map to integers on allowed/preferred watches
  (reason - `.number` modifer was missing on the `v-model`s)

* Rename to SFC and register, comment out Python code

* Move "initial quality" code to `main.mako`

* Simple linting

* Update backlog link

* Replace with getters and import `api`

* Add component to AddShowOptions

* Add basic QualityChooser tests

* Fix bugs

- Clear the preferred selection when deselecting all allowed qualities
- If changing to **OR from** `keep`, restore the original value

* Get the default show quality from the store

* Replace `seriesSlug` with `showSlug` prop

* Fix show qualities key in API description

* Simplify `manage_massEdit`

* Sort out the template and inline styles

* Update CHANGELOG.md

* [Bundle]
  • Loading branch information
sharkykh authored and medariox committed Jun 2, 2019
1 parent 01f809f commit b371535
Show file tree
Hide file tree
Showing 28 changed files with 1,106 additions and 829 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#### Improvements
- Converted the sub-menu into a Vue SFC ([#6724](https://github.com/pymedusa/Medusa/pull/6724))
- Converted View Log page into a Vue SFC ([#6738](https://github.com/pymedusa/Medusa/pull/6738))
- Converted the Quality Chooser into a Vue SFC ([#6737](https://github.com/pymedusa/Medusa/pull/6737))

#### Fixes
- Fixed lists not being saved when used with comma separated items ([#6428](https://github.com/pymedusa/Medusa/pull/6428))
Expand Down
2 changes: 1 addition & 1 deletion dredd/api-description.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ definitions:
items:
type: integer
format: int32
prefered:
preferred:
type: array
items:
type: integer
Expand Down
15 changes: 11 additions & 4 deletions themes-default/slim/src/components/add-show-options.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
<span>Quality</span>
</label>
<div class="col-sm-10 content">
<quality-chooser :overall-quality="defaultConfig.quality" @update:quality:allowed="quality.allowed = $event" @update:quality:preferred="quality.preferred = $event"></quality-chooser>
<quality-chooser
:overall-quality="defaultConfig.quality"
@update:quality:allowed="quality.allowed = $event"
@update:quality:preferred="quality.preferred = $event"
/>
</div>
</div>
</div>
Expand Down Expand Up @@ -86,15 +90,18 @@
import { mapState, mapGetters } from 'vuex';
import { apiRoute } from '../api';
import { combineQualities } from '../utils';
import { ConfigToggleSlider } from './helpers';
import {
ConfigToggleSlider,
QualityChooser
} from './helpers';
import AnidbReleaseGroupUi from './anidb-release-group-ui.vue';
export default {
name: 'add-show-options',
components: {
AnidbReleaseGroupUi,
ConfigToggleSlider
// @TODO: Add `QualityChooser`
ConfigToggleSlider,
QualityChooser
},
props: {
showName: {
Expand Down
1 change: 1 addition & 0 deletions themes-default/slim/src/components/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export { default as FileBrowser } from './file-browser.vue';
export { default as LanguageSelect } from './language-select.vue';
export { default as NamePattern } from './name-pattern.vue';
export { default as PlotInfo } from './plot-info.vue';
export { default as QualityChooser } from './quality-chooser.vue';
export { default as QualityPill } from './quality-pill.vue';
export { default as ScrollButtons } from './scroll-buttons.vue';
export { default as SelectList } from './select-list.vue';
Expand Down
Loading

0 comments on commit b371535

Please sign in to comment.