Merge pull request #1680 from OpenNOX/opennox/add-auto-intro-skip

Add auto skip intro functionality
This commit is contained in:
croneter 2021-10-30 18:51:33 +02:00 committed by GitHub
commit d8bb852867
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 164 additions and 31 deletions

View file

@ -2,7 +2,7 @@
# Translators:
# Croneter None <croneter@gmail.com>, 2017
# Michal Kuncl <michal.kuncl@gmail.com>, 2020
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1676,3 +1676,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Nahradit uživatelské hodnocení počtem verzí média"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -3,7 +3,7 @@
# Croneter None <croneter@gmail.com>, 2017
# Thomas H. <dontspampls@gmail.com>, 2019
# coz2001 <sallerup2001@gmail.com>, 2019
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1684,3 +1684,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Erstat brugerbedømmelser med antal af medieversioner"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -1,7 +1,7 @@
# XBMC Media Center language file
# Translators:
# Croneter None <croneter@gmail.com>, 2021
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1713,3 +1713,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Benutzerbewertungen durch verfügbare Anzahl Versionen ersetzen"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -1,7 +1,7 @@
# XBMC Media Center language file
# Translators:
# Croneter None <croneter@gmail.com>, 2017
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1601,3 +1601,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -1139,12 +1139,12 @@ msgctxt "#39082"
msgid "Direct Paths"
msgstr ""
# Dialog for manually entering PMS
# Dialog for manually entering PMS
msgctxt "#39083"
msgid "Enter PMS IP or URL"
msgstr ""
# Dialog for manually entering PMS
# Dialog for manually entering PMS
msgctxt "#39084"
msgid "Enter PMS port"
msgstr ""
@ -1501,3 +1501,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -1,7 +1,7 @@
# XBMC Media Center language file
# Translators:
# Croneter None <croneter@gmail.com>, 2020
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1699,3 +1699,8 @@ msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
"Reemplazar valoraciones de usuario con cantidad de versiones de medios"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -3,7 +3,7 @@
# Dani <danichispa@gmail.com>, 2019
# Bartolome Soriano <bsoriano@gmail.com>, 2019
# Croneter None <croneter@gmail.com>, 2020
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1701,3 +1701,8 @@ msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
"Reemplazar valoraciones de usuario con cantidad de versiones de medios"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -1,7 +1,7 @@
# XBMC Media Center language file
# Translators:
# Croneter None <croneter@gmail.com>, 2020
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1699,3 +1699,8 @@ msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
"Reemplazar valoraciones de usuario con cantidad de versiones de medios"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -3,7 +3,7 @@
# Elixir59, 2019
# Croneter None <croneter@gmail.com>, 2020
# Raph Mell, 2020
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1719,3 +1719,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Remplacer les notes d'utilisateurs par le nombre de versions du média"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -7,7 +7,7 @@
# julien benoist <jbnitro@hotmail.fr>, 2019
# Croneter None <croneter@gmail.com>, 2020
# Raph Mell, 2020
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1723,3 +1723,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Remplacer les notes d'utilisateurs par le nombre de versions du média"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -2,7 +2,7 @@
# Translators:
# Croneter None <croneter@gmail.com>, 2019
# Savage93 <savageistheking@gmail.com>, 2021
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1712,3 +1712,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Felhasználói osztályzatok lecserélése a médiaverziók számára"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -4,7 +4,7 @@
# Angela Calò <angycalo@libero.it>, 2018
# Cristiano Bozzi <c.bozzi@nextworks.it>, 2018
# Luigi Mantellini <luigi.mantellini@gmail.com>, 2019
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1711,3 +1711,8 @@ msgid "Replace user ratings with number of media versions"
msgstr ""
"Sostituisci la valutazione contenuti con il numero delle versioni del "
"contenuto disponibili"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -7,7 +7,7 @@
# k irbymaker <hun010811@naver.com>, 2020
# Croneter None <croneter@gmail.com>, 2021
# so.o.bima <cjhamo@naver.com>, 2021
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1632,3 +1632,8 @@ msgstr "사용자 지정 사용자 등급을 보유하고있는 미디어 항목
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "사용자 등급을 미디어 버전 수로 대체"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -2,7 +2,7 @@
# Translators:
# tigriso1 <tigriso1@outlook.com>, 2019
# Egidijus Mz <sixpilot80@yahoo.com>, 2019
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1697,3 +1697,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Pakeiskite naudotojų reitingus medijos versijų skaičiumi"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -1,7 +1,7 @@
# XBMC Media Center language file
# Translators:
# marcisbe <marcisbe@gmail.com>, 2020
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1632,3 +1632,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -5,7 +5,7 @@
# Panja0 <panja0@protonmail.com>, 2019
# Nick Corthals <corthals.nick@gmail.com>, 2019
# Rick van Soest <r.vansoest@gmail.com>, 2019
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1683,3 +1683,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Vervang ratings met aantal media versies"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -3,7 +3,7 @@
# Croneter None <croneter@gmail.com>, 2017
# Jon Mjørud <jon.mjorud@gmail.com>, 2017
# Kyb ntnu, 2019
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1677,3 +1677,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Erstatt rating med antall versjoner av media"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -4,7 +4,7 @@
# Wiktor Dackiewicz <wiktor.dackiewicz@gmail.com>, 2017
# Kacpolz <kacperbrzozowski123@gmail.com>, 2019
# Ziuta <spam210195@gmail.com>, 2020
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1606,3 +1606,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -2,7 +2,7 @@
# Translators:
# Croneter None <croneter@gmail.com>, 2017
# Daniel Leite <danieldefreitasleite@gmail.com>, 2019
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1674,3 +1674,8 @@ msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
"Substituir classificações do utilizador com numero de versões de média"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -3,7 +3,7 @@
# Croneter None <croneter@gmail.com>, 2017
# Goncalo Campos <gda_campos@hotmail.com>, 2018
# Bruno Guerreiro <american.jesus.pt@gmail.com>, 2019
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1677,3 +1677,8 @@ msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
"Substituir classificações do utilizador com numero de versões de média"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -6,7 +6,7 @@
# Alex Freit <alex.nx@mail.ru>, 2019
# Vladimir Supranenok <stark_v@mail.ru>, 2019
# Vlad Anisimov <uniss@ua.fm>, 2019
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1691,3 +1691,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Заменить пользовательский рейтинг счетчиком версий элемента"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -7,7 +7,7 @@
# Nisse Karlsson <transifex@xcorp.at>, 2019
# Ludwig Johnson <public@ludwigjohnson.se>, 2019
# namob <boman.d@gmail.com>, 2021
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1685,3 +1685,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Ersätt användarbetyg med antalet mediaobjekt"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -1,7 +1,7 @@
# XBMC Media Center language file
# Translators:
# Vlad Anisimov <uniss@ua.fm>, 2020
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1691,3 +1691,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr "Замінити користувацький рейтинг лічильником версій елемента"
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -3,7 +3,7 @@
# Croneter None <croneter@gmail.com>, 2017
# Tony Z <zj45499@gmail.com>, 2017
# Jingen Chen <jingen.chen@gmail.com>, 2019
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1602,3 +1602,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -1,7 +1,7 @@
# XBMC Media Center language file
# Translators:
# Croneter None <croneter@gmail.com>, 2017
#
#
msgid ""
msgstr ""
"Project-Id-Version: PlexKodiConnect\n"
@ -1598,3 +1598,8 @@ msgstr ""
msgctxt "#39719"
msgid "Replace user ratings with number of media versions"
msgstr ""
# PKC Settings - Playback
msgctxt "#39720"
msgid "Auto skip intro"
msgstr ""

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .windows.skip_intro import SkipIntroDialog
from . import app, variables as v
from . import app, utils, variables as v
def skip_intro(intros):
@ -20,7 +20,11 @@ def skip_intro(intros):
'default',
'1080i',
intro_end=end)
app.APP.skip_intro_dialog.show()
if utils.settings('enableAutoSkipIntro') == "true":
app.APP.skip_intro_dialog.seekTimeToIntroEnd()
else:
app.APP.skip_intro_dialog.show()
elif not in_intro and app.APP.skip_intro_dialog is not None:
app.APP.skip_intro_dialog.close()
app.APP.skip_intro_dialog = None

