fix albumView using watch function

- other minor changes to almost all files
This commit is contained in:
geoffrey45
2022-02-02 21:45:23 +03:00
parent bdfbb59d76
commit 73dec9189e
27 changed files with 231 additions and 231 deletions
+6 -4
View File
@@ -28,6 +28,8 @@ def adutsfsd():
@bp.route('/search')
def search_by_title():
query:str = ""
if not request.args.get('q'):
query = "mexican girl"
else:
@@ -83,20 +85,20 @@ def search_by_title():
else:
more_tracks = False
if len(artists_dicts) > 8:
if len(artists_dicts) > 6:
more_artists = True
else:
more_artists = False
if len(albums_dicts) > 8:
if len(albums_dicts) > 6:
more_albums = True
else:
more_albums = False
return {'data': [
{'tracks': tracks[:5], 'more': more_tracks},
{'albums': albums_dicts[:8], 'more': more_albums},
{'artists': artists_dicts[:8], 'more': more_artists}
{'albums': albums_dicts[:6], 'more': more_albums},
{'artists': artists_dicts[:6], 'more': more_artists}
]}
+1 -1
View File
@@ -83,7 +83,7 @@ def populate_images():
bar.finish()
def extract_thumb(audio_file_path: str = None) -> str:
def extract_thumb(audio_file_path: str) -> str:
"""
Extracts the thumbnail from an audio file. Returns the path to the thumbnail.
"""
+4 -2
View File
@@ -5,6 +5,7 @@ This module contains mimi functions for the server.
import os
import threading
import time
from typing import List
import requests
from io import BytesIO
@@ -37,10 +38,11 @@ def check_for_new_songs():
while flag is False:
functions.populate()
functions.populate_images()
time.sleep(300)
def run_fast_scandir(dir: str, ext: str) -> list:
def run_fast_scandir(dir: str, ext: str):
"""
Scans a directory for files with a specific extension. Returns a list of files and folders in the directory.
"""
@@ -125,7 +127,7 @@ def create_config_dir() -> None:
os.chmod(path, 0o755)
def getAllSongs() -> None:
def getAllSongs() -> List:
"""
Gets all songs under the ~/ directory.
"""