Beispiel #1
0
 def testCategoryMerge(self):
     config.settings = Bunch.fromDict(config.initialConfig)
     cats = categories.getCategories()
     self.assertEqual(18, len(cats))
     self.assertEqual("movies", cats[2].name)
     self.assertEqual([2000], cats[2].newznabCategories)
     self.assertEqual("movieshd", cats[3].name)
     self.assertEqual([2040, 2050, 2060], cats[3].newznabCategories)
Beispiel #2
0
def getSafeConfig():
    indexers = [{"name": x["name"], "preselect": x["preselect"], "enabled": x["enabled"], "showOnSearch": x["showOnSearch"] and x["accessType"] != "external"} for x in settings["indexers"]]

    return {
        "indexers": indexers,
        "searching": {"maxAge": settings["searching"]["maxAge"], "alwaysShowDuplicates": settings["searching"]["alwaysShowDuplicates"], "enableCategorySizes": settings["categories"]["enableCategorySizes"]},
        "categories": categories.getCategories(),
        "downloaders": [{"enabled": x.enabled, "name": x.name, "type": x.type, "iconCssClass": x.iconCssClass, "defaultCategory": x.defaultCategory if hasattr(x, "defaultCategory") else None} for x in settings["downloaders"]],
        "authType": settings["auth"]["authType"],
    }
Beispiel #3
0
def getSafeConfig():
    indexers = [{"name": x["name"], "preselect": x["preselect"], "enabled": x["enabled"], "categories": x["categories"] if "categories" in x.keys() else [], "showOnSearch": x["showOnSearch"] and x["accessType"] != "external"} for x in settings["indexers"]]

    return {
        "indexers": indexers,
        "searching": {"maxAge": settings["searching"]["maxAge"], "alwaysShowDuplicates": settings["searching"]["alwaysShowDuplicates"], "enableCategorySizes": settings["categories"]["enableCategorySizes"]},
        "categories": categories.getCategories(),
        "downloaders": [{"enabled": x.enabled, "name": x.name, "type": x.type, "iconCssClass": x.iconCssClass, "defaultCategory": x.defaultCategory if hasattr(x, "defaultCategory") else None} for x in settings["downloaders"]],
        "authType": settings["auth"]["authType"],
    }