View file

@ -36,12 +36,15 @@ class SkipIntroDialog(WindowXMLDialog):
logger.debug('Closing dialog')
WindowXMLDialog.close(self)
def seekTimeToIntroEnd(self):
logger.info('Skipping intro, seeking to %s', self.intro_end)
app.APP.player.seekTime(self.intro_end)
def onClick(self, control_id): # pylint: disable=invalid-name
if self.intro_end and control_id == 3002: # 3002 = Skip Intro button
if app.APP.is_playing:
self.on_hold = True
logger.info('Skipping intro, seeking to %s', self.intro_end)
app.APP.player.seekTime(self.intro_end)
self.seekTimeToIntroEnd()
self.close()
def onAction(self, action): # pylint: disable=invalid-name

View file

@ -114,6 +114,7 @@
<setting id="askCinema" type="bool" label="30519" default="false" visible="eq(-1,true)" subsetting="true" />
<setting id="trailerNumber" type="slider" label="39000" default="3" visible="eq(-2,true)" range="1,1,15" option="int" />
<setting id="enableSkipIntro" type="bool" label="30525" default="true" /><!-- Enable skipping of intros -->
<setting id="enableAutoSkipIntro" type="bool" label="39720" default="false" visible="eq(-1,true)" subsetting="true" /><!-- Enable auto skipping of intros -->
<setting id="firstVideoStream" type="bool" label="30546" default="false" /><!-- Pick the first video if several versions are present -->
<setting id="audioStreamPick" type="enum" label="30547" values="Plex|Kodi" default="0" /><!-- Who picks the audio stream on playback start? -->
<setting id="subtitleStreamPick" type="enum" label="30548" values="Plex|Kodi" default="0" /><!-- Who picks subtitles on playback start? -->
@ -142,7 +143,7 @@
</category>
<category label="30544"><!-- artwork -->
<setting id="usePlexArtwork" label="30502" type="bool" default="true" /> <!-- Sync Plex artwork from the PMS -->
<setting id="usePlexArtwork" label="30502" type="bool" default="true" /> <!-- Sync Plex artwork from the PMS -->
<setting id="enableTextureCache" label="30512" type="bool" default="true" visible="eq(-1,true)"/> <!-- Cache all artwork for a smooth Kodi experience -->
<setting id="FanartTV" label="30539" type="bool" default="false" visible="eq(-2,true)"/><!-- Download additional art from FanArtTV -->
<setting id="PreferKodiCollectionArt" label="30543" type="bool" default="true" visible="eq(-1,true) + eq(-3,true)" subsetting="true" /><!-- Prefer Kodi artwork for collections -->