Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: service, commands, listeners with injection #26

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
feea032
wip: split commands into multiple files
tristiisch Sep 7, 2024
93927db
feat: register cmd using decorator
tristiisch Sep 8, 2024
f2d89bb
chore: rename class
tristiisch Sep 9, 2024
c84dedc
WIP: service injector
tristiisch Sep 9, 2024
7426279
feat: top level service injector
tristiisch Sep 15, 2024
0146a06
fix: class name
tristiisch Sep 15, 2024
379f1ed
tests: fix old config class usage
tristiisch Sep 16, 2024
0660dd5
chore: change MessageSender initialization
tristiisch Sep 17, 2024
93bbb7b
feat: add task with service injection
tristiisch Sep 17, 2024
57cccf5
feat: create service module
tristiisch Sep 17, 2024
e00b600
feat: move discord bot as service
tristiisch Sep 20, 2024
ac112cc
feat: create more service
tristiisch Sep 20, 2024
77aefba
feat: make deezer client a service, split all files that have multipl…
tristiisch Sep 21, 2024
269cae9
feat: remove deprecated class, use service in tests
tristiisch Sep 22, 2024
f5cb720
feat: socket server as a service
tristiisch Sep 26, 2024
5c55c42
fix: close tasks properly
tristiisch Sep 29, 2024
70d1bc6
feat: all commands are now registred to use injection
tristiisch Sep 29, 2024
513f420
fix: service start order
tristiisch Oct 1, 2024
1882d72
fix: tests service import
tristiisch Oct 1, 2024
bc2f415
tests: added for service injection
tristiisch Oct 3, 2024
8d25ee1
feat: adding message queue in a task
tristiisch Oct 7, 2024
c8a672f
feat: use select in socket
tristiisch Oct 7, 2024
2b16a42
chore: clean previous commits
tristiisch Oct 8, 2024
4d32719
fix: IDeezerDownloaderService init, and add deezer token checker in t…
tristiisch Nov 18, 2024
9b15da2
fix: err.args -> err.msg
tristiisch Nov 18, 2024
ba78c1b
debug: socket server
tristiisch Dec 5, 2024
d0c0685
fix: tests u
tristiisch Dec 5, 2024
83a3a48
fix: tests u
tristiisch Dec 5, 2024
f0fb7be
feat: discord output add emojis and rework regex for source url
tristiisch Dec 6, 2024
67b7c41
fix: ci-rule
tristiisch Dec 6, 2024
10011b5
fix: spotify regex
tristiisch Dec 6, 2024
fbaf5b6
feat: add deezer tests
tristiisch Dec 6, 2024
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
Prev Previous commit
Next Next commit
feat: make deezer client a service, split all files that have multipl…
…e class
tristiisch committed Nov 18, 2024
commit 77aefba40ef8e6ac7be8d6e53cd4e39426ae9fbe
78 changes: 78 additions & 0 deletions src/pyramid/api/services/deezer_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
from abc import abstractmethod

from deezer import Album, Artist, Playlist, Track
from pyramid.connector.deezer.client.a_deezer_client import ADeezerClient
from pyramid.connector.deezer.client.list_paginated import DeezerListPaginated

class IDeezerClientService(ADeezerClient):

@abstractmethod
def _search(
self,
path: str,
query: str = "",
strict: bool | None = None,
ordering: str | None = None,
**advanced_params: str | int | None,
) -> DeezerListPaginated:
pass

@abstractmethod
def search(
self,
query: str = "",
strict: bool | None = None,
ordering: str | None = None,
artist: str | None = None,
album: str | None = None,
track: str | None = None,
label: str | None = None,
dur_min: int | None = None,
dur_max: int | None = None,
bpm_min: int | None = None,
bpm_max: int | None = None,
) -> DeezerListPaginated:
pass

@abstractmethod
def search_playlists(
self,
query: str = "",
strict: bool | None = None,
ordering: str | None = None,
) -> DeezerListPaginated[Playlist]:
pass

@abstractmethod
def search_albums(
self,
query: str = "",
strict: bool | None = None,
ordering: str | None = None,
) -> DeezerListPaginated[Album]:
pass

@abstractmethod
def search_artists(
self,
query: str = "",
strict: bool | None = None,
ordering: str | None = None,
) -> DeezerListPaginated[Artist]:
pass

@abstractmethod
async def async_get_playlist(self, playlist_id: int) -> Playlist:
pass

@abstractmethod
async def async_get_album(self, album_id: int) -> Album:
pass

@abstractmethod
async def async_get_artist(self, artist_id: int) -> Artist:
pass

@abstractmethod
async def async_get_track(self, track_id: int) -> Track:
pass
2 changes: 1 addition & 1 deletion src/pyramid/api/services/deezer_downloader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC, abstractmethod
from typing import Any
from pyramid.data.track import Track
from pyramid.data.music.track import Track

class IDeezerDownloaderService(ABC):

2 changes: 1 addition & 1 deletion src/pyramid/api/services/deezer_search.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

from abc import ABC, abstractmethod
from pyramid.data.a_search import ASearch
from pyramid.data.track import TrackMinimalDeezer
from pyramid.data.music.track_minimal_deezer import TrackMinimalDeezer


class IDeezerSearchService(ASearch):
4 changes: 3 additions & 1 deletion src/pyramid/api/services/source_service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from abc import ABC, abstractmethod
from pyramid.data.source_type import SourceType
from pyramid.data.track import Track, TrackMinimal, TrackMinimalDeezer
from pyramid.data.music.track import Track
from pyramid.data.music.track_minimal_deezer import TrackMinimalDeezer
from pyramid.data.music.track_minimal import TrackMinimal

class ISourceService(ABC):

2 changes: 1 addition & 1 deletion src/pyramid/api/services/spotify_search.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import abstractmethod
from pyramid.data.a_search import ASearch
from pyramid.data.track import TrackMinimalSpotify
from pyramid.data.music.track_minimal_spotify import TrackMinimalSpotify


class ISpotifySearchService(ASearch):
2 changes: 1 addition & 1 deletion src/pyramid/api/services/spotify_search_id.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from abc import abstractmethod

from pyramid.data.a_search import ASearchId
from pyramid.data.track import TrackMinimalSpotify
from pyramid.data.music.track_minimal_spotify import TrackMinimalSpotify

class ISpotifySearchIdService(ASearchId):

Loading