add media queries

This commit is contained in:
geoffrey45
2022-01-22 04:15:00 +03:00
parent 06f1e53fa1
commit c9cd61df7c
17 changed files with 224 additions and 82 deletions
+9 -2
View File
@@ -98,7 +98,7 @@ def get_album_artists(album, artist):
for artist in artists:
artist_obj = {
"name": artist,
"image": "http://127.0.0.1:8900/images/artists/webp/" + artist.replace('/', '::') + ".webp"
"image": "http://0.0.0.0:8900/images/artists/webp/" + artist.replace('/', '::') + ".webp"
}
final_artists.append(artist_obj)
@@ -190,6 +190,9 @@ def getFolderTree(folder: str):
if x['folder'] == req_dir:
songs.append(x)
for song in songs:
song['image'] = song['image'].replace('127.0.0.1', '0.0.0.0')
return {"files": helpers.remove_duplicates(songs), "folders": sorted(folders, key=lambda i: i['name'])}
@@ -261,7 +264,7 @@ def getAlbumSongs(query: str):
@cache.cached()
def drop_db(title, artist):
bio = functions.getAlbumBio(title, artist)
return {'bio': bio}
return {'bio': bio}, 200
@bp.route('/convert')
@@ -278,3 +281,7 @@ def convert_images_to_webp():
img.save(os.path.join(final_path, file.name.replace('.jpg', '.webp')), format='webp')
return "Done"
@bp.route('/test')
def test_http_status_response():
return "OK", 200
+1 -2
View File
@@ -128,11 +128,10 @@ def extract_thumb(path: str) -> str:
except:
return use_defaults()
final_path = "http://127.0.0.1:8900/images/thumbnails/" + webp_path
final_path = "http://0.0.0.0:8900/images/thumbnails/" + webp_path
return final_path
def getTags(full_path: str) -> dict:
"""
Returns a dictionary of tags for a given file.
+1 -1
View File
@@ -3,4 +3,4 @@ from app import create_app
if __name__ == '__main__':
app = create_app()
app.run(debug=True, threaded=True, host="127.0.0.1", port=9876)
app.run(debug=True, threaded=True, host="0.0.0.0", port=9876)
+1 -1
View File
@@ -1,3 +1,3 @@
python manage.py
python manage.py
# gunicorn -b 0.0.0.0:9876 --workers=4 "wsgi:create_app()" --log-level=debug