2023-03-29 13:22:18 +00:00
|
|
|
from typing import Tuple, Type, Dict
|
2023-03-28 10:50:23 +00:00
|
|
|
|
2023-04-18 10:00:25 +00:00
|
|
|
from ...utils.enums.source import SourcePages
|
2023-03-28 10:50:23 +00:00
|
|
|
from ..abstract import Page
|
|
|
|
from ..encyclopaedia_metallum import EncyclopaediaMetallum
|
|
|
|
from ..musify import Musify
|
|
|
|
|
2023-03-30 07:01:09 +00:00
|
|
|
NAME_PAGE_MAP: Dict[str, Type[Page]] = dict()
|
|
|
|
PAGE_NAME_MAP: Dict[Type[Page], str] = dict()
|
2023-03-30 10:31:37 +00:00
|
|
|
SOURCE_PAGE_MAP: Dict[SourcePages, Type[Page]] = dict()
|
2023-03-29 13:22:18 +00:00
|
|
|
|
2023-03-28 16:38:45 +00:00
|
|
|
ALL_PAGES: Tuple[Type[Page]] = (
|
2023-03-28 10:50:23 +00:00
|
|
|
EncyclopaediaMetallum,
|
|
|
|
Musify
|
2023-03-28 12:04:15 +00:00
|
|
|
)
|
|
|
|
|
2023-03-28 16:38:45 +00:00
|
|
|
AUDIO_PAGES: Tuple[Type[Page]] = (
|
2023-03-28 12:04:15 +00:00
|
|
|
Musify,
|
|
|
|
)
|
|
|
|
|
2023-03-28 16:38:45 +00:00
|
|
|
SHADY_PAGES: Tuple[Type[Page]] = (
|
2023-03-28 12:04:15 +00:00
|
|
|
Musify,
|
|
|
|
)
|
2023-03-28 10:50:23 +00:00
|
|
|
|
2023-03-29 15:04:06 +00:00
|
|
|
# this needs to be case insensitive
|
2023-03-29 13:22:18 +00:00
|
|
|
SHORTHANDS = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')
|
|
|
|
for i, page in enumerate(ALL_PAGES):
|
2023-03-30 07:01:09 +00:00
|
|
|
NAME_PAGE_MAP[page.__name__.lower()] = page
|
|
|
|
NAME_PAGE_MAP[SHORTHANDS[i].lower()] = page
|
2023-03-29 13:22:18 +00:00
|
|
|
|
2023-03-30 07:01:09 +00:00
|
|
|
PAGE_NAME_MAP[page] = SHORTHANDS[i]
|
2023-03-30 10:09:36 +00:00
|
|
|
|
|
|
|
SOURCE_PAGE_MAP[page.SOURCE_TYPE] = page
|
|
|
|
|