Skip to content

Commit

Permalink
Enhanced show-header to combine and show local show and global prefer…
Browse files Browse the repository at this point in the history
…red words (#7085)

* Enhanced show-header to combine and show local show and global preferred/required words.
* Added anchor tag in config/search - filters. To link to it from show-header.vue.

* Fix calculation of ignoredWordsExclude.

* Fix: don't show the '+', when there are only global words.
* Add app-link to preferred and undesired words.
* Replace comma separator with comma + space.

* Fix trailing semi.

* Fixed showing "excluded from", when only global is set.
* In snatch-selection moved coloring to the left column, to make it cleaner and better readable when local and global words are used.

* Added changelog.

* Use template to reduce the amount of conditions.
  • Loading branch information
p0psicles authored and medariox committed Aug 30, 2019
1 parent 73df080 commit adab15e
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 38 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 @@
- Converted Edit Show to a Vue SFC ([#4486](https://github.com/pymedusa/Medusa/pull/4486)
- Improved API v2 exception reporting on Python 2 ([#6931](https://github.com/pymedusa/Medusa/pull/6931))
- Added support for qbittorrent api v2. Required from qbittorrent version > 3.2.0. ([#7040](https://github.com/pymedusa/Medusa/pull/7040))
- Show Header: Improved visibility of local and global configured required and ignored words. ([#7085](https://github.com/pymedusa/Medusa/pull/7085))

#### Fixes
- Fixed hdtorrent provider parse the publishing date with the day first ([#6847](https://github.com/pymedusa/Medusa/pull/6847))
Expand Down
90 changes: 61 additions & 29 deletions themes-default/slim/src/components/show-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,35 +169,77 @@

<tr v-if="show.config.aliases.length > 0">
<td class="showLegend" style="vertical-align: top;">Scene Name:</td>
<td>{{show.config.aliases.join(',')}}</td>
<td>{{show.config.aliases.join(', ')}}</td>
</tr>

<tr v-if="show.config.release.requiredWords.length > 0">
<td class="showLegend" style="vertical-align: top;">Required Words: </td>
<td><span class="break-word" :class="{required: type === 'snatch-selection'}">{{show.config.release.requiredWords.join(',')}}</span></td>
<tr v-if="show.config.release.requiredWords.length + search.filters.required.length > 0">
<td class="showLegend" style="vertical-align: top;">
<span :class="{required: type === 'snatch-selection'}">Required Words: </span>
</td>
<td>
<span v-if="show.config.release.requiredWords.length" class="break-word">
{{show.config.release.requiredWords.join(', ')}}
</span>
<span v-if="search.filters.required.length > 0" class="break-word global-filter">
<app-link href="config/search/#searchfilters">
<template v-if="show.config.release.requiredWords.length > 0">
<span v-if="show.config.release.requiredWordsExclude"> excluded from: </span>
<span v-else>+ </span>
</template>
{{search.filters.required.join(', ')}}
</app-link>
</span>
</td>
</tr>
<tr v-if="show.config.release.ignoredWords.length > 0">
<td class="showLegend" style="vertical-align: top;">Ignored Words: </td>
<td><span class="break-word" :class="{ignored: type === 'snatch-selection'}">{{show.config.release.ignoredWords.join(',')}}</span></td>
<tr v-if="show.config.release.ignoredWords.length + search.filters.ignored.length > 0">
<td class="showLegend" style="vertical-align: top;">
<span :class="{ignored: type === 'snatch-selection'}">Ignored Words: </span>
</td>
<td>
<span v-if="show.config.release.ignoredWords.length" class="break-word">
{{show.config.release.ignoredWords.join(', ')}}
</span>
<span v-if="search.filters.ignored.length > 0" class="break-word global-filter">
<app-link href="config/search/#searchfilters">
<template v-if="show.config.release.ignoredWords.length > 0">
<span v-if="show.config.release.ignoredWordsExclude"> excluded from: </span>
<span v-else>+ </span>
</template>
{{search.filters.ignored.join(', ')}}
</app-link>
</span>
</td>
</tr>

<tr v-if="preferredWords.length > 0">
<td class="showLegend" style="vertical-align: top;">Preferred Words: </td>
<td><span class="break-word" :class="{preferred: type === 'snatch-selection'}">{{preferredWords.join(',')}}</span></td>
<tr v-if="search.filters.preferred.length > 0">
<td class="showLegend" style="vertical-align: top;">
<span :class="{preferred: type === 'snatch-selection'}">Preferred Words: </span>
</td>
<td>
<app-link href="config/search/#searchfilters">
<span class="break-word">{{search.filters.preferred.join(', ')}}</span>
</app-link>
</td>
</tr>
<tr v-if="undesiredWords.length > 0">
<td class="showLegend" style="vertical-align: top;">Undesired Words: </td>
<td><span class="break-word" :class="{undesired: type === 'snatch-selection'}">{{undesiredWords.join(',')}}</span></td>
<tr v-if="search.filters.undesired.length > 0">
<td class="showLegend" style="vertical-align: top;">
<span :class="{undesired: type === 'snatch-selection'}">Undesired Words: </span>
</td>
<td>
<app-link href="config/search/#searchfilters">
<span class="break-word">{{search.filters.undesired.join(', ')}}</span>
</app-link>
</td>
</tr>

<tr v-if="show.config.release.whitelist && show.config.release.whitelist.length > 0">
<td class="showLegend">Wanted Groups:</td>
<td>{{show.config.release.whitelist.join(',')}}</td>
<td>{{show.config.release.whitelist.join(', ')}}</td>
</tr>

<tr v-if="show.config.release.blacklist && show.config.release.blacklist.length > 0">
<td class="showLegend">Unwanted Groups:</td>
<td>{{show.config.release.blacklist.join(',')}}</td>
<td>{{show.config.release.blacklist.join(', ')}}</td>
</tr>

<tr v-if="show.config.airdateOffset !== 0">
Expand Down Expand Up @@ -408,20 +450,6 @@ export default {
}
return result;
},
preferredWords() {
const { preferred } = this.search.filters;
if (preferred.length > 0) {
return preferred;
}
return [];
},
undesiredWords() {
const { undesired } = this.search.filters;
if (undesired.length > 0) {
return undesired;
}
return [];
},
episodeSummary() {
const { show } = this;
const { seasons } = show;
Expand Down Expand Up @@ -728,4 +756,8 @@ div#col-show-summary {
max-width: 280px;
}
}
span.global-filter {
font-style: italic;
}
</style>
2 changes: 1 addition & 1 deletion themes-default/slim/views/config_search.mako
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ window.app = new Vue({
<!-- search filters //-->
<div class="row component-group">
<div class="component-group-desc col-xs-12 col-md-2">
<h3>Search Filters</h3>
<a name="searchfilters"></a><h3>Search Filters</h3>
<p>Options to filter search results</p>
</div>
<div class="col-xs-12 col-md-10">
Expand Down
Loading

0 comments on commit adab15e

Please sign in to comment.