Merge pull request #995 from mkavalecz/master

Add maximum days in next episodes configuration parameter
This commit is contained in:
Odd Stråbø 2025-05-06 00:14:06 +02:00 committed by GitHub
commit 975c45586f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 12 deletions

View file

@ -920,18 +920,27 @@ def get_next_episodes(item_id, limit):
if not library:
return
result = JSONRPC("VideoLibrary.GetTVShows").execute(
{
"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"],
}
)
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["filter"]["and"].append(
{
"operator": "inthelast",
"field": "lastplayed",
"value": "%s days" % max_days,
}
)
result = JSONRPC("VideoLibrary.GetTVShows").execute(params)
try:
items = result["result"]["tvshows"]

View file

@ -357,6 +357,10 @@ 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

@ -96,6 +96,7 @@
<category label="33109">
<!-- Plugin -->
<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" />