def trivia_intro( self ):
     utils.log( "## Intro ##", xbmc.LOGNOTICE )
     _clear_playlists( "video" )
     play_list = playlist
     # initialize intro lists
     playlist_intro = []
     # get trivia intro videos
     _get_special_items( playlist=play_list,
                            items=video_settings[ "trivia_intro" ],
                             path=( video_settings[ "trivia_intro_file" ], video_settings[ "trivia_intro_folder" ], )[ video_settings[ "trivia_intro_type" ] == "folder" ],
                            genre= "Trivia Intro",
                            index=0,
                       media_type="video"
                       )
     if not video_settings[ "trivia_intro" ] == 0:
         self.player.play( play_list )
Beispiel #2
0
 def trivia_intro(self):
     utils.log("## Intro ##", xbmc.LOGNOTICE)
     _clear_playlists("video")
     play_list = playlist
     # initialize intro lists
     playlist_intro = []
     # get trivia intro videos
     _get_special_items(playlist=play_list,
                        items=video_settings["trivia_intro"],
                        path=(
                            video_settings["trivia_intro_file"],
                            video_settings["trivia_intro_folder"],
                        )[video_settings["trivia_intro_type"] == "folder"],
                        genre="Trivia Intro",
                        index=0,
                        media_type="video")
     if not video_settings["trivia_intro"] == 0:
         self.player.play(play_list)
 # check to see if an argv has been passed to script
 xbmcgui.Window( 10025 ).setProperty( "CinemaExperienceRunning", "True" )
 from ce_player import Script
 try:
     try:
         if sys.argv[ 1 ]:
             utils.log( 'Script Started With: %s' % sys.argv[ 1 ], xbmc.LOGNOTICE )
             try:
                 _command = ""
                 titles = ""
                 if sys.argv[ 1 ] == "ClearWatchedTrivia" or sys.argv[ 1 ] == "ClearWatchedTrailers":
                     _clear_watched_items( sys.argv[ 1 ] )
                     exit = True
                 elif sys.argv[ 1 ] == "oldway":
                     __addon__.setSetting( id='number_of_features', value='0' ) # set number of features to 1
                     _clear_playlists()
                     xbmc.sleep( 250 )
                     xbmc.executebuiltin( "Action(Queue,%d)" % ( xbmcgui.getCurrentWindowId() - 10000, ) )
                     utils.log( "Action(Queue,%d)" % ( xbmcgui.getCurrentWindowId() - 10000, ), xbmc.LOGNOTICE )
                     # we need to sleep so the video gets queued properly
                     xbmc.sleep( 250 )
                     exit = Script().start_script( "oldway" )
                 elif sys.argv[ 1 ] == "fromplay":
                     xbmc.sleep( 250 )
                     exit = Script().start_script( "oldway" )
                 elif sys.argv[ 1 ].startswith( "command" ):   # Command Arguments
                     _sys_arg = sys.argv[ 1 ].replace("<li>",";")
                     _command = re.split(";", _sys_arg, maxsplit=1)[1]
                     utils.log( "Command Call: %s" % _command, xbmc.LOGNOTICE )
                     if _command.startswith( "movie_title" ):   # Movie Title
                         _clear_playlists()
