diff --git a/libsaria/sources/library/__init__.py b/libsaria/sources/library/__init__.py index 2c928426..0a81ab14 100644 --- a/libsaria/sources/library/__init__.py +++ b/libsaria/sources/library/__init__.py @@ -20,12 +20,19 @@ library.load() tree.make_tree() index.reindex() -def update_lib(): - update.update() +def refresh(): tree.make_tree() index.reindex() libsaria.callbacks.library_updated() +def update_lib(): + update.update() + refresh() + +def rm_path(path): + library.rm_path(path) + refresh() + def reset(): library.reset() - tree.make_tree() + refresh() diff --git a/libsaria/sources/library/library.py b/libsaria/sources/library/library.py index 01631300..0b1a5009 100644 --- a/libsaria/sources/library/library.py +++ b/libsaria/sources/library/library.py @@ -39,6 +39,12 @@ def add_path(path): lib_dict.setdefault(path, dict()) unlock_library() +def rm_path(path): + lock_library() + del lib_dict[path] + save() + unlock_library() + def list_paths(): res = [] lock_library()