Skip to content

Commit

Permalink
Bring back visual indicators for searching, queued and finished. (#10566
Browse files Browse the repository at this point in the history
)

* Bring back visual indicators for searching, queued and finished.

* Fixed a runtime error when loading <search /> components.

* Don't render show-header until fully switched to new showSlug.

* Further improve switching of shows.

* Fixed width to group and release columns.

* Add a text underline for Show links.
To make it more apparent as a link.

* Add possibility to edit provider url

* Improve dateStyle / timeStyle formatting.

* Increast max offset to 678 hours.

* Fix sort shows with the sortArticle option in manage -> Change Indexer page.

* Fix border collapse

* Improve indication for refreshing results.

* Update changelog

* Fix style lint

* Update snapshot
  • Loading branch information
p0psicles authored May 31, 2022
1 parent 6da7bfa commit 4d4b919
Show file tree
Hide file tree
Showing 28 changed files with 253 additions and 143 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
## Unreleased

#### New Features
- Add option to mass-update the info language ([10516](https://github.com/pymedusa/Medusa/pull/10516))

#### Improvements
- Multiple UI fixes / enhancements ([10566](https://github.com/pymedusa/Medusa/pull/10566))
- Add config setting to allow overriding xem url ([10541](https://github.com/pymedusa/Medusa/pull/10541))
- Increase addic7ed http request timeout ([10565](https://github.com/pymedusa/Medusa/pull/10565))
- Improve anime title parsing for `Title Season 2 - 01` ([10534](https://github.com/pymedusa/Medusa/pull/10534))
- Improve detection of commit / branch when run in docker ([10531](https://github.com/pymedusa/Medusa/pull/10531))
- Improve guessit parsing for shows with numbers in them like `9-1-1` ([10493](https://github.com/pymedusa/Medusa/pull/10493))
- Bump Knowit + pymediainfo to version 0.4.0 and 5.1.0 ([10564](https://github.com/pymedusa/Medusa/pull/10564))

#### Fixes
- Fix malformed imdb id's when imdb id not available ([10669](https://github.com/pymedusa/Medusa/pull/10669))
- Fix shows being searched 2 days early for tvmaze shows ([10668](https://github.com/pymedusa/Medusa/pull/10668))
- Disable guessit cache for postprocessing ([10532](https://github.com/pymedusa/Medusa/pull/10532))
- Fix .plexmatch file misread as xml causing warnings ([10510](https://github.com/pymedusa/Medusa/pull/10510))

## 0.5.29 (11-04-2022)

Expand Down
3 changes: 2 additions & 1 deletion medusa/providers/generic_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,8 @@ def to_json(self):
'cookies': {
'enabled': self.enable_cookies,
'values': self.cookies
}
},
'url': self.custom_url or self.url if hasattr(self, 'custom_url') else self.url
},
'animeOnly': self.anime_only,
'type': self.provider_type,
Expand Down
8 changes: 7 additions & 1 deletion medusa/server/api/v2/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def _add_torrentrss_provider(self, data):
if not data.get('url'):
return self._bad_request('No provider url provided')

new_provider = TorrentRssProvider(data.get('name'), data.get('url'), data.get('cookies', ''), data.get('titleTag', 'title'))
new_provider = TorrentRssProvider(data.get('name'), data.get('url'), data.get('cookies', {}).get('values'), data.get('titleTag', 'title'))
new_provider = self.provider_name_auto_numbered(new_provider)

app.torrentRssProviderList.append(new_provider)
Expand Down Expand Up @@ -424,6 +424,12 @@ def ordered_providers(names, providers):

@staticmethod
def _set_common_settings(provider, config):
if hasattr(provider, 'url'):
try:
provider.url = config['url']
except (AttributeError, KeyError):
pass

if hasattr(provider, 'username'):
try:
provider.username = config['username']
Expand Down
10 changes: 8 additions & 2 deletions themes-default/slim/src/components/change-indexer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import Vue from 'vue';
import { mapState } from 'vuex';
import { ChangeIndexerRow } from './manage';
import { sortShows } from '../utils/core';
export default {
name: 'change-indexer',
Expand Down Expand Up @@ -64,6 +65,7 @@ export default {
},
computed: {
...mapState({
layout: state => state.config.layout,
shows: state => state.shows.shows,
queueitems: state => state.shows.queueitems,
client: state => state.auth.client
Expand All @@ -73,14 +75,18 @@ export default {
return filteredShows.filter(show => show.checked);
},
filteredShows() {
const { allShows, filter } = this;
return allShows.filter(
const { allShows, filter, layout } = this;
const { sortArticle } = layout;
const filteredShows = allShows.filter(
show =>
(show.indexer === 'tvdb' && filter.tvdb) ||
(show.indexer === 'tvmaze' && filter.tvmaze) ||
(show.indexer === 'tmdb' && filter.tmdb) ||
(show.indexer === 'imdb' && filter.imdb)
);
return sortShows(filteredShows, sortArticle);
}
},
methods: {
Expand Down
4 changes: 4 additions & 0 deletions themes-default/slim/src/components/config-general.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@
<select id="date_preset" name="date_preset" v-model="layout.dateStyle" class="form-control input-sm max-input350">
<option :value="option.value" v-for="option in datePresetOptions" :key="option.value">{{ option.text }}</option>
</select>
<template v-if="layout.dateStyle === '%x'">
<span>Selecting <strong>System Default</strong> here, will also result in using the browsers default time format.</span>
<br>Meaning the <strong>Time Style</strong> config option below, will not have any effect on some pages.
</template>
</config-template>

<config-template label-for="time_preset" label="Time style">
Expand Down
62 changes: 27 additions & 35 deletions themes-default/slim/src/components/display-show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
<input type="hidden" id="indexer-name" value="">
<input type="hidden" id="series-slug" value="">

<show-header type="show"
ref="show-header"
@reflow="reflowLayout"
:slug="showSlug"
@update="statusQualityUpdate"
@update-overview-status="filterByOverviewStatus = $event"
<show-header
type="show"
ref="show-header"
:key="`show-header-${showSlug}`"
@reflow="reflowLayout"
:slug="showSlug"
@update="statusQualityUpdate"
@update-overview-status="filterByOverviewStatus = $event"
/>

<div class="row">
Expand Down Expand Up @@ -128,19 +130,13 @@

<span v-else-if="props.column.field == 'search'">
<div class="full-width">
<img class="epForcedSearch" :id="`${show.indexer}x${show.id[show.indexer]}x${props.row.season}x${props.row.episode}`"
:name="`${show.indexer}x${show.id[show.indexer]}x${props.row.season}x${props.row.episode}`"
:ref="`search-${props.row.slug}`" src="images/search16.png" height="16"
:alt="retryDownload(props.row) ? 'retry' : 'search'"
:title="retryDownload(props.row) ? 'Retry Download' : 'Forced Seach'"
@click="queueSearch(props.row)"
>
<app-link class="epManualSearch" :id="`${show.indexer}x${show.id[show.indexer]}x${props.row.season}x${props.row.episode}`"
:name="`${show.indexer}x${show.id[show.indexer]}x${props.row.season}x${props.row.episode}`"
:href="`home/snatchSelection?showslug=${show.id.slug}&season=${props.row.season}&episode=${props.row.episode}`"
>
<img data-ep-manual-search src="images/manualsearch.png" width="16" height="16" alt="search" title="Manual Search">
</app-link>
<search v-if="props.row.slug" :ref="`search-${props.row.slug}`" style="margin-right: 0.25rem" searchType="backlog" :showSlug="showSlug" :episode="{
episode: props.row.episode, season: props.row.season, slug: props.row.slug
}" />

<search v-if="props.row.slug" style="margin-right: 0.25rem" searchType="manual" :showSlug="showSlug" :episode="{
episode: props.row.episode, season: props.row.season, slug: props.row.slug
}" />
<img src="images/closed_captioning.png" height="16" alt="search subtitles" title="Search Subtitles" @click="searchSubtitle($event, props.row)">
</div>
<div class="mobile">
Expand Down Expand Up @@ -277,19 +273,14 @@

<span v-else-if="props.column.field == 'search'">
<div class="full-width">
<img class="epForcedSearch" :id="`${show.indexer}x${show.id[show.indexer]}x${props.row.season}x${props.row.episode}`"
:name="`${show.indexer}x${show.id[show.indexer]}x${props.row.season}x${props.row.episode}`"
:ref="`search-${props.row.slug}`" src="images/search16.png" height="16"
:alt="retryDownload(props.row) ? 'retry' : 'search'"
:title="retryDownload(props.row) ? 'Retry Download' : 'Forced Seach'"
@click="queueSearch(props.row)"
>
<app-link class="epManualSearch" :id="`${show.indexer}x${show.id[show.indexer]}x${props.row.season}x${props.row.episode}`"
:name="`${show.indexer}x${show.id[show.indexer]}x${props.row.season}x${props.row.episode}`"
:href="`home/snatchSelection?showslug=${show.id.slug}&season=${props.row.season}&episode=${props.row.episode}`"
>
<img data-ep-manual-search src="images/manualsearch.png" width="16" height="16" alt="search" title="Manual Search">
</app-link>
<search v-if="props.row.slug" :ref="`search-${props.row.slug}`" style="margin-right: 0.25rem" searchType="backlog" :showSlug="showSlug" :episode="{
episode: props.row.episode, season: props.row.season, slug: props.row.slug
}" />

<search v-if="props.row.slug" style="margin-right: 0.25rem" searchType="manual" :showSlug="showSlug" :episode="{
episode: props.row.episode, season: props.row.season, slug: props.row.slug
}" />

<img src="images/closed_captioning.png" height="16" alt="search subtitles" title="Search Subtitles" @click="searchSubtitle($event, props.row)">
</div>
<div class="mobile">
Expand Down Expand Up @@ -379,7 +370,7 @@
import debounce from 'lodash/debounce';
import Vue from 'vue';
import { mapState, mapGetters, mapActions } from 'vuex';
import { AppLink, PlotInfo, SceneNumberInput, SceneNumberAnimeInput } from './helpers';
import { AppLink, PlotInfo, Search, SceneNumberInput, SceneNumberAnimeInput } from './helpers';
import { humanFileSize } from '../utils/core';
import { manageCookieMixin } from '../mixins/manage-cookie';
import { addQTip } from '../utils/jquery';
Expand All @@ -396,6 +387,7 @@ export default {
Backstretch,
PlotInfo,
QualityPill,
Search,
SceneNumberInput,
SceneNumberAnimeInput,
ShowHeader,
Expand Down Expand Up @@ -794,7 +786,7 @@ export default {
};
episodes.forEach(episode => {
data.episodes.push(episode.slug);
this.$refs[`search-${episode.slug}`].src = 'images/loading16-dark.gif';
this.$refs[`search-${episode.slug}`].src = 'images/loading16.gif';
});
}
Expand Down Expand Up @@ -1019,7 +1011,6 @@ export default {
this.initializeEpisodes(true);
}
}
}
};
</script>
Expand Down Expand Up @@ -1099,6 +1090,7 @@ tablesorter.css
color: rgb(0, 0, 0);
text-align: left;
border-spacing: 0;
border-collapse: initial;
}
.displayShow >>> .vgt-table th,
Expand Down
4 changes: 2 additions & 2 deletions themes-default/slim/src/components/edit-show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@
</config-template>

<config-textbox-number
:min="-168"
:max="168"
:min="-672"
:max="672"
:step="1"
v-model="show.config.airdateOffset"
label="Airdate offset"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- Edit Provider -->
<div v-if="currentProvider && selectedProvider !== '#add'" class="edit-provider">
<config-textbox disabled v-model="currentProvider.name" label="Provider name" id="edit_provider_name" />
<config-textbox disabled v-model="currentProvider.url" label="Site Url" id="edit_provider_url" />
<config-textbox v-model="currentProvider.config.url" label="Site Url" id="edit_provider_url" />
<config-textbox type="password" v-model="currentProvider.config.apikey" label="Api key" id="edit_provider_api" />

<config-template label="Categories" label-for="catids">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<!-- Edit Provider -->
<div v-if="currentProvider && selectedProvider !== '#add'" class="edit-provider">
<config-textbox disabled v-model="currentProvider.name" label="Provider name" id="edit_provider_name" />
<config-textbox disabled v-model="currentProvider.url" label="Rss Url" id="edit_provider_url" />
<config-textbox v-model="currentProvider.config.cookies" label="Cookies (optional)" id="edit_provider_cookies" />
<config-textbox v-model="currentProvider.config.url" label="Rss Url" id="edit_provider_url" />
<config-textbox v-model="currentProvider.config.cookies.values" label="Cookies (optional)" id="edit_provider_cookies" />
<config-textbox v-model="currentProvider.config.titleTag" label="Search element" id="edit_provider_search_element" />

<button class="btn-medusa btn-danger torrentrss_delete" id="torrentrss_delete" @click="removeProvider">Delete</button>
Expand Down Expand Up @@ -87,7 +87,13 @@ export default {
async addProvider() {
const { name, url, cookies, searchElement } = this;
try {
const response = await this.client.api.post('providers/torrentrss', { name, url, cookies, titleTag: searchElement });
const cookieValues = {
values: cookies
};
const response = await this.client.api.post('providers/torrentrss', {
name, url, cookies: cookieValues, titleTag: searchElement
});
this.$store.commit(ADD_PROVIDER, response.data.result);
this.$snotify.success(
`Saved provider ${name}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- Edit Provider -->
<div v-if="currentProvider && selectedProvider !== '#add'" class="edit-provider">
<config-textbox disabled v-model="currentProvider.name" label="Provider name" id="edit_provider_name" />
<config-textbox disabled v-model="currentProvider.url" label="Site Url" id="edit_provider_url" />
<config-textbox v-model="currentProvider.config.url" label="Site Url" id="edit_provider_url" />
<config-textbox type="password" v-model="currentProvider.config.apikey" label="Api key" id="edit_provider_api" />

<config-template label="Categories" label-for="catids">
Expand Down Expand Up @@ -109,7 +109,7 @@ export default {
},
async getCategories() {
const { currentProvider } = this;
if (!currentProvider.name || !currentProvider.url || !currentProvider.config.apikey) {
if (!currentProvider.name || !currentProvider.config.url || !currentProvider.config.apikey) {
return;
}
Expand All @@ -118,7 +118,7 @@ export default {
type: 'GETCATEGORIES',
apikey: currentProvider.config.apikey,
name: currentProvider.name,
url: currentProvider.url
url: currentProvider.config.url
});
if (response.data.result.success) {
this.availableCategories = response.data.result.categories;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<div v-if="Object.keys(editProvider).length > 0" class="providerDiv" :id="`${editProvider.id}Div`">
<config-textbox v-if="'username' in editProvider.config && editProvider.subType !== 'newznab'" v-model="editProvider.config.username" label="Username" :id="`${editProvider.id}_username`" />

<!-- if cur_newznab_provider.default and cur_newznab_provider.needs_auth: -->
<template v-if="editProvider.default && editProvider.needsAuth">
<config-template :label-for="`${editProvider.id}_url`" label="URL">
<input type="text" :id="`${editProvider.id}_url`" :value="`${editProvider.url}`" class="form-control input-sm max-input350" disabled>
<input type="text" :id="`${editProvider.id}_url`" v-model="editProvider.config.url" class="form-control input-sm max-input350">
</config-template>
<config-textbox v-if="'apikey' in editProvider.config" v-model="editProvider.config.apikey" type="password" label="API key" :id="`${editProvider.id}_url`" input-class="newznab_api_key" />
</template>
Expand Down
Loading

0 comments on commit 4d4b919

Please sign in to comment.