Ejemplo n.º 1
0
 def onPlayBackStopped(self):
     clear_property('script.trakt.ids')
     clear_property('data')
     
     if self.totalTime > 0 and self.currentTime / self.totalTime >= .9:
         self.mark_as_watched()
     self.reset()
Ejemplo n.º 2
0
    def onPlayBackStopped(self):
        clear_property('script.trakt.ids')
        clear_property('data')

        if self.totalTime > 0 and self.currentTime / self.totalTime >= .9:
            self.mark_as_watched()
        self.reset()
Ejemplo n.º 3
0
 def onDatabaseUpdated(self, database):
     if database == "video":
         if get_property("clean_library"):
             xbmc.executebuiltin("XBMC.CleanLibrary(video, false)")
             clear_property("clean_library")
     if database == "music":
         # need to manualy change the database file to add strm files to it
         music_directory = plugin.get_setting(SETTING_MUSIC_LIBRARY_FOLDER, unicode)
         self.add_folder_to_music_database(music_directory)
Ejemplo n.º 4
0
 def onDatabaseUpdated(self, database):
     if database == "video":
         if get_property("clean_library"):
             xbmc.executebuiltin("XBMC.CleanLibrary(video, false)")
             clear_property("clean_library")
     if database == "music":
         # need to manualy change the database file to add strm files to it
         music_directory = plugin.get_setting(SETTING_MUSIC_LIBRARY_FOLDER, unicode)
         self.add_folder_to_music_database(music_directory)
Ejemplo n.º 5
0
def update_library():
    is_updating = get_property("updating_library")
    now = time.time()
    if is_updating and now - int(is_updating) < 120:
        plugin.log.debug("Skipping library update")
        return
    if plugin.get_setting(SETTING_LIBRARY_UPDATES, bool) == True:
        try:
            set_property("updating_library", int(now))
            meta.library.tvshows.update_library()
            meta.library.movies.update_library()
            meta.library.music.update_library()
        finally: clear_property("updating_library")
    else: clear_property("updating_library")
Ejemplo n.º 6
0
def update_library():
    is_updating = get_property("updating_library")
    
    now = time.time()
    if is_updating and now - int(is_updating) < 120:
        plugin.log.debug("Skipping library update")
        return
        
    try:
        set_property("updating_library", int(now))
        meta.library.tvshows.update_library()
        meta.library.movies.update_library()
    finally:
        clear_property("updating_library")
Ejemplo n.º 7
0
def update_library():
    is_updating = get_property("updating_library")
    is_syncing = get_property("syncing_library")
    now = time.time()
    if is_syncing and now - int(is_syncing) < plugin.get_setting(SETTING_UPDATE_LIBRARY_INTERVAL, int) * 60:
        plugin.log.info("Skipping library sync")
    else:
        if plugin.get_setting(SETTING_LIBRARY_SYNC_COLLECTION, bool) == True or plugin.get_setting(
                SETTING_LIBRARY_SYNC_WATCHLIST, bool) == True:
            try:
                set_property("syncing_library", int(now))
                if plugin.get_setting(SETTING_LIBRARY_SYNC_COLLECTION, bool) == True:
                    meta.library.tvshows.sync_trakt_collection()
                    meta.library.movies.sync_trakt_collection()
                if plugin.get_setting(SETTING_LIBRARY_SYNC_WATCHLIST, bool) == True:
                    meta.library.tvshows.sync_trakt_watchlist()
                    meta.library.movies.sync_trakt_watchlist()
            except: plugin.log.info("something went wrong")
            finally: clear_property("syncing_library")
        else: clear_property("syncing_library")
    if is_updating and now - int(is_updating) < 120:
        plugin.log.debug("Skipping library update")
        return
    if plugin.get_setting(SETTING_LIBRARY_UPDATES, bool) == True:
        try:
            set_property("updating_library", int(now))
            meta.library.tvshows.update_library()
            meta.library.movies.update_library()
            meta.library.music.update_library()
        finally: clear_property("updating_library")
    else: clear_property("updating_library")
Ejemplo n.º 8
0
def update_library():
    is_updating = get_property("updating_library")

    now = time.time()
    if is_updating and now - int(is_updating) < 120:
        plugin.log.debug("Skipping library update")
        return

    try:
        set_property("updating_library", int(now))
        meta.library.tvshows.update_library()
        meta.library.movies.update_library()
    finally:
        clear_property("updating_library")