Beispiel #4
0
try:
    if sys.argv[1]:
        utils.log('Script Started With: %s' % sys.argv[1],
                  xbmc.LOGNOTICE)
        try:
            _command = ""
            titles = ""
            if sys.argv[1] == "ClearWatchedTrivia" or sys.argv[
                    1] == "ClearWatchedTrailers":
                _clear_watched_items(sys.argv[1])
                exit = True
            elif sys.argv[1] == "oldway":
                __addon__.setSetting(
                    id='number_of_features',
                    value='0')  # set number of features to 1
                _clear_playlists()
                xbmc.sleep(250)
                xbmc.executebuiltin(
                    "Action(Queue,%d)" %
                    (xbmcgui.getCurrentWindowId() - 10000, ))
                utils.log(
                    "Action(Queue,%d)" %
                    (xbmcgui.getCurrentWindowId() - 10000, ),
                    xbmc.LOGNOTICE)
                # we need to sleep so the video gets queued properly
                xbmc.sleep(250)
                exit = Script().start_script("oldway")
            elif sys.argv[1] == "fromplay":
                xbmc.sleep(250)
                exit = Script().start_script("oldway")
            elif sys.argv[1].startswith(
 def start_script(self, library_view="oldway"):
     messy_exit = False
     log("Library_view: %s" % library_view, xbmc.LOGNOTICE)
     early_exit = False
     movie_next = False
     prev_trigger = None
     if library_view != "oldway":
         xbmc.executebuiltin("ActivateWindow(videolibrary,%s,return)" %
                             library_view)
         # wait until Video Library shows
         while not xbmc.getCondVisibility("Container.Content(movies)"):
             pass
         if feature_settings["enable_notification"]:
             xbmc.executebuiltin(
                 "Notification( %s, %s, %d, %s)" %
                 (header, __language__(32546), 300000, image))
         # wait until playlist is full to the required number of features
         log(
             "Waiting for queue to be filled with %s Feature films" %
             number_of_features, xbmc.LOGNOTICE)
         count = 0
         while playlist.size() < number_of_features:
             if playlist.size() > count:
                 log(
                     "User queued %s of %s Feature films" %
                     (playlist.size(), number_of_features), xbmc.LOGNOTICE)
                 header1 = header + " - Feature " + "%d" % playlist.size()
                 message = __language__(32543) + playlist[
                     playlist.size() - 1].getdescription()
                 if feature_settings["enable_notification"]:
                     xbmc.executebuiltin(
                         "Notification( %s, %s, %d, %s)" %
                         (header1, message, time_delay, image))
                 count = playlist.size()
                 xbmc.sleep(time_delay * 2)
             if not xbmc.getCondVisibility("Container.Content(movies)"):
                 early_exit = True
                 break
         log("User queued %s Feature films" % playlist.size(),
             xbmc.LOGNOTICE)
         if not early_exit:
             header1 = header + " - Feature " + "%d" % playlist.size()
             message = __language__(32543) + playlist[playlist.size() -
                                                      1].getdescription()
             if feature_settings["enable_notification"]:
                 xbmc.executebuiltin("Notification( %s, %s, %d, %s)" %
                                     (header1, message, time_delay, image))
             early_exit = False
     # If for some reason the limit does not get reached and the window changed, cancel script
     if playlist.size() < number_of_features and library_view != "oldway":
         if feature_settings["enable_notification"]:
             xbmc.executebuiltin(
                 "Notification( %s, %s, %d, %s)" %
                 (header, __language__(32544), time_delay, image))
         _clear_playlists()
     else:
         mpaa, audio, genre, movie, equivalent_mpaa = _get_queued_video_info(
             feature=0)
         plist = _store_playlist()  # need to store movie playlist
         self._play_trivia(mpaa, genre, plist, equivalent_mpaa)
         mplaylist = xbmc.PlayList(xbmc.PLAYLIST_MUSIC)
         mplaylist.clear()
         trigger_list = self.load_trigger_list()
         self.player.play(playlist)
         count = -1
         stop_check = 0
         paused = False
         # wait until fullscreen video is shown
         while not xbmc.getCondVisibility(
                 "Window.IsActive(fullscreenvideo)"):
             pass
         while not playlist.getposition() == (playlist.size() - 1):
             if playlist.getposition() > count:
                 try:
                     log(
                         "Item From Trigger List: %s" %
                         trigger_list[playlist.getposition()],
                         xbmc.LOGNOTICE)
                 except:
                     log("Problem With Trigger List", xbmc.LOGNOTICE)
                 log(
                     "Playlist Position: %s  Playlist Size: %s " %
                     ((playlist.getposition() + 1), (playlist.size())),
                     xbmc.LOGNOTICE)
                 if not playlist.getposition() == (playlist.size() - 1):
                     prev_trigger = Launch_automation().launch_automation(
                         trigger_list[playlist.getposition()], prev_trigger)
                     count = playlist.getposition()
                 else:
                     break  # Reached the last item in the playlist
             try:
                 #if not self.player.isPlayingVideo() and not is_paused:
                 if not xbmc.getCondVisibility(
                         "Window.IsActive(fullscreenvideo)"):
                     log("Video may have stopped", xbmc.LOGNOTICE)
                     xbmc.sleep(
                         5000
                     )  # wait 5 seconds for fullscreen video to show up(during playback)
                     if not xbmc.getCondVisibility(
                             "Window.IsActive(fullscreenvideo)"
                     ):  # if fullscreen video does not show up, break and exit script
                         messy_exit = True
                         break
             except:
                 if xbmc.getCondVisibility("Container.Content(movies)"):
                     log("Video Definitely Stopped", xbmc.LOGNOTICE)
                     messy_exit = True
                     break
         if not playlist.size(
         ) < 1 and not messy_exit:  # To catch an already running script when a new instance started
             log(
                 "Playlist Position: %s  Playlist Size: %s " %
                 (playlist.getposition() + 1, (playlist.size())),
                 xbmc.LOGNOTICE)
             prev_trigger = Launch_automation().launch_automation(
                 trigger_list[playlist.getposition()], prev_trigger)
             if trigger_list[playlist.getposition()] == "Movie":
                 log(
                     "Item From Trigger List: %s" %
                     trigger_list[playlist.getposition()], xbmc.LOGNOTICE)
             else:
                 log(
                     "Item From Trigger List: %s" %
                     trigger_list[playlist.getposition()], xbmc.LOGNOTICE)
             messy_exit = False
             xbmc.sleep(1000)
             self._wait_until_end()
         else:
             log("User might have pressed stop", xbmc.LOGNOTICE)
             log("Stopping Script", xbmc.LOGNOTICE)
             messy_exit = False
     return messy_exit
 def start_script( self, library_view = "oldway" ):
     messy_exit = False
     utils.log( "Library_view: %s" % library_view, xbmc.LOGNOTICE )
     early_exit = False
     movie_next = False
     prev_trigger = None
     if library_view != "oldway":
         xbmc.executebuiltin( "ActivateWindow(videolibrary,%s,return)" % library_view )
         # wait until Video Library shows
         while not xbmc.getCondVisibility( "Container.Content(movies)" ):
             pass
         if extra_settings[ "enable_notification" ]:
             xbmc.executebuiltin("Notification( %s, %s, %d, %s)" % (header, __language__( 32546 ), 300000, image) )
         # wait until playlist is full to the required number of features
         utils.log( "Waiting for queue to be filled with %s Feature films" % number_of_features, xbmc.LOGNOTICE )
         count = 0
         while playlist.size() < number_of_features:
             if playlist.size() > count:
                 utils.log( "User queued %s of %s Feature films" % (playlist.size(), number_of_features), xbmc.LOGNOTICE )
                 header1 = header + " - Feature " + "%d" % playlist.size()
                 message = __language__( 32543 ) + playlist[playlist.size() -1].getdescription()
                 if extra_settings[ "enable_notification" ]:
                     xbmc.executebuiltin("Notification( %s, %s, %d, %s)" % (header1, message, time_delay, image) )
                 count = playlist.size()
                 xbmc.sleep(time_delay*2)
             if not xbmc.getCondVisibility( "Container.Content(movies)" ):
                 early_exit = True
                 break
         utils.log( "User queued %s Feature films" % playlist.size(), xbmc.LOGNOTICE )
         if not early_exit:
             header1 = header + " - Feature " + "%d" % playlist.size()
             message = __language__( 32543 ) + playlist[playlist.size() -1].getdescription()
             if extra_settings[ "enable_notification" ]:
                 xbmc.executebuiltin("Notification( %s, %s, %d, %s)" % (header1, message, time_delay, image) )
             early_exit = False
     # If for some reason the limit does not get reached and the window changed, cancel script
     if playlist.size() < number_of_features and library_view != "oldway":
         if extra_settings[ "enable_notification" ]:
             xbmc.executebuiltin("Notification( %s, %s, %d, %s)" % (header, __language__( 32544 ), time_delay, image) )
         _clear_playlists()
     else:
         mpaa, audio, genre, movie, equivalent_mpaa, is_3d_movie = _get_queued_video_info( feature = 0 )
         plist = _store_playlist() # need to store movie playlist
         self._play_trivia( mpaa, genre, plist, equivalent_mpaa )
         mplaylist = xbmc.PlayList(xbmc.PLAYLIST_MUSIC)
         mplaylist.clear()
         trigger_list = self.load_trigger_list()
         self.player.play( playlist )
         count = -1
         stop_check = 0
         paused = False
         # wait until fullscreen video is shown
         while not xbmc.getCondVisibility( "Window.IsActive(fullscreenvideo)" ):
             pass
         while not playlist.getposition() == ( playlist.size() - 1 ):
             if playlist.getposition() > count:
                 try:
                     utils.log( "Item From Trigger List: %s" % trigger_list[ playlist.getposition() ], xbmc.LOGNOTICE )
                 except:
                     utils.log( "Problem With Trigger List", xbmc.LOGNOTICE )
                 utils.log( "Playlist Position: %s  Playlist Size: %s " % ( ( playlist.getposition() + 1 ), ( playlist.size() ) ), xbmc.LOGNOTICE )
                 if not playlist.getposition() == ( playlist.size() - 1 ):
                     prev_trigger = Launch_automation().launch_automation( trigger_list[ playlist.getposition() ], prev_trigger )
                     count = playlist.getposition()
                 else: 
                     break  # Reached the last item in the playlist
             try:
                 #if not self.player.isPlayingVideo() and not is_paused:
                 if not xbmc.getCondVisibility( "Window.IsActive(fullscreenvideo)" ):
                     utils.log( "Video may have stopped", xbmc.LOGNOTICE )
                     xbmc.sleep( 5000 )  # wait 5 seconds for fullscreen video to show up(during playback)
                     if not xbmc.getCondVisibility( "Window.IsActive(fullscreenvideo)" ): # if fullscreen video does not show up, break and exit script
                         messy_exit = True
                         break
             except:
                 if xbmc.getCondVisibility( "Container.Content(movies)" ):
                     utils.log( "Video Definitely Stopped", xbmc.LOGNOTICE )
                     messy_exit = True
                     break
         if not playlist.size() < 1 and not messy_exit: # To catch an already running script when a new instance started
             utils.log( "Playlist Position: %s  Playlist Size: %s " % ( playlist.getposition() + 1, ( playlist.size() ) ), xbmc.LOGNOTICE )
             prev_trigger = Launch_automation().launch_automation( trigger_list[ playlist.getposition() ], prev_trigger )
             if trigger_list[ playlist.getposition() ] == "Movie":
                 utils.log( "Item From Trigger List: %s" % trigger_list[ playlist.getposition() ], xbmc.LOGNOTICE )
             else:
                 utils.log( "Item From Trigger List: %s" % trigger_list[ playlist.getposition() ], xbmc.LOGNOTICE )
             messy_exit = False
             xbmc.sleep(1000)
             self._wait_until_end()
         else:
             utils.log( "User might have pressed stop", xbmc.LOGNOTICE )
             utils.log( "Stopping Script", xbmc.LOGNOTICE )
             messy_exit = False
     return messy_exit
 def start_script( self, library_view = "oldway", original_autorefresh = 0 ):
     messy_exit = False
     utils.log( "Library_view: %s" % library_view, xbmc.LOGNOTICE )
     early_exit = False
     movie_next = False
     prev_trigger = None
     self.video_window = xbmcgui.WindowXML( "script_CExperience-video.xml", __addon__.getAddonInfo('path'), "Default", "720p" )
     self.video_window.show()
     autorefresh_movie = False
     self.autorefresh = original_autorefresh
     self.original_autorefresh = original_autorefresh
     if library_view != "oldway":
         xbmc.executebuiltin( "ActivateWindow(videolibrary,%s,return)" % library_view )
         # wait until Video Library shows
         while not xbmc.getCondVisibility( "Container.Content(movies)" ):
             pass
         if extra_settings[ "enable_notification" ]:
             xbmc.executebuiltin("Notification( %s, %s, %d, %s)" % (header, __language__( 32546 ), 300000, image) )
         # wait until playlist is full to the required number of features
         utils.log( "Waiting for queue to be filled with %s Feature films" % number_of_features, xbmc.LOGNOTICE )
         count = 0
         while playlist.size() < number_of_features:
             if playlist.size() > count:
                 utils.log( "User queued %s of %s Feature films" % (playlist.size(), number_of_features), xbmc.LOGNOTICE )
                 header1 = header + " - Feature " + "%d" % playlist.size()
                 message = __language__( 32543 ) + playlist[playlist.size() -1].getdescription()
                 if extra_settings[ "enable_notification" ]:
                     xbmc.executebuiltin("Notification( %s, %s, %d, %s)" % (header1, message, time_delay, image) )
                 count = playlist.size()
                 xbmc.sleep(time_delay*2)
             if not xbmc.getCondVisibility( "Container.Content(movies)" ):
                 early_exit = True
                 break
         utils.log( "User queued %s Feature films" % playlist.size(), xbmc.LOGNOTICE )
         if not early_exit:
             header1 = header + " - Feature " + "%d" % playlist.size()
             message = __language__( 32543 ) + playlist[playlist.size() -1].getdescription()
             if extra_settings[ "enable_notification" ]:
                 xbmc.executebuiltin("Notification( %s, %s, %d, %s)" % (header1, message, time_delay, image) )
             early_exit = False
     # If for some reason the limit does not get reached and the window changed, cancel script
     if playlist.size() < number_of_features and library_view != "oldway":
         if extra_settings[ "enable_notification" ]:
             xbmc.executebuiltin("Notification( %s, %s, %d, %s)" % (header, __language__( 32544 ), time_delay, image) )
         _clear_playlists()
     else:
         mpaa, audio, genre, movie, equivalent_mpaa, is_3d_movie = _get_queued_video_info( feature = 0 )
         plist = _store_playlist() # need to store movie playlist
         self._play_trivia( mpaa, genre, plist, equivalent_mpaa )
         mplaylist = xbmc.PlayList(xbmc.PLAYLIST_MUSIC)
         mplaylist.clear()
         jsonquery = '''{"jsonrpc": "2.0", "method": "Settings.SetSettingValue",  "params": { "setting": "screensaver.mode", "value": "None" }, "id": 1}'''
         jsonresponse = xbmc.executeJSONRPC( jsonquery )
         trigger_list = self.load_trigger_list()
         self.player.play( playlist )
         count = -1
         stop_check = 0
         paused = False            
         # wait until fullscreen video is shown
         while not xbmc.getCondVisibility( "Window.IsActive(fullscreenvideo)" ):
             pass
         while ( not playlist.getposition() == ( playlist.size() - 1 ) or xbmcgui.Window( 10025 ).getProperty( "CinemaExperienceRunning" ) == "True" ):
             if playlist.getposition() > count:
                 try:
                     utils.log( "Item From Trigger List: %s" % trigger_list[ playlist.getposition() ], xbmc.LOGNOTICE )
                 except:
                     utils.log( "Problem With Trigger List", xbmc.LOGNOTICE )
                 utils.log( "Playlist Position: %s  Playlist Size: %s " % ( ( playlist.getposition() + 1 ), ( playlist.size() ) ), xbmc.LOGNOTICE )
                 if not playlist.getposition() == ( playlist.size() - 1 ):
                     prev_trigger = Launch_automation().launch_automation( trigger_list[ playlist.getposition() ], prev_trigger )
                     if trigger_list[ playlist.getposition() ] == "Movie":
                         if extra_settings[ "autorefresh" ] and extra_settings[ "autorefresh_movie" ]:
                             self.auto_refresh( "enable" )
                             autorefresh_movie = True
                     else:
                         if extra_settings[ "autorefresh" ]:
                             self.auto_refresh( "disable" )
                             autorefresh_movie = False
                     utils.log( "[ script.cinema.experience ] - autorefresh_movie: %s" % autorefresh_movie )
                     count = playlist.getposition()
                 else: 
                     break  # Reached the last item in the playlist
             try:
                 #if not self.player.isPlayingVideo() and not is_paused:
                 if not xbmc.getCondVisibility( "Window.IsActive(fullscreenvideo)" ):
                     utils.log( "Video may have stopped", xbmc.LOGNOTICE )
                     xbmc.sleep( 5000 )  # wait 5 seconds for fullscreen video to show up(during playback)
                     if not xbmc.getCondVisibility( "Window.IsActive(fullscreenvideo)" ): # if fullscreen video does not show up, break and exit script
                         messy_exit = True
                         break
             except:
                 if xbmc.getCondVisibility( "Container.Content(movies)" ):
                     utils.log( "Video Definitely Stopped", xbmc.LOGNOTICE )
                     messy_exit = True
                     break
         if not playlist.size() < 1 and not messy_exit: # To catch an already running script when a new instance started
             utils.log( "Playlist Position: %s  Playlist Size: %s " % ( playlist.getposition() + 1, ( playlist.size() ) ), xbmc.LOGNOTICE )
             prev_trigger = Launch_automation().launch_automation( trigger_list[ playlist.getposition() ], prev_trigger )
             if trigger_list[ playlist.getposition() ] == "Movie":
                 utils.log( "Item From Trigger List: %s" % trigger_list[ playlist.getposition() ], xbmc.LOGNOTICE )
                 if extra_settings[ "autorefresh" ] and extra_setting[ "autorefresh_movie" ]:
                     self.auto_refresh( "enable" )
                     autorefresh_movie = True
             else:
                 utils.log( "Item From Trigger List: %s" % trigger_list[ playlist.getposition() ], xbmc.LOGNOTICE )
                 if extra_settings[ "autorefresh" ]:
                     self.auto_refresh( "disable" )
                     autorefresh_movie = False
             messy_exit = False
             xbmc.sleep(1000)
             self._wait_until_end()
             if extra_settings[ "autorefresh" ] and self.original_autorefresh > 0:
                 self.auto_refresh( "enable" )
         else:
             if extra_settings[ "autorefresh" ] and self.original_autorefresh > 0:
                 self.auto_refresh( "enable" )
             utils.log( "User might have pressed stop", xbmc.LOGNOTICE )
             utils.log( "Stopping Script", xbmc.LOGNOTICE )
             messy_exit = False
     return messy_exit
Beispiel #8
0
 def start_script(self, library_view="oldway", original_autorefresh=0):
     messy_exit = False
     utils.log("Library_view: %s" % library_view, xbmc.LOGNOTICE)
     early_exit = False
     movie_next = False
     prev_trigger = None
     self.video_window = xbmcgui.WindowXML("script_CExperience-video.xml",
                                           __addon__.getAddonInfo('path'),
                                           "Default", "720p")
     self.video_window.show()
     autorefresh_movie = False
     self.autorefresh = original_autorefresh
     self.original_autorefresh = original_autorefresh
     if library_view != "oldway":
         xbmc.executebuiltin("ActivateWindow(videolibrary,%s,return)" %
                             library_view)
         # wait until Video Library shows
         while not xbmc.getCondVisibility("Container.Content(movies)"):
             pass
         if extra_settings["enable_notification"]:
             xbmc.executebuiltin(
                 "Notification( %s, %s, %d, %s)" %
                 (header, __language__(32546), 300000, image))
         # wait until playlist is full to the required number of features
         utils.log(
             "Waiting for queue to be filled with %s Feature films" %
             number_of_features, xbmc.LOGNOTICE)
         count = 0
         while playlist.size() < number_of_features:
             if playlist.size() > count:
                 utils.log(
                     "User queued %s of %s Feature films" %
                     (playlist.size(), number_of_features), xbmc.LOGNOTICE)
                 header1 = header + " - Feature " + "%d" % playlist.size()
                 message = __language__(32543) + playlist[
                     playlist.size() - 1].getdescription()
                 if extra_settings["enable_notification"]:
                     xbmc.executebuiltin(
                         "Notification( %s, %s, %d, %s)" %
                         (header1, message, time_delay, image))
                 count = playlist.size()
                 xbmc.sleep(time_delay * 2)
             if not xbmc.getCondVisibility("Container.Content(movies)"):
                 early_exit = True
                 break
         utils.log("User queued %s Feature films" % playlist.size(),
                   xbmc.LOGNOTICE)
         if not early_exit:
             header1 = header + " - Feature " + "%d" % playlist.size()
             message = __language__(32543) + playlist[playlist.size() -
                                                      1].getdescription()
             if extra_settings["enable_notification"]:
                 xbmc.executebuiltin("Notification( %s, %s, %d, %s)" %
                                     (header1, message, time_delay, image))
             early_exit = False
     # If for some reason the limit does not get reached and the window changed, cancel script
     if playlist.size() < number_of_features and library_view != "oldway":
         if extra_settings["enable_notification"]:
             xbmc.executebuiltin(
                 "Notification( %s, %s, %d, %s)" %
                 (header, __language__(32544), time_delay, image))
         _clear_playlists()
     else:
         mpaa, audio, genre, movie, equivalent_mpaa, is_3d_movie = _get_queued_video_info(
             feature=0)
         plist = _store_playlist()  # need to store movie playlist
         self._play_trivia(mpaa, genre, plist, equivalent_mpaa)
         mplaylist = xbmc.PlayList(xbmc.PLAYLIST_MUSIC)
         mplaylist.clear()
         jsonquery = '''{"jsonrpc": "2.0", "method": "Settings.SetSettingValue",  "params": { "setting": "screensaver.mode", "value": "None" }, "id": 1}'''
         jsonresponse = xbmc.executeJSONRPC(jsonquery)
         trigger_list = self.load_trigger_list()
         self.player.play(playlist)
         count = -1
         stop_check = 0
         paused = False
         # wait until fullscreen video is shown
         while not xbmc.getCondVisibility(
                 "Window.IsActive(fullscreenvideo)"):
             pass
         while (not playlist.getposition() == (playlist.size() - 1) or
                xbmcgui.Window(10025).getProperty("CinemaExperienceRunning")
                == "True"):
             if playlist.getposition() > count:
                 try:
                     utils.log(
                         "Item From Trigger List: %s" %
                         trigger_list[playlist.getposition()],
                         xbmc.LOGNOTICE)
                 except:
                     utils.log("Problem With Trigger List", xbmc.LOGNOTICE)
                 utils.log(
                     "Playlist Position: %s  Playlist Size: %s " %
                     ((playlist.getposition() + 1), (playlist.size())),
                     xbmc.LOGNOTICE)
                 if not playlist.getposition() == (playlist.size() - 1):
                     prev_trigger = Launch_automation().launch_automation(
                         trigger_list[playlist.getposition()], prev_trigger)
                     if trigger_list[playlist.getposition()] == "Movie":
                         if extra_settings["autorefresh"] and extra_settings[
                                 "autorefresh_movie"]:
                             self.auto_refresh("enable")
                             autorefresh_movie = True
                     else:
                         if extra_settings["autorefresh"]:
                             self.auto_refresh("disable")
                             autorefresh_movie = False
                     utils.log(
                         "[ script.cinema.experience ] - autorefresh_movie: %s"
                         % autorefresh_movie)
                     count = playlist.getposition()
                 else:
                     break  # Reached the last item in the playlist
             try:
                 #if not self.player.isPlayingVideo() and not is_paused:
                 if not xbmc.getCondVisibility(
                         "Window.IsActive(fullscreenvideo)"):
                     utils.log("Video may have stopped", xbmc.LOGNOTICE)
                     xbmc.sleep(
                         5000
                     )  # wait 5 seconds for fullscreen video to show up(during playback)
                     if not xbmc.getCondVisibility(
                             "Window.IsActive(fullscreenvideo)"
                     ):  # if fullscreen video does not show up, break and exit script
                         messy_exit = True
                         break
             except:
                 if xbmc.getCondVisibility("Container.Content(movies)"):
                     utils.log("Video Definitely Stopped", xbmc.LOGNOTICE)
                     messy_exit = True
                     break
         if not playlist.size(
         ) < 1 and not messy_exit:  # To catch an already running script when a new instance started
             utils.log(
                 "Playlist Position: %s  Playlist Size: %s " %
                 (playlist.getposition() + 1, (playlist.size())),
                 xbmc.LOGNOTICE)
             prev_trigger = Launch_automation().launch_automation(
                 trigger_list[playlist.getposition()], prev_trigger)
             if trigger_list[playlist.getposition()] == "Movie":
                 utils.log(
                     "Item From Trigger List: %s" %
                     trigger_list[playlist.getposition()], xbmc.LOGNOTICE)
                 if extra_settings["autorefresh"] and extra_setting[
                         "autorefresh_movie"]:
                     self.auto_refresh("enable")
                     autorefresh_movie = True
             else:
                 utils.log(
                     "Item From Trigger List: %s" %
                     trigger_list[playlist.getposition()], xbmc.LOGNOTICE)
                 if extra_settings["autorefresh"]:
                     self.auto_refresh("disable")
                     autorefresh_movie = False
             messy_exit = False
             xbmc.sleep(1000)
             self._wait_until_end()
             if extra_settings[
                     "autorefresh"] and self.original_autorefresh > 0:
                 self.auto_refresh("enable")
         else:
             if extra_settings[
                     "autorefresh"] and self.original_autorefresh > 0:
                 self.auto_refresh("enable")
             utils.log("User might have pressed stop", xbmc.LOGNOTICE)
             utils.log("Stopping Script", xbmc.LOGNOTICE)
             messy_exit = False
     return messy_exit