diff --git a/interface.py b/interface.py
index 28957f7..a8607b9 100644
--- a/interface.py
+++ b/interface.py
@@ -133,12 +133,12 @@ def recur_dir(dirobj):
@web.route("/", methods=['GET'])
@requires_auth
def index():
- tags_color_lookup = build_tags_color_lookup()
- path_tags_lookup = build_path_tags_lookup()
-
while var.library.dir_lock.locked():
time.sleep(0.1)
+ tags_color_lookup = build_tags_color_lookup()
+ path_tags_lookup = build_path_tags_lookup()
+
return render_template('index.html',
all_files=var.library.files,
tags_lookup=path_tags_lookup,
diff --git a/templates/index.html b/templates/index.html
index 4042697..a4ee0b5 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -2,8 +2,8 @@
{% if dir and dir.get_subdirs().items() %}
{% for subdirname, subdirobj in dir.get_subdirs().items() %}
- {%- set subdirpath = os.path.relpath(subdirobj.fullpath, music_library.fullpath) %}
- {%- set subdirid = subdirpath.replace("/","-") %}
+ {% set subdirpath = os.path.relpath(subdirobj.fullpath, music_library.fullpath) %}
+ {% set subdirid = subdirpath.replace("/","-") %}
-
@@ -45,12 +45,12 @@
- {{- dirlisting(subdirobj, subdirpath) -}}
+ {{ dirlisting(subdirobj, subdirpath) -}}
{% endfor %}
{% endif %}
- {%- set files = dir.get_files() %}
- {%- if files %}
+ {% set files = dir.get_files() %}
+ {% if files %}
{% for file in files %}
{% set filepath = os.path.relpath(os.path.join(dir.fullpath, file), music_library.fullpath) %}
-
@@ -80,9 +80,13 @@
{{ filepath }}
+ {% if tags_lookup[filepath] %}
{% for tag in tags_lookup[filepath] %}
{{ tag }}
{% endfor %}
+ {% else %}
+ Error: {{ filepath }}
+ {% endif %}
{% endfor %}
- {%- endif %}
+ {% endif %}
{%- endmacro %}