Ejemplo n.º 9
0
def update_library():
    is_updating = get_property("updating_library")
    now = time.time()
    if is_updating and now - int(is_updating) < 120:
        plugin.log.debug("Skipping library update")
        return
    if plugin.get_setting(SETTING_LIBRARY_UPDATES, converter=bool) == True:
        #plugin.notify(msg=_('Library'), title=_('Updating'), delay=5000, image=get_icon_path("metalliq"))
        try:
            set_property("updating_library", int(now))
            meta.library.tvshows.update_library()
            meta.library.movies.update_library()
            meta.library.music.update_library()
        finally:
            clear_property("updating_library")
    else:
        #plugin.notify(msg=_('Library'), title=_('Not updating'), delay=5000, image=get_icon_path("metalliq"))
        clear_property("updating_library")
Ejemplo n.º 10
0
def update_library():
    is_updating = get_property("updating_library")
    now = time.time()
    if is_updating and now - int(is_updating) < 120:
        plugin.log.debug("Skipping library update")
        return
    if plugin.get_setting(SETTING_LIBRARY_UPDATES, converter=bool) == True:
        # plugin.notify(msg=_('Library'), title=_('Updating'), delay=5000, image=get_icon_path("metalliq"))
        try:
            set_property("updating_library", int(now))
            meta.library.tvshows.update_library()
            meta.library.movies.update_library()
            meta.library.music.update_library()
        finally:
            clear_property("updating_library")
    else:
        # plugin.notify(msg=_('Library'), title=_('Not updating'), delay=5000, image=get_icon_path("metalliq"))
        clear_property("updating_library")
Ejemplo n.º 11
0
def update_library():
    is_updating = get_property("updating_library")
    is_syncing = get_property("syncing_library")
    now = time.time()
    if is_syncing and now - int(is_syncing) < plugin.get_setting(
            SETTING_UPDATE_LIBRARY_INTERVAL, int) * 60:
        plugin.log.info("Skipping library sync")
    else:
        if plugin.get_setting(SETTING_LIBRARY_SYNC_COLLECTION,
                              bool) == True or plugin.get_setting(
                                  SETTING_LIBRARY_SYNC_WATCHLIST,
                                  bool) == True:
            try:
                set_property("syncing_library", int(now))
                if plugin.get_setting(SETTING_LIBRARY_SYNC_COLLECTION,
                                      bool) == True:
                    meta.library.tvshows.sync_trakt_collection()
                    meta.library.movies.sync_trakt_collection()
                if plugin.get_setting(SETTING_LIBRARY_SYNC_WATCHLIST,
                                      bool) == True:
                    meta.library.tvshows.sync_trakt_watchlist()
                    meta.library.movies.sync_trakt_watchlist()
            except:
                plugin.log.info("something went wrong")
            finally:
                clear_property("syncing_library")
        else:
            clear_property("syncing_library")
    if is_updating and now - int(is_updating) < 120:
        plugin.log.debug("Skipping library update")
        return
    if plugin.get_setting(SETTING_LIBRARY_UPDATES, bool) == True:
        try:
            set_property("updating_library", int(now))
            meta.library.tvshows.update_library()
            meta.library.movies.update_library()
            meta.library.music.update_library()
        finally:
            clear_property("updating_library")
    else:
        clear_property("updating_library")
Ejemplo n.º 12
0
 def onPlayBackEnded(self):
     clear_property('script.trakt.ids')
     clear_property('data')
     self.mark_as_watched()
     self.reset()
 def onPlayBackEnded(self):
     clear_property('script.trakt.ids')
     clear_property('data')
     self.mark_as_watched()
     self.reset()
Ejemplo n.º 14
0
 def onDatabaseUpdated(self, database):
     if database == "video":
         if get_property("clean_library"):
             xbmc.executebuiltin("XBMC.CleanLibrary(video, false)")
             clear_property("clean_library")
Ejemplo n.º 15
0
 def onDatabaseUpdated(self, database):
     if database == "video":
         if get_property("clean_library"):
             xbmc.executebuiltin("XBMC.CleanLibrary(video, false)")
             clear_property("clean_library")