(2020-11-15, 18:02)FXB78 Wrote: You are missing the point, what if your show has only 20 seconds of credits, and you set it to play the next episode with 50 seconds remaining (60 secs minus the 10 it shows the notification). In that scenario you're missing the last 30 seconds of the show. So the current way leaves it in the users hands to simply press one button to play the next episode.
No FX, you're missing the point. The majority of shows run credits for a minimum of 30 seconds, which would explain why the default setting for the notification to pop up is 30 seconds. I say minimum 30 seconds, because I have yet to see any show or movie with credits that run less than that, in fact most credits run for well over 60 seconds. Having a minimum and maximum setting would allow users to play with the settings to find a happy medium of when the notification appears, and how long it stays up before playing the next file.
The addon already calculates the file's playing time, and uses that with the settings the user selects.
An example of what I'm referring to... In the settings.xml this code sets the auto play time length:
xml:
<category label="30600"> <!-- Behaviour -->
<setting label="30603" type="enum" id="autoPlayMode" lvalues="30040|30041" default="0"/>
<setting label="30032" type="bool" id="enablePlaylist" default="false"/>
<setting label="30605" type="bool" id="includeWatched" default="false"/>
<setting label="30607" type="slider" id="playedInARow" default="3" range="0,1,15" option="int"/>
<setting label="30609" type="lsep"/> <!-- Autoplay duration -->
<setting label="30611" type="bool" id="customAutoPlayTime" default="true"/>
<setting label="30613" type="slider" id="autoPlaySeasonTime" default="30" range="0,5,120" option="int" subsetting="true" visible="eq(-1,false)"/>
<setting label="30615" type="slider" id="autoPlayTimeXS" default="15" range="0,5,120" option="int" subsetting="true" visible="eq(-2,true)"/>
<setting label="30617" type="slider" id="autoPlayTimeS" default="30" range="0,5,120" option="int" subsetting="true" visible="eq(-3,true)"/>
<setting label="30619" type="slider" id="autoPlayTimeM" default="40" range="0,5,120" option="int" subsetting="true" visible="eq(-4,true)"/>
<setting label="30621" type="slider" id="autoPlayTimeL" default="50" range="0,5,120" option="int" subsetting="true" visible="eq(-5,true)"/>
<setting label="30623" type="slider" id="autoPlayTimeXL" default="60" range="0,5,120" option="int" subsetting="true" visible="eq(-6,true)"/>
</category>
The code in the xml file calls to the python scripts to execute the proper function, such as:
python:
# Some consumers send the offset when the credits start (e.g. Netflix)
if total_time and self.data.get('notification_offset'):
return total_time - int(self.data.get('notification_offset'))
# Use a customized notification time, when configured
if total_time and get_setting_bool('customAutoPlayTime'):
if total_time > 60 * 60:
return get_setting_int('autoPlayTimeXL')
if total_time > 40 * 60:
return get_setting_int('autoPlayTimeL')
if total_time > 20 * 60:
return get_setting_int('autoPlayTimeM')
if total_time > 10 * 60:
return get_setting_int('autoPlayTimeS')
return get_setting_int('autoPlayTimeXS')
In the script.py file for UpNext I found this code:
python:
def test_popup(window):
popup = TestPopup(window, addon_path(), 'default', '1080i')
popup.show()
step = 0
wait = 100
wait_s = wait / 1000
timeout = 10000
monitor = Monitor()
while popup and step < timeout and not monitor.abortRequested():
if popup.pause:
continue
monitor.waitForAbort(wait_s)
popup.update_progress_control(timeout, wait)
step += wait
If I'm correct the timeout setting is possibly the time the window remains visible, or waits for the user to perform an action or not, such as pressing the enter key to play the next episode now or not....
From the playbackmanager.py file I see this code:
python:
def extract_play_info(self, next_up_page, showing_next_up_page, showing_still_watching_page, still_watching_page):
if showing_next_up_page:
next_up_page.close()
should_play_default = not next_up_page.is_cancel()
should_play_non_default = next_up_page.is_watch_now()
elif showing_still_watching_page:
still_watching_page.close()
should_play_default = still_watching_page.is_still_watching()
should_play_non_default = still_watching_page.is_still_watching()
So.... In the XML file, adding code to allow the user to set a maximum time for the window to show, in addition to the minimum time for the window to appear. This would make the call to the python script, most likely the playbackmanager.py or the monitor.py file, to the new code such as:
pthyon:
event(message='NEXTUPWATCHEDSIGNAL', data=dict(episodeid=self.state.current_episode_id), encoding='base64')
if playlist_item or self.state.queued:
try:
play_time = self.player.getTime()
total_time = self.player.getMAXTime()
# Play playlist media
if should_play_default:
self.player.playnext()
I added the code 'total_time = self.player.getMAXTime()' as an example. The MAXTime definition would have to be set of course, and would be set by the user's choice in the maximum time setting....
I'm not saying it would be easy, I don;t know if it would be or not. I know there would need to be at least two files that need to be modified, most likely more from what I'm seeing by going through the files to find out how it works. I use to code with C and C++ waaaaaay back in the day, but have never played with python. So I'm not familiar with how it all works... But I know this could be done.