Reduce duplication

Adjust settings defaults
Remove translations (use weblate, en_gb is source)
Format with black
This commit is contained in:
Odd Stråbø 2025-05-05 22:07:46 +00:00
parent 937aff24f3
commit a32aff25e2
4 changed files with 19 additions and 32 deletions

View file

@ -920,30 +920,25 @@ def get_next_episodes(item_id, limit):
if not library:
return
max_days = settings('maxDaysInNextEpisodes')
max_days = settings("maxDaysInNextEpisodes")
params = {
"sort": {"order": "descending", "method": "lastplayed"},
"filter": {
"and": [
{"operator": "true", "field": "inprogress", "value": ""},
{"operator": "is", "field": "tag", "value": "%s" % library},
]
},
"properties": ["title", "studio", "mpaa", "file", "art"],
}
if max_days != 0:
params = {
"sort": {"order": "descending", "method": "lastplayed"},
"filter": {
"and": [
{"operator": "true", "field": "inprogress", "value": ""},
{"operator": "is", "field": "tag", "value": "%s" % library},
{"operator": "inthelast", "field": "lastplayed", "value": "%s days" % max_days},
]
},
"properties": ["title", "studio", "mpaa", "file", "art"],
}
else:
params = {
"sort": {"order": "descending", "method": "lastplayed"},
"filter": {
"and": [
{"operator": "true", "field": "inprogress", "value": ""},
{"operator": "is", "field": "tag", "value": "%s" % library},
]
},
"properties": ["title", "studio", "mpaa", "file", "art"],
}
params["filter"]["and"].append(
{
"operator": "inthelast",
"field": "lastplayed",
"value": "%s days" % max_days,
}
)
result = JSONRPC("VideoLibrary.GetTVShows").execute(params)

View file

@ -321,10 +321,6 @@ msgctxt "#30537"
msgid "Transcode Hi10P"
msgstr "Transcode Hi10P"
msgctxt "#30538"
msgid "Max days in next episodes"
msgstr "Max days in next episodes"
msgctxt "#30539"
msgid "Login"
msgstr "Login"

View file

@ -429,10 +429,6 @@ msgctxt "#30537"
msgid "Transcode Hi10P"
msgstr "Hi10P átkódolása"
msgctxt "#30538"
msgid "Max days in next episodes"
msgstr "Maximális napok száma a következő epizódoknál"
msgctxt "#30536"
msgid "Allow the screensaver during syncs"
msgstr "Képernyőkímélő engedélyezése szinkronizálás közben"

View file

@ -96,7 +96,7 @@
<category label="33109">
<!-- Plugin -->
<setting id="maxDaysInNextEpisodes" label="30538" type="slider" default="365" range="0, 1, 1000" option="int" />
<setting id="maxDaysInNextEpisodes" label="30538" type="slider" default="366" range="0, 1, 732" option="int" />
<setting id="ignoreSpecialsNextEpisodes" type="bool" label="30527" default="false" />
<setting id="getCast" type="bool" label="33124" default="false" />
<setting id="remoteControl" type="bool" label="33125" default="true" />