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

+ fix: sqlite3.ProgrammingError: Cannot operate on a closed cursor on ProcessAlbumColors() + move processing artist images from periodic_scans to Populate + bump hash string limit from 7 to 10 + add last_mod property to database + fix: TypeError: '<' not supported between instances of 'int' and 'str' on album page
32 lines
731 B
Python
32 lines
731 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()
|
|
|
|
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)
|