Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions data/radios.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
- lofi:
lofi:
- "https://www.youtube.com/watch?v=jfKfPfyJRdk"
- "https://www.youtube.com/watch?v=rUxyKA_-grg"
- "https://www.youtube.com/watch?v=HAZoLuME-PU"
- "https://www.youtube.com/watch?v=7NOSDKb0HlU"

- jazz:
jazz:
- "https://www.youtube.com/watch?v=Dx5qFachd3A"
- "https://www.youtube.com/watch?v=fEvM-OUbaKs"
- "https://www.youtube.com/watch?v=g06AjrOlki0"
- "https://www.youtube.com/watch?v=DSGyEsJ17cI"
- "https://www.youtube.com/watch?v=c3IVTi6TlfE"
- "https://www.youtube.com/watch?v=_rMZt292mJc"

- rocknroll:
rocknroll:
- "https://www.youtube.com/watch?v=zdBGqWnpDRk"
- "https://www.youtube.com/playlist?list=PLZN_exA7d4RVmCQrG5VlWIjMOkMFZVVOc"

- chiptune:
chiptune:
- "https://www.youtube.com/watch?v=KzFmtxFG9z4"
- "https://www.youtube.com/watch?v=VcQqVMQHYYU&pp=ygUOY2hpcHR1bmUgcmFkaW8%3D"

- synthwave:
synthwave:
- "https://www.youtube.com/playlist?list=PL9a7fFpVuuJCNx1VfUKlusNP-4TGBTuz5"
- "https://www.youtube.com/watch?v=Ss3DEK1rGuM"
- "https://www.youtube.com/watch?v=FvwJ_Fh5_uE"
- "https://www.youtube.com/watch?v=4xDzrJKXOOY"

- lounge:
lounge:
- "https://www.youtube.com/watch?v=fEvM-OUbaKs"
- "https://www.youtube.com/watch?v=Dx5qFachd3A"
- "https://www.youtube.com/watch?v=XQuR1OxYJt0"
- "https://www.youtube.com/watch?v=3XbEUv_MCj0"

- minecraft:
minecraft:
- "https://www.youtube.com/watch?v=Pa_s7ogtokM"
- "https://www.youtube.com/watch?v=TsTtqGAxvWk"
- "https://www.youtube.com/watch?v=Dg0IjOzopYU"
- "https://www.youtube.com/watch?v=snphzO9UFJM"
- "https://www.youtube.com/watch?v=0KvlwMd3C4Y"
- "https://www.youtube.com/playlist?list=PL3817D41C7D841E23"

- rap:
rap:
- "https://www.youtube.com/watch?v=05689ErDUdM"
- "https://www.youtube.com/watch?v=0MOkLkTP-Jk"

- phonk:
phonk:
- https://www.youtube.com/watch?v=S6helKOW5P0
- https://www.youtube.com/watch?v=8v_kKMaq5po

- poprock:
poprock:
- "https://www.youtube.com/watch?v=EurKD84TFtA"
- "https://www.youtube.com/watch?v=uRImXboQnzE"
- "https://www.youtube.com/watch?v=Va-h6WZPUzQ"

- workout:
workout:
- "https://www.youtube.com/watch?v=qWf-FPFmVw0"
- "https://www.youtube.com/watch?v=fBnpWP4Fneg"
- "https://www.youtube.com/watch?v=bT408U-LOn8"

- trap:
trap:
- "https://www.youtube.com/watch?v=EA-6o1_vrsA"
- "https://www.youtube.com/watch?v=-cCR-oqsLRQ"
- https://www.youtube.com/watch?v=EapVttArmsE

- slowed:
slowed:
- "https://www.youtube.com/playlist?list=PLF_ZnpSKNQQFTeHaQ1ZR5l5cx5nRiD80w"
- "https://www.youtube.com/playlist?list=PLsmLp2JHrigK1FBB-nuy3panZJzH5sHWO"
1 change: 0 additions & 1 deletion jukebot/abstract_components/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from .abstract_cache import AbstractCache as AbstractCache
from .abstract_collection import AbstractCollection as AbstractCollection
from .abstract_map import AbstractMap as AbstractMap
from .abstract_request import AbstractRequest as AbstractRequest
Expand Down
39 changes: 0 additions & 39 deletions jukebot/abstract_components/abstract_cache.py

This file was deleted.

12 changes: 6 additions & 6 deletions jukebot/abstract_components/abstract_collection.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
from __future__ import annotations

from collections import abc
from collections.abc import Iterator
from dataclasses import dataclass
from typing import TypeVar
from typing import TYPE_CHECKING

_T = TypeVar("_T")
if TYPE_CHECKING:
from collections.abc import Iterator


@dataclass
class AbstractCollection[T](abc.Collection):
set: list[_T]
set: list[T]

def __len__(self) -> int:
return len(self.set)

def __iter__(self) -> Iterator[_T]:
def __iter__(self) -> Iterator[T]:
yield from self.set

def __contains__(self, e: object) -> bool:
return e in self.set

def __getitem__(self, idx: int) -> _T:
def __getitem__(self, idx: int) -> T:
return self.set[idx]

def __str__(self) -> str:
Expand Down
21 changes: 11 additions & 10 deletions jukebot/abstract_components/abstract_map.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
from __future__ import annotations

from collections import abc
from collections.abc import Iterator
from typing import TypeVar
from typing import TYPE_CHECKING

_T = TypeVar("_T")
_V = TypeVar("_V")
if TYPE_CHECKING:
from collections.abc import Iterator


class AbstractMap[T, V](abc.MutableMapping):
def __new__(cls):
_collection: dict[T, V]

def __new__(cls, *args, **kwargs):
instance = super().__new__(cls)
instance._collection = {}
return instance

def __setitem__(self, k: _T, v: _V) -> None:
def __setitem__(self, k: T, v: V) -> None:
self._collection[k] = v

def __contains__(self, k: _T):
def __contains__(self, k: object) -> bool:
return k in self._collection

def __delitem__(self, k: _T) -> None:
def __delitem__(self, k: T) -> None:
del self._collection[k]

def __getitem__(self, k: _T) -> _V:
def __getitem__(self, k: T) -> V:
return self._collection[k]

def __len__(self) -> int:
return len(self._collection)

def __iter__(self) -> Iterator[_T]:
def __iter__(self) -> Iterator[T]:
yield from self._collection

def __str__(self) -> str:
Expand Down
10 changes: 9 additions & 1 deletion jukebot/abstract_components/abstract_service.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING:
from jukebot.jukebot import JukeBot


class AbstractService:
"""This class allow you to implement your own service and using it from the bot.
To implement a service, create a new file in the `services` package then implement this class.
Expand All @@ -6,7 +14,7 @@ class AbstractService:
To use a service: `bot.services.XXX` where `XXX` is your previous named action.
"""

def __init__(self, bot):
def __init__(self, bot: JukeBot):
self.bot = bot

async def __call__(self, *args, **kwargs):
Expand Down
Loading
Loading