log root and thumb visitors
This commit is contained in:
parent
7b80994db1
commit
3da7f7761a
1 changed files with 2 additions and 0 deletions
|
@ -251,6 +251,7 @@ def root_route():
|
||||||
# Extract file names from sorted paths
|
# Extract file names from sorted paths
|
||||||
sorted_thumbnails = [os.path.basename(file) for file in sorted_thumbnails_paths]
|
sorted_thumbnails = [os.path.basename(file) for file in sorted_thumbnails_paths]
|
||||||
thumbnails = [file for file in os.listdir(f'{rec_path}/thumb/') if file.endswith('.png')]
|
thumbnails = [file for file in os.listdir(f'{rec_path}/thumb/') if file.endswith('.png')]
|
||||||
|
logger_content.warning('[' + client_address(request) + '] index /')
|
||||||
return render_template('index.html', now=datetime.utcnow(), video_files=video_files, thumbnails=sorted_thumbnails)
|
return render_template('index.html', now=datetime.utcnow(), video_files=video_files, thumbnails=sorted_thumbnails)
|
||||||
|
|
||||||
# JSON Data
|
# JSON Data
|
||||||
|
@ -270,6 +271,7 @@ def thumb_route(thumb_file):
|
||||||
thumb_path = f'{rec_path}/thumb/{thumb_file}'
|
thumb_path = f'{rec_path}/thumb/{thumb_file}'
|
||||||
if not os.path.exists(thumb_path):
|
if not os.path.exists(thumb_path):
|
||||||
abort(404)
|
abort(404)
|
||||||
|
logger_content.warning('[' + client_address(request) + '] thumb' + str(thumb_path))
|
||||||
return send_file(thumb_path, mimetype='image/png')
|
return send_file(thumb_path, mimetype='image/png')
|
||||||
|
|
||||||
# Video
|
# Video
|
||||||
|
|
Loading…
Add table
Reference in a new issue