fix: wrong place to place the lock
This commit is contained in:
		@@ -133,12 +133,12 @@ def recur_dir(dirobj):
 | 
				
			|||||||
@web.route("/", methods=['GET'])
 | 
					@web.route("/", methods=['GET'])
 | 
				
			||||||
@requires_auth
 | 
					@requires_auth
 | 
				
			||||||
def index():
 | 
					def index():
 | 
				
			||||||
    tags_color_lookup = build_tags_color_lookup()
 | 
					 | 
				
			||||||
    path_tags_lookup = build_path_tags_lookup()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    while var.library.dir_lock.locked():
 | 
					    while var.library.dir_lock.locked():
 | 
				
			||||||
        time.sleep(0.1)
 | 
					        time.sleep(0.1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    tags_color_lookup = build_tags_color_lookup()
 | 
				
			||||||
 | 
					    path_tags_lookup = build_path_tags_lookup()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return render_template('index.html',
 | 
					    return render_template('index.html',
 | 
				
			||||||
                           all_files=var.library.files,
 | 
					                           all_files=var.library.files,
 | 
				
			||||||
                           tags_lookup=path_tags_lookup,
 | 
					                           tags_lookup=path_tags_lookup,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,8 +2,8 @@
 | 
				
			|||||||
<ul class="list-group">
 | 
					<ul class="list-group">
 | 
				
			||||||
    {% if dir and dir.get_subdirs().items() %}
 | 
					    {% if dir and dir.get_subdirs().items() %}
 | 
				
			||||||
    {% for subdirname, subdirobj in dir.get_subdirs().items() %}
 | 
					    {% for subdirname, subdirobj in dir.get_subdirs().items() %}
 | 
				
			||||||
    {%- set subdirpath = os.path.relpath(subdirobj.fullpath, music_library.fullpath) %}
 | 
					    {% set subdirpath = os.path.relpath(subdirobj.fullpath, music_library.fullpath) %}
 | 
				
			||||||
    {%- set subdirid = subdirpath.replace("/","-") %}
 | 
					    {% set subdirid = subdirpath.replace("/","-") %}
 | 
				
			||||||
    <li class="directory list-group-item list-group-item-primary">
 | 
					    <li class="directory list-group-item list-group-item-primary">
 | 
				
			||||||
        <div class="btn-group" role="group">
 | 
					        <div class="btn-group" role="group">
 | 
				
			||||||
            <div class="btn-group" role="group">
 | 
					            <div class="btn-group" role="group">
 | 
				
			||||||
@@ -45,12 +45,12 @@
 | 
				
			|||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </li>
 | 
					    </li>
 | 
				
			||||||
    <div class="collapse multi-collapse" id="multiCollapse-{{ subdirid }}">
 | 
					    <div class="collapse multi-collapse" id="multiCollapse-{{ subdirid }}">
 | 
				
			||||||
        {{- dirlisting(subdirobj, subdirpath) -}}
 | 
					        {{ dirlisting(subdirobj, subdirpath) -}}
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    {% endfor %}
 | 
					    {% endfor %}
 | 
				
			||||||
    {% endif %}
 | 
					    {% endif %}
 | 
				
			||||||
    {%- set files = dir.get_files() %}
 | 
					    {% set files = dir.get_files() %}
 | 
				
			||||||
    {%- if files %}
 | 
					    {% if files %}
 | 
				
			||||||
    {% for file in files %}
 | 
					    {% for file in files %}
 | 
				
			||||||
    {% set filepath = os.path.relpath(os.path.join(dir.fullpath, file), music_library.fullpath) %}
 | 
					    {% set filepath = os.path.relpath(os.path.join(dir.fullpath, file), music_library.fullpath) %}
 | 
				
			||||||
    <li class="file list-group-item">
 | 
					    <li class="file list-group-item">
 | 
				
			||||||
@@ -80,9 +80,13 @@
 | 
				
			|||||||
            <div class="btn-space"><i class="fa fa-music" aria-hidden="true"></i></div>
 | 
					            <div class="btn-space"><i class="fa fa-music" aria-hidden="true"></i></div>
 | 
				
			||||||
            {{ filepath }}
 | 
					            {{ filepath }}
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					            {% if tags_lookup[filepath] %}
 | 
				
			||||||
            {% for tag in tags_lookup[filepath] %}
 | 
					            {% for tag in tags_lookup[filepath] %}
 | 
				
			||||||
                <span class="badge badge-{{ tags_color_lookup[tag] }}">{{ tag }}</span>
 | 
					                <span class="badge badge-{{ tags_color_lookup[tag] }}">{{ tag }}</span>
 | 
				
			||||||
            {% endfor %}
 | 
					            {% endfor %}
 | 
				
			||||||
 | 
					            {% else %}
 | 
				
			||||||
 | 
					                Error: {{ filepath }}
 | 
				
			||||||
 | 
					            {% endif %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <div class="btn-group" style="float: right;">
 | 
					        <div class="btn-group" style="float: right;">
 | 
				
			||||||
            <form action="./download" method="get" class="file file_download">
 | 
					            <form action="./download" method="get" class="file file_download">
 | 
				
			||||||
@@ -96,7 +100,7 @@
 | 
				
			|||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </li>
 | 
					    </li>
 | 
				
			||||||
    {% endfor %}
 | 
					    {% endfor %}
 | 
				
			||||||
    {%- endif %}
 | 
					    {% endif %}
 | 
				
			||||||
</ul>
 | 
					</ul>
 | 
				
			||||||
{%- endmacro %}
 | 
					{%- endmacro %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user