fix: [tags] fix UI enabled tags selector

pull/594/head
Terrtia 2023-04-05 10:46:31 +02:00
parent 5cfe7fffc9
commit 885bdb115b
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 10 additions and 14 deletions

View File

@ -90,7 +90,12 @@ load_taxonomies()
def get_taxonomies(): def get_taxonomies():
return TAXONOMIES.keys() return TAXONOMIES.keys()
# r_tags.sadd(f'active_taxonomies', taxonomy) # TODO rename me to get enabled_taxonomies
def get_active_taxonomies():
return r_tags.smembers('taxonomies:enabled')
'active_taxonomies'
def is_taxonomy_enabled(taxonomy): def is_taxonomy_enabled(taxonomy):
# enabled = r_tags.sismember('taxonomies:enabled', taxonomy) # enabled = r_tags.sismember('taxonomies:enabled', taxonomy)
try: try:
@ -299,13 +304,16 @@ load_galaxies()
def get_galaxies(): def get_galaxies():
return GALAXIES.keys() return GALAXIES.keys()
# TODO RENAME ME
def get_active_galaxies():
return r_tags.smembers('galaxies:enabled')
def get_galaxy(galaxy_name): def get_galaxy(galaxy_name):
return GALAXIES.get(galaxy_name) return GALAXIES.get(galaxy_name)
def exists_galaxy(galaxy): def exists_galaxy(galaxy):
return CLUSTERS.get(galaxy) is not None return CLUSTERS.get(galaxy) is not None
# r_tags.sadd('active_galaxies', galaxy)
def is_galaxy_enabled(galaxy): def is_galaxy_enabled(galaxy):
try: try:
enabled = r_tags.sismember('galaxies:enabled', galaxy) enabled = r_tags.sismember('galaxies:enabled', galaxy)
@ -823,18 +831,6 @@ def is_taxonomie(taxonomie, taxonomies=[]):
taxonomies = get_taxonomies() taxonomies = get_taxonomies()
return taxonomie in taxonomies return taxonomie in taxonomies
def get_active_taxonomies(r_set=False):
res = r_tags.smembers('active_taxonomies')
if r_set:
return set(res)
return res
def get_active_galaxies(r_set=False):
res = r_tags.smembers('active_galaxies')
if r_set:
return set(res)
return res
def get_all_taxonomies_tags(): # # TODO: add + REMOVE + Update def get_all_taxonomies_tags(): # # TODO: add + REMOVE + Update
return r_tags.smembers('active_taxonomies_tags') return r_tags.smembers('active_taxonomies_tags')