2023-05-24 08:12:03 +00:00
|
|
|
from typing import List, Optional, Type
|
2023-04-18 12:57:51 +00:00
|
|
|
from urllib.parse import urlparse
|
2023-05-24 08:12:03 +00:00
|
|
|
import logging
|
2023-04-18 12:57:51 +00:00
|
|
|
|
|
|
|
|
2023-05-24 16:02:19 +00:00
|
|
|
from ..objects import Source, DatabaseObject
|
2023-04-18 12:57:51 +00:00
|
|
|
from .abstract import Page
|
|
|
|
from ..objects import (
|
|
|
|
Artist,
|
|
|
|
Source,
|
|
|
|
SourcePages,
|
|
|
|
Song,
|
|
|
|
Album,
|
|
|
|
Label,
|
2023-06-12 19:53:40 +00:00
|
|
|
Target
|
2023-04-18 12:57:51 +00:00
|
|
|
)
|
2023-05-24 08:12:03 +00:00
|
|
|
from ..connection import Connection
|
2023-10-23 14:21:44 +00:00
|
|
|
from ..utils.support_classes.query import Query
|
|
|
|
from ..utils.support_classes.download_result import DownloadResult
|
2023-05-24 08:12:03 +00:00
|
|
|
|
|
|
|
class Preset(Page):
|
|
|
|
# CHANGE
|
|
|
|
SOURCE_TYPE = SourcePages.PRESET
|
|
|
|
LOGGER = logging.getLogger("preset")
|
|
|
|
|
2023-05-25 11:46:47 +00:00
|
|
|
def __init__(self, *args, **kwargs):
|
2023-05-24 08:12:03 +00:00
|
|
|
self.connection: Connection = Connection(
|
|
|
|
host="https://www.preset.cum/",
|
|
|
|
logger=self.LOGGER
|
|
|
|
)
|
|
|
|
|
2023-05-25 11:46:47 +00:00
|
|
|
super().__init__(*args, **kwargs)
|
2023-05-24 08:12:03 +00:00
|
|
|
|
|
|
|
def get_source_type(self, source: Source) -> Optional[Type[DatabaseObject]]:
|
|
|
|
return super().get_source_type(source)
|
|
|
|
|
|
|
|
def general_search(self, search_query: str) -> List[DatabaseObject]:
|
|
|
|
return []
|
|
|
|
|
|
|
|
def label_search(self, label: Label) -> List[Label]:
|
|
|
|
return []
|
|
|
|
|
|
|
|
def artist_search(self, artist: Artist) -> List[Artist]:
|
|
|
|
return []
|
|
|
|
|
|
|
|
def album_search(self, album: Album) -> List[Album]:
|
|
|
|
return []
|
|
|
|
|
|
|
|
def song_search(self, song: Song) -> List[Song]:
|
|
|
|
return []
|
|
|
|
|
|
|
|
def fetch_song(self, source: Source, stop_at_level: int = 1) -> Song:
|
|
|
|
return Song()
|
|
|
|
|
|
|
|
def fetch_album(self, source: Source, stop_at_level: int = 1) -> Album:
|
|
|
|
return Album()
|
|
|
|
|
|
|
|
def fetch_artist(self, source: Source, stop_at_level: int = 1) -> Artist:
|
|
|
|
return Artist()
|
|
|
|
|
|
|
|
def fetch_label(self, source: Source, stop_at_level: int = 1) -> Label:
|
|
|
|
return Label()
|
2023-06-12 19:53:40 +00:00
|
|
|
|
|
|
|
def download_song_to_target(self, source: Source, target: Target, desc: str = None) -> DownloadResult:
|
|
|
|
return DownloadResult()
|