From 8ab3ae9ccdb101eaf8fa2d425eabb74e595c48fc Mon Sep 17 00:00:00 2001 From: "Zander M." Date: Sat, 17 Aug 2024 00:44:51 -0400 Subject: [PATCH 1/6] Add websockets dependency to Pipenv --- Pipfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Pipfile b/Pipfile index c0aebbe..7c15120 100644 --- a/Pipfile +++ b/Pipfile @@ -6,6 +6,7 @@ name = "pypi" [packages] orjson = "*" "discord.py" = {extras = ["voice"], version = "*"} +websockets = "*" [dev-packages] mypy = "*" From 817295d3214f4bd320694a74c0a4a4a1e08855a4 Mon Sep 17 00:00:00 2001 From: "Zander M." Date: Sat, 17 Aug 2024 00:46:32 -0400 Subject: [PATCH 2/6] Add support for other unsupported source types --- pomice/enums.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pomice/enums.py b/pomice/enums.py index 1e963de..ad69209 100644 --- a/pomice/enums.py +++ b/pomice/enums.py @@ -54,6 +54,8 @@ class TrackType(Enum): TrackType.HTTP defines that the track is from an HTTP source. TrackType.LOCAL defines that the track is from a local source. + + TrackType.OTHER defines that the track is from an unknown source (possible from 3rd-party plugins). """ # We don't have to define anything special for these, since these just serve as flags @@ -63,6 +65,11 @@ class TrackType(Enum): APPLE_MUSIC = "apple_music" HTTP = "http" LOCAL = "local" + OTHER = 'other' + + @classmethod + def _missing_(cls, value): + return cls.OTHER def __str__(self) -> str: return self.value From 851f00aa9702a52ecf5d75927764cdf497c0e50e Mon Sep 17 00:00:00 2001 From: "Zander M." Date: Sat, 17 Aug 2024 01:23:59 -0400 Subject: [PATCH 3/6] Add support for other unsupported playlist types --- pomice/enums.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pomice/enums.py b/pomice/enums.py index ad69209..65d9c9e 100644 --- a/pomice/enums.py +++ b/pomice/enums.py @@ -86,6 +86,8 @@ class PlaylistType(Enum): PlaylistType.SPOTIFY defines that the playlist is from Spotify PlaylistType.APPLE_MUSIC defines that the playlist is from Apple Music. + + PlaylistType.OTHER defines that the playlist is from an unknown source (possible from 3rd-party plugins). """ # We don't have to define anything special for these, since these just serve as flags @@ -93,6 +95,11 @@ class PlaylistType(Enum): SOUNDCLOUD = "soundcloud" SPOTIFY = "spotify" APPLE_MUSIC = "apple_music" + OTHER = "other" + + @classmethod + def _missing_(cls, value): + return cls.OTHER def __str__(self) -> str: return self.value From 2e0f5b365a06753d68ed5e684645f8ad3a62d7a2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 17 Aug 2024 05:44:33 +0000 Subject: [PATCH 4/6] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pomice/enums.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pomice/enums.py b/pomice/enums.py index 65d9c9e..e5f09f4 100644 --- a/pomice/enums.py +++ b/pomice/enums.py @@ -65,7 +65,7 @@ class TrackType(Enum): APPLE_MUSIC = "apple_music" HTTP = "http" LOCAL = "local" - OTHER = 'other' + OTHER = "other" @classmethod def _missing_(cls, value): From ba9534bc2726af1f4494dd76d5fe6d67fd90e548 Mon Sep 17 00:00:00 2001 From: Zander <28664144+ZandercraftGames@users.noreply.github.com> Date: Sun, 18 Aug 2024 00:34:32 -0400 Subject: [PATCH 5/6] Typing fix from NiceAesth Co-authored-by: Andrei Baciu <8437201+NiceAesth@users.noreply.github.com> --- pomice/enums.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pomice/enums.py b/pomice/enums.py index e5f09f4..c4e86e8 100644 --- a/pomice/enums.py +++ b/pomice/enums.py @@ -68,7 +68,7 @@ class TrackType(Enum): OTHER = "other" @classmethod - def _missing_(cls, value): + def _missing_(cls, _: object) -> "TrackType": return cls.OTHER def __str__(self) -> str: From be7106616bb2dce41f352bbcd1c1b2f65792a7e0 Mon Sep 17 00:00:00 2001 From: Zander <28664144+ZandercraftGames@users.noreply.github.com> Date: Sun, 18 Aug 2024 00:34:43 -0400 Subject: [PATCH 6/6] Typing fix from NiceAesth Co-authored-by: Andrei Baciu <8437201+NiceAesth@users.noreply.github.com> --- pomice/enums.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pomice/enums.py b/pomice/enums.py index c4e86e8..513b0dc 100644 --- a/pomice/enums.py +++ b/pomice/enums.py @@ -98,7 +98,7 @@ class PlaylistType(Enum): OTHER = "other" @classmethod - def _missing_(cls, value): + def _missing_(cls, _: object) -> "PlaylistType": return cls.OTHER def __str__(self) -> str: