Add maximum days in next episodes configuration

This commit is contained in:
mate.kavalecz 2025-05-04 02:15:27 +02:00
parent c43f09e502
commit 18c4124afa
5 changed files with 30 additions and 3 deletions

View file

@ -920,8 +920,21 @@ def get_next_episodes(item_id, limit):
if not library: if not library:
return return
result = JSONRPC("VideoLibrary.GetTVShows").execute( maxDaysInNextEpisodes = settings('maxDaysInNextEpisodes')
{ if maxDaysInNextEpisodes != 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" % maxDaysInNextEpisodes},
]
},
"properties": ["title", "studio", "mpaa", "file", "art"],
}
else:
params = {
"sort": {"order": "descending", "method": "lastplayed"}, "sort": {"order": "descending", "method": "lastplayed"},
"filter": { "filter": {
"and": [ "and": [
@ -931,7 +944,8 @@ def get_next_episodes(item_id, limit):
}, },
"properties": ["title", "studio", "mpaa", "file", "art"], "properties": ["title", "studio", "mpaa", "file", "art"],
} }
)
result = JSONRPC("VideoLibrary.GetTVShows").execute(params)
try: try:
items = result["result"]["tvshows"] items = result["result"]["tvshows"]

View file

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

View file

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

View file

@ -429,6 +429,10 @@ msgctxt "#30537"
msgid "Transcode Hi10P" msgid "Transcode Hi10P"
msgstr "Hi10P átkódolása" 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" msgctxt "#30536"
msgid "Allow the screensaver during syncs" msgid "Allow the screensaver during syncs"
msgstr "Képernyőkímélő engedélyezése szinkronizálás közben" msgstr "Képernyőkímélő engedélyezése szinkronizálás közben"

View file

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