Merge branch 'main' into dev

This commit is contained in:
JackDandy 2023-02-10 16:08:11 +00:00
commit b3eaa09555
5 changed files with 35 additions and 30 deletions

View file

@ -1,4 +1,10 @@
### 3.27.0 (2023-02-09 15:00:00 UTC) ### 3.27.1 (2023-02-10 15:25:00 UTC)
* Change display show status in Change show header
* Fix TMDB language caching
### 3.27.0 (2023-02-09 15:00:00 UTC)
* Update Apprise 0.8.5 (55a2edc) to 1.2.1 (3d07004) * Update Apprise 0.8.5 (55a2edc) to 1.2.1 (3d07004)
* Update attr 20.3.0 (f3762ba) to 22.2.0 (a9960de) * Update attr 20.3.0 (f3762ba) to 22.2.0 (a9960de)

View file

@ -64,13 +64,12 @@
.select2-results__group{color: #eee; background-color: rgb(51,51,51)} .select2-results__group{color: #eee; background-color: rgb(51,51,51)}
.select2-results__options .select2-results__option{color: #222; background-color: #ddd} .select2-results__options .select2-results__option{color: #222; background-color: #ddd}
.select2-results__options .select2-results__option .ended{color: #888} .select2-results__options .select2-results__option .ended{color: #888}
#select2-pickShow-results .select2-results__option .ended .label{background-color: #888; padding: 1px 4px; margin-right: 2px; line-height: 2; color: #ddd !important} .select2-container .ended .label{background-color: #888; padding: 1px 4px; margin-right: 2px; line-height: 2; color: #ddd !important}
.select2-results__option--selected span{color:rgb(143, 21, 21) !important}
.select2-container--default .select2-results > .select2-results__options{max-height: 300px} .select2-container--default .select2-results > .select2-results__options{max-height: 300px}
#select2-pickShow-results .select2-results__option, #select2-pickShow-results .select2-results__option,
#select2-pickShow-results .select2-results__group{padding-top: 2px !important; padding-bottom:2px !important} #select2-pickShow-results .select2-results__group{padding-top: 2px !important; padding-bottom:2px !important}
#select2-pickShow-results .select2-results__option--highlighted.select2-results__option--selectable .ended{color:white} #select2-pickShow-results .select2-results__option--highlighted.select2-results__option--selectable .ended{color:white}
#select2-pickShow-results .select2-results__option--selected,
#select2-pickShow-results .select2-results__option--selected span{color:rgb(143, 21, 21) !important}
</style> </style>
<div class="bfr"><img src="$sbRoot/images/loading16${theme_suffix}.gif"><img src="$sbRoot/images/loading16-red.gif"><img src="$sbRoot/images/queued.png"><img src="$sbRoot/images/search16.png"><img src="$sbRoot/images/no16.png"><img src="$sbRoot/images/yes16.png"><img src="$sbRoot/images/down-success.png"><img src="$sbRoot/images/down-upgrade.png"></div> <div class="bfr"><img src="$sbRoot/images/loading16${theme_suffix}.gif"><img src="$sbRoot/images/loading16-red.gif"><img src="$sbRoot/images/queued.png"><img src="$sbRoot/images/search16.png"><img src="$sbRoot/images/no16.png"><img src="$sbRoot/images/yes16.png"><img src="$sbRoot/images/down-success.png"><img src="$sbRoot/images/down-upgrade.png"></div>

View file

@ -11,20 +11,19 @@
$(document).ready(function() { $(document).ready(function() {
// handle the show selection dropbox // handle the show selection dropbox
var select$ = $('#pickShow'); var select$ = $('#pickShow'), populateItem;
select$.change(function() { select$.change(function() {
var val = $(this).val(); var val = $(this).val();
if (0 !== val) if (0 !== val)
window.location.href = $.SickGear.Root + '/home/view-show?tvid_prodid=' + val; window.location.href = $.SickGear.Root + '/home/view-show?tvid_prodid=' + val;
}); });
select$.select2({ populateItem = function(data) {
templateResult: function(data){
if (!data.element || !$(data.element).hasClass('ended')) { if (!data.element || !$(data.element).hasClass('ended')) {
return data.text; return data.text;
} }
return $('<span class="ended"><span class="label" title="">ended</span> <i>' + data.text + '</i></span>'); return $('<span class="ended"><span class="label" title="">ended</span> <i>' + data.text + '</i></span>');
} }
}); select$.select2({templateResult: populateItem, templateSelection:populateItem});
$('#prevShow, #nextShow').on('click', function() { $('#prevShow, #nextShow').on('click', function() {
var select$ = $('#pickShow'), var select$ = $('#pickShow'),

View file

@ -76,7 +76,7 @@ def get_tmdb_constants():
# type: (...) -> Dict # type: (...) -> Dict
"""return tmdbsimple Configuration().info() or cached copy""" """return tmdbsimple Configuration().info() or cached copy"""
global _TMDB_CONSTANTS_CACHE global _TMDB_CONSTANTS_CACHE
# only retrieve info data if older then 3 days # only retrieve info data if older than 3 days
if 3 < (datetime.datetime.now() - _TMDB_CONSTANTS_CACHE['date']).days or not _TMDB_CONSTANTS_CACHE['data']: if 3 < (datetime.datetime.now() - _TMDB_CONSTANTS_CACHE['date']).days or not _TMDB_CONSTANTS_CACHE['data']:
try: try:
tv_genres = {g['id']: g['name'] for g in tmdbsimple.Genres().tv_list()['genres']} tv_genres = {g['id']: g['name'] for g in tmdbsimple.Genres().tv_list()['genres']}
@ -520,10 +520,10 @@ class TmdbIndexer(TVInfoBase):
number of votes, genres, the network they aired on and air dates. number of votes, genres, the network they aired on and air dates.
Discover also supports a nice list of sort options. See below for all Discover also supports a nice list of sort options. See below for all
of the available options. the available options.
Also note that a number of filters support being comma (,) or pipe (|) Also note that a number of filters support being comma (,) or pipe (|)
separated. Comma's are treated like an AND and query while pipe's are separated. Commas are treated like an AND query while pipe's are
an OR. an OR.
Some examples of what can be done with discover can be found at Some examples of what can be done with discover can be found at
@ -539,23 +539,23 @@ class TmdbIndexer(TVInfoBase):
popularity.desc, popularity.asc popularity.desc, popularity.asc
Default: popularity.desc Default: popularity.desc
air_date.gte: (optional) Filter and only include TV shows that have air_date.gte: (optional) Filter and only include TV shows that have
a air date (by looking at all episodes) that is greater or an air date (by looking at all episodes) that is greater or
equal to the specified value. equal to the specified value.
air_date.lte: (optional) Filter and only include TV shows that have air_date.lte: (optional) Filter and only include TV shows that have
a air date (by looking at all episodes) that is less than or an air date (by looking at all episodes) that is less than or
equal to the specified value. equal to the specified value.
first_air_date.gte: (optional) Filter and only include TV shows first_air_date.gte: (optional) Filter and only include TV shows
that have a original air date that is greater or equal to the that have an original air date that is greater or equal to the
specified value. Can be used in conjunction with the specified value. Can be used in conjunction with the
"include_null_first_air_dates" filter if you want to include "include_null_first_air_dates" filter if you want to include
items with no air date. items with no air date.
first_air_date.lte: (optional) Filter and only include TV shows first_air_date.lte: (optional) Filter and only include TV shows
that have a original air date that is less than or equal to the that have an original air date that is less than or equal to the
specified value. Can be used in conjunction with the specified value. Can be used in conjunction with the
"include_null_first_air_dates" filter if you want to include "include_null_first_air_dates" filter if you want to include
items with no air date. items with no air date.
first_air_date_year: (optional) Filter and only include TV shows first_air_date_year: (optional) Filter and only include TV shows
that have a original air date year that equal to the specified that have an original air date year that equal to the specified
value. Can be used in conjunction with the value. Can be used in conjunction with the
"include_null_first_air_dates" filter if you want to include "include_null_first_air_dates" filter if you want to include
items with no air date. items with no air date.
@ -760,9 +760,9 @@ class TmdbIndexer(TVInfoBase):
@property @property
def _tmdb_supported_lang_list(self): def _tmdb_supported_lang_list(self):
if None is self._tmdb_lang_list: if not TmdbIndexer._tmdb_lang_list:
self._get_languages() self._get_languages()
return self._tmdb_lang_list return TmdbIndexer._tmdb_lang_list
def _get_languages(self): def _get_languages(self):
# type: (...) -> None # type: (...) -> None
@ -772,10 +772,11 @@ class TmdbIndexer(TVInfoBase):
except (BaseException, Exception): except (BaseException, Exception):
lang_data = None lang_data = None
if lang_data: if lang_data:
self._supported_languages = [{'id': clean_data(a['iso_639_1']), 'name': clean_data(a['english_name']), TmdbIndexer._supported_languages = [{
'nativeName': clean_data(a['name']), 'id': clean_data(a['iso_639_1']), 'name': clean_data(a['english_name']),
'shortCode': None, 'sg_lang': clean_data(a['iso_639_1'])} 'nativeName': clean_data(a['name']), 'shortCode': None, 'sg_lang': clean_data(a['iso_639_1'])
for a in sorted(lang_data, key=lambda b: b['iso_639_1'])] } for a in sorted(lang_data, key=lambda b: b['iso_639_1'])]
self._tmdb_lang_list = [a['id'] for a in self._supported_languages] TmdbIndexer._tmdb_lang_list = [a['id'] for a in self._supported_languages]
else: else:
self._supported_languages = [] TmdbIndexer._supported_languages = []
TmdbIndexer._tmdb_lang_list = []

View file

@ -1347,9 +1347,9 @@ class TVInfoBase(object):
get all supported languages as list of dicts get all supported languages as list of dicts
[{'id': 'lang code', 'name': 'english name', 'nativeName': 'native name', 'sg_lang': 'sg lang code'}] [{'id': 'lang code', 'name': 'english name', 'nativeName': 'native name', 'sg_lang': 'sg lang code'}]
""" """
if None is self._supported_languages: if not self._supported_languages:
self._get_languages() self._get_languages()
return self._supported_languages return self._supported_languages or []
def __str__(self): def __str__(self):
return '<TVInfo(%s) (containing: %s)>' % (self.__class__.__name__, text_type(self.shows)) return '<TVInfo(%s) (containing: %s)>' % (self.__class__.__name__, text_type(self.shows))