mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
import gc
|
|
from time import time
|
|
from app.lib.mapstuff import (
|
|
map_album_colors,
|
|
map_artist_colors,
|
|
map_favorites,
|
|
map_scrobble_data,
|
|
)
|
|
from app.lib.populate import CordinateMedia
|
|
from app.lib.recipes.recents import RecentlyAdded
|
|
from app.lib.tagger import IndexTracks
|
|
from app.store.albums import AlbumStore
|
|
from app.store.artists import ArtistStore
|
|
from app.store.folder import FolderStore
|
|
from app.store.tracks import TrackStore
|
|
from app.utils.threading import background
|
|
|
|
|
|
class IndexEverything:
|
|
def __init__(self) -> None:
|
|
IndexTracks(instance_key=time())
|
|
|
|
key = str(time())
|
|
TrackStore.load_all_tracks(key)
|
|
AlbumStore.load_albums(key)
|
|
ArtistStore.load_artists(key)
|
|
FolderStore.load_filepaths()
|
|
|
|
# NOTE: Rebuild recently added items on the homepage store
|
|
RecentlyAdded()
|
|
|
|
# map colors
|
|
map_album_colors()
|
|
map_artist_colors()
|
|
|
|
map_scrobble_data()
|
|
map_favorites()
|
|
|
|
CordinateMedia(instance_key=str(time()))
|
|
gc.collect()
|
|
|
|
|
|
@background
|
|
def index_everything():
|
|
return IndexEverything()
|