add method and route to search across tracks, albums and artists.

+ break models into separate files
+ same for the utils and setup
This commit is contained in:
geoffrey45
2023-03-09 13:08:50 +03:00
parent d39c0ea2f8
commit e3ec9db989
55 changed files with 1113 additions and 1137 deletions
+6 -4
View File
@@ -5,14 +5,16 @@ import time
from requests import ConnectionError as RequestConnectionError
from requests import ReadTimeout
from app import utils
from app.lib.artistlib import CheckArtistImages
from app.lib.populate import Populate, PopulateCancelledError
from app.lib.trackslib import validate_tracks
from app.logger import log
from app.utils.generators import get_random_str
from app.utils.network import Ping
from app.utils.threading import background
@utils.background
@background
def run_periodic_checks():
"""
Checks for new songs every N minutes.
@@ -23,11 +25,11 @@ def run_periodic_checks():
while True:
try:
Populate(key=utils.get_random_str())
Populate(key=get_random_str())
except PopulateCancelledError:
pass
if utils.Ping()():
if Ping()():
try:
CheckArtistImages()
except (RequestConnectionError, ReadTimeout):