mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
28 lines
628 B
Python
28 lines
628 B
Python
from app.crons.cron import CronJob
|
|
from app.plugins.mixes import MixesPlugin
|
|
from app.store.homepage import HomepageStore
|
|
|
|
|
|
class Mixes(CronJob):
|
|
"""
|
|
This cron job creates mixes displayed on the homepage.
|
|
"""
|
|
|
|
def __init__(self):
|
|
super().__init__("mixes", 5)
|
|
|
|
def run(self):
|
|
"""
|
|
Creates the artist mixes
|
|
"""
|
|
print("⭐⭐⭐⭐ Mixes cron job running")
|
|
mixes = MixesPlugin()
|
|
|
|
if not mixes.enabled:
|
|
return
|
|
|
|
artist_mixes = mixes.create_artist_mixes()
|
|
|
|
if artist_mixes:
|
|
HomepageStore.set_artist_mixes(artist_mixes)
|