Example #1
0
 def _get_prefs(self):
     libraryid = get_library_uuid(self._get_db())
     if self.current_prefs == None or self.libraryid != libraryid:
         #print("self.current_prefs == None(%s) or self.libraryid != libraryid(%s)"%(self.current_prefs == None,self.libraryid != libraryid))
         self.libraryid = libraryid
         self.current_prefs = get_library_config(self._get_db())
     return self.current_prefs
Example #2
0
 def _get_prefs(self):
     libraryid = get_library_uuid(self._get_db())
     if self.current_prefs == None or self.libraryid != libraryid:
         #print("self.current_prefs == None(%s) or self.libraryid != libraryid(%s)"%(self.current_prefs == None,self.libraryid != libraryid))
         self.libraryid = libraryid
         self.current_prefs = get_library_config(self._get_db())
     return self.current_prefs
Example #3
0
def get_library_config(db):
    library_id = get_library_uuid(db)
    library_config = None

    if library_config is None:
        #print("get prefs from db")
        library_config = db.prefs.get_namespaced(PREFS_NAMESPACE,
                                                 PREFS_KEY_SETTINGS)

        # if don't have any settings for FanFicFarePlugin, copy from
        # predecessor FanFictionDownLoaderPlugin.
        if library_config is None:
            logger.info("Attempting to read settings from predecessor--FFDL")
            library_config = db.prefs.get_namespaced(FFDL_PREFS_NAMESPACE,
                                                     PREFS_KEY_SETTINGS)
        if library_config is None:
            # defaults.
            logger.info("Using default settings")
            library_config = copy.deepcopy(default_prefs)

    return library_config
Example #4
0
def get_library_config(db):
    library_id = get_library_uuid(db)
    library_config = None

    if library_config is None:
        #print("get prefs from db")
        library_config = db.prefs.get_namespaced(PREFS_NAMESPACE,
                                                 PREFS_KEY_SETTINGS)
        
        # if don't have any settings for FanFicFarePlugin, copy from
        # predecessor FanFictionDownLoaderPlugin.
        if library_config is None:
            logger.info("Attempting to read settings from predecessor--FFDL")
            library_config = db.prefs.get_namespaced(FFDL_PREFS_NAMESPACE,
                                                     PREFS_KEY_SETTINGS)
        if library_config is None:
            # defaults.
            logger.info("Using default settings")
            library_config = copy.deepcopy(default_prefs)
            
    return library_config