mirror of
https://github.com/tcsenpai/swingmusic.git
synced 2025-06-07 03:35:35 +00:00

+ fix help text + run populate once when -nps flag is used + update app version + sort tracks by track and disc no. when saving to playlist + serialize search results + update tags.artist -> tags.artists + update tags.albumartist -> tags.albumartists + remove artist images from serialized albums + add function to serialize artists for cards + misc
37 lines
828 B
Python
37 lines
828 B
Python
"""
|
|
This module contains functions for the server
|
|
"""
|
|
import time
|
|
|
|
from app.logger import log
|
|
from app.lib.populate import Populate, PopulateCancelledError
|
|
|
|
from app.utils.generators import get_random_str
|
|
from app.utils.network import Ping
|
|
from app.utils.threading import background
|
|
|
|
from app.settings import ParserFlags, get_flag, get_scan_sleep_time
|
|
|
|
|
|
@background
|
|
def run_periodic_scans():
|
|
"""
|
|
Runs periodic scans.
|
|
"""
|
|
# ValidateAlbumThumbs()
|
|
# ValidatePlaylistThumbs()
|
|
|
|
try:
|
|
Populate(key=get_random_str())
|
|
except PopulateCancelledError:
|
|
pass
|
|
|
|
while get_flag(ParserFlags.DO_PERIODIC_SCANS):
|
|
try:
|
|
Populate(key=get_random_str())
|
|
except PopulateCancelledError:
|
|
pass
|
|
|
|
sleep_time = get_scan_sleep_time()
|
|
time.sleep(sleep_time)
|