mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61ec913789 | ||
|
|
88b11f2b9c | ||
|
|
9ca0ced2d8 | ||
|
|
a5a178bfaf | ||
|
|
eeb90aaa45 | ||
|
|
b7a59b5e4c | ||
|
|
2769ea025f | ||
|
|
818420a641 | ||
|
|
3c49a77e34 | ||
|
|
90691ba2b9 | ||
|
|
68f2806204 | ||
|
|
903992f48a |
41
.github/workflows/publish_release.yml
vendored
41
.github/workflows/publish_release.yml
vendored
@@ -80,14 +80,43 @@ jobs:
|
||||
name: build-output
|
||||
path: ./dist
|
||||
|
||||
generate_default_ll_server_config:
|
||||
name: Generate default application.yml
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: Install script's dependencies
|
||||
run: python -m pip install PyYAML
|
||||
|
||||
- name: Generate default application.yml
|
||||
env:
|
||||
APP_YML_FILE: "Red-DiscordBot-${{ github.ref_name }}-default-lavalink-application.yml"
|
||||
run: |
|
||||
mkdir -p dist
|
||||
python .github/workflows/scripts/get_default_ll_server_config.py "dist/$APP_YML_FILE"
|
||||
|
||||
- name: Upload default application.yml
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ll-default-server-config
|
||||
path: ./dist
|
||||
|
||||
release_to_pypi:
|
||||
needs:
|
||||
- release_information
|
||||
- build
|
||||
- generate_default_ll_server_config
|
||||
environment: Release
|
||||
name: Release to PyPI
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Download packaged distributions
|
||||
@@ -96,6 +125,18 @@ jobs:
|
||||
name: build-output
|
||||
path: dist/
|
||||
|
||||
- name: Download default application.yml
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ll-default-server-config
|
||||
path: dist/
|
||||
|
||||
- name: Upload dists to GitHub Release
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ github.token }}"
|
||||
run: |
|
||||
gh release upload "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY"
|
||||
|
||||
- name: Publish package distributions to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
|
||||
31
.github/workflows/scripts/get_default_ll_server_config.py
vendored
Normal file
31
.github/workflows/scripts/get_default_ll_server_config.py
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
||||
ROOT_FOLDER = Path(__file__).parents[3].absolute()
|
||||
AUDIO_FOLDER = ROOT_FOLDER / "redbot/cogs/audio"
|
||||
|
||||
# We want to import `redbot.cogs.audio.managed_node` package as if it were top-level package
|
||||
# so we have to the `redbot/cogs/audio` directory to Python's path.
|
||||
sys.path.insert(0, str(AUDIO_FOLDER))
|
||||
|
||||
|
||||
def main() -> int:
|
||||
try:
|
||||
output_file = sys.argv[1]
|
||||
except IndexError:
|
||||
print("Usage:", sys.argv[0], "<output_file>", file=sys.stderr)
|
||||
return 2
|
||||
|
||||
import managed_node
|
||||
|
||||
server_config = managed_node.get_default_server_config()
|
||||
with open(output_file, "w", encoding="utf-8") as fp:
|
||||
yaml.safe_dump(server_config, fp)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
33
CHANGES.rst
33
CHANGES.rst
@@ -1,5 +1,38 @@
|
||||
.. Red changelogs
|
||||
|
||||
Redbot 3.5.13 (2024-08-27)
|
||||
==========================
|
||||
|
||||
| Thanks to all these amazing people that contributed to this release:
|
||||
| :ghuser:`aikaterna`, :ghuser:`Guyonsteroids`, :ghuser:`Jackenmen`, :ghuser:`Kowlin`
|
||||
|
||||
Read before updating
|
||||
--------------------
|
||||
|
||||
#. Information for Audio users that are using an external Lavalink instance (if you don't know what that is, you should skip this point):
|
||||
|
||||
We've updated our default application.yml file and you should update your instance's ``application.yml`` accordingly.
|
||||
More specifically, we bumped the version of YT source plugin.
|
||||
`Download Red 3.5.13's default application.yml file <https://github.com/Cog-Creators/Red-DiscordBot/releases/download/3.5.13/Red-DiscordBot-3.5.13-default-lavalink-application.yml>`__
|
||||
|
||||
End-user changelog
|
||||
------------------
|
||||
|
||||
Changes
|
||||
*******
|
||||
|
||||
- **Core - Dependencies** - Red's dependencies have been bumped (:issue:`6436`)
|
||||
|
||||
Fixes
|
||||
*****
|
||||
|
||||
- **Cogs - Audio** - Updated Audio to support planned changes to Discord API scheduled for November (:issue:`6435`)
|
||||
- **Cogs - Audio** - Fixed YT live stream detection (:issue:`6435`)
|
||||
- **Cogs - Audio** - Fixed Red erroneously trying to send a message to a notification channel when one is not set (:issue:`6429`)
|
||||
- **Cogs - Trivia - Lists** - Fixed spelling of Steven Spielberg's first name in the ``entertainment`` trivia list (:issue:`6434`)
|
||||
|
||||
----
|
||||
|
||||
Redbot 3.5.12 (2024-08-08)
|
||||
==========================
|
||||
|
||||
|
||||
@@ -339,7 +339,7 @@ def _early_init():
|
||||
|
||||
|
||||
# This is bumped automatically by release workflow (`.github/workflows/scripts/bump_version.py`)
|
||||
_VERSION = "3.5.12"
|
||||
_VERSION = "3.5.13"
|
||||
|
||||
__version__, version_info = VersionInfo._get_version()
|
||||
|
||||
|
||||
25
redbot/cogs/audio/core/commands/locales/pt-BR.po
generated
25
redbot/cogs/audio/core/commands/locales/pt-BR.po
generated
@@ -393,7 +393,30 @@ msgid "Set a playlist to auto-play songs from.\n\n"
|
||||
" `[p]audioset autoplay playlist MyGlobalPlaylist --scope Global`\n"
|
||||
" `[p]audioset autoplay playlist PersonalPlaylist --scope User --author Draper`\n"
|
||||
" "
|
||||
msgstr ""
|
||||
msgstr "Define uma lista de reprodução para a reprodução automática.\n\n"
|
||||
" **Uso**:\n"
|
||||
" `[p]audioset autoplay nome_lista_reproducao_OU_id [argumentos]`\n\n"
|
||||
" **Argumentos**:\n"
|
||||
" Os seguintes são todos opcionais:\n"
|
||||
" --scope <escopo>\n"
|
||||
" --author [usuário]\n"
|
||||
" --guild [servidor] **Somente o(a) dono(a) do bot pode usar esse**\n\n"
|
||||
" **Scope** (escopo) pode ser um dos seguintes:\n"
|
||||
" Global\n"
|
||||
" Guild (servidor)\n"
|
||||
" User (usuário(a))\n\n"
|
||||
" **Author** (autor) pode ser um dos seguintes:\n"
|
||||
" ID de usuário\n"
|
||||
" Menção a usuário\n"
|
||||
" NomeDeUsuario#123\n\n"
|
||||
" **Guild** (servidor) pode ser um dos seguintes:\n"
|
||||
" ID de servidor\n"
|
||||
" Nome exato do servidor\n\n"
|
||||
" Exemplos de uso:\n"
|
||||
" `[p]audioset autoplay ListaDeReproducaoDaGuilda`\n"
|
||||
" `[p]audioset autoplay ListaDeReproducaoGlobal --scope Global`\n"
|
||||
" `[p]audioset autoplay ListaDeReproducaoPessoal --scope User --author Draper`\n"
|
||||
" "
|
||||
|
||||
#: redbot/cogs/audio/core/commands/audioset.py:497
|
||||
#: redbot/cogs/audio/core/commands/playlists.py:105
|
||||
|
||||
@@ -198,6 +198,8 @@ class AudioEvents(MixinMeta, metaclass=CompositeMetaClass):
|
||||
if not guild:
|
||||
return
|
||||
notify_channel = guild.get_channel_or_thread(player.fetch("notify_channel"))
|
||||
if not notify_channel:
|
||||
return
|
||||
has_perms = self._has_notify_perms(notify_channel)
|
||||
tries = 0
|
||||
while not player._is_playing:
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/ar-SA.po
generated
4
redbot/cogs/audio/core/events/locales/ar-SA.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Arabic\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: ar_SA\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/bg-BG.po
generated
4
redbot/cogs/audio/core/events/locales/bg-BG.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Bulgarian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: bg_BG\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/cs-CZ.po
generated
4
redbot/cogs/audio/core/events/locales/cs-CZ.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Czech\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: cs_CZ\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/da-DK.po
generated
4
redbot/cogs/audio/core/events/locales/da-DK.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Danish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: da_DK\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/de-DE.po
generated
4
redbot/cogs/audio/core/events/locales/de-DE.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: German\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: de_DE\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Automatische Wiedergabe gestartet."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/es-ES.po
generated
4
redbot/cogs/audio/core/events/locales/es-ES.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Spanish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: es_ES\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Auto reproducción iniciada."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/fi-FI.po
generated
4
redbot/cogs/audio/core/events/locales/fi-FI.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Finnish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: fi_FI\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Automaattinen toisto aloitettu."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/fr-FR.po
generated
4
redbot/cogs/audio/core/events/locales/fr-FR.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: French\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: fr_FR\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Lecture automatique démarrée."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/hi-IN.po
generated
4
redbot/cogs/audio/core/events/locales/hi-IN.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Hindi\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: hi_IN\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/hr-HR.po
generated
4
redbot/cogs/audio/core/events/locales/hr-HR.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Croatian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: hr_HR\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Počela je automatska reprodukcija."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/hu-HU.po
generated
4
redbot/cogs/audio/core/events/locales/hu-HU.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Hungarian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: hu_HU\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/id-ID.po
generated
4
redbot/cogs/audio/core/events/locales/id-ID.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Indonesian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: id_ID\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/it-IT.po
generated
4
redbot/cogs/audio/core/events/locales/it-IT.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Italian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: it_IT\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/ja-JP.po
generated
4
redbot/cogs/audio/core/events/locales/ja-JP.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Japanese\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: ja_JP\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "自動再生を開始しました"
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/ko-KR.po
generated
4
redbot/cogs/audio/core/events/locales/ko-KR.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Korean\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: ko_KR\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "자동재생이 시작되었어요"
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/nb-NO.po
generated
4
redbot/cogs/audio/core/events/locales/nb-NO.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Norwegian Bokmal\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: nb_NO\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Automatisk avspilling startet."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/nl-NL.po
generated
4
redbot/cogs/audio/core/events/locales/nl-NL.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Dutch\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: nl_NL\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/pl-PL.po
generated
4
redbot/cogs/audio/core/events/locales/pl-PL.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Polish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: pl_PL\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Automatyczne odtwarzanie rozpoczęte."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/pt-BR.po
generated
4
redbot/cogs/audio/core/events/locales/pt-BR.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Portuguese, Brazilian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: pt_BR\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Reprodução automática iniciada."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/pt-PT.po
generated
4
redbot/cogs/audio/core/events/locales/pt-PT.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Portuguese\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: pt_PT\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Reprodução automática iniciada."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/ru-RU.po
generated
4
redbot/cogs/audio/core/events/locales/ru-RU.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Russian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: ru_RU\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Автоматическое воспроизведение запущено."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/sk-SK.po
generated
4
redbot/cogs/audio/core/events/locales/sk-SK.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Slovak\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: sk_SK\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Automatické prehrávanie sa spustilo."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/sl-SI.po
generated
4
redbot/cogs/audio/core/events/locales/sl-SI.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Slovenian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: sl_SI\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Samodejno predvajanje se je začelo."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/sv-SE.po
generated
4
redbot/cogs/audio/core/events/locales/sv-SE.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Swedish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: sv_SE\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/tr-TR.po
generated
4
redbot/cogs/audio/core/events/locales/tr-TR.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Turkish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: tr_TR\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Otomatik çalma başladı."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/uk-UA.po
generated
4
redbot/cogs/audio/core/events/locales/uk-UA.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Ukrainian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: uk_UA\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/vi-VN.po
generated
4
redbot/cogs/audio/core/events/locales/vi-VN.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Vietnamese\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: vi_VN\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "Tự động phát đã bắt đầu."
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/zh-CN.po
generated
4
redbot/cogs/audio/core/events/locales/zh-CN.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Chinese Simplified\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: zh_CN\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr ""
|
||||
|
||||
|
||||
4
redbot/cogs/audio/core/events/locales/zh-TW.po
generated
4
redbot/cogs/audio/core/events/locales/zh-TW.po
generated
@@ -1,7 +1,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-07-10 18:37+0000\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:53+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Chinese Traditional\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,7 +15,7 @@ msgstr ""
|
||||
"X-Crowdin-File-ID: 670\n"
|
||||
"Language: zh_TW\n"
|
||||
|
||||
#: redbot/cogs/audio/core/events/cog.py:216
|
||||
#: redbot/cogs/audio/core/events/cog.py:218
|
||||
msgid "Auto Play started."
|
||||
msgstr "已開始自動播放。"
|
||||
|
||||
|
||||
16
redbot/cogs/audio/managed_node/__init__.py
Normal file
16
redbot/cogs/audio/managed_node/__init__.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Note: contents of this package are meant to be self-contained
|
||||
# and should not depend on anything in Red or on external dependencies.
|
||||
|
||||
from .ll_server_config import generate_server_config, get_default_server_config
|
||||
from .ll_version import LAVALINK_BUILD_LINE, LavalinkOldVersion, LavalinkVersion
|
||||
from .version_pins import JAR_VERSION, YT_PLUGIN_VERSION
|
||||
|
||||
__all__ = (
|
||||
"generate_server_config",
|
||||
"get_default_server_config",
|
||||
"LAVALINK_BUILD_LINE",
|
||||
"LavalinkOldVersion",
|
||||
"LavalinkVersion",
|
||||
"JAR_VERSION",
|
||||
"YT_PLUGIN_VERSION",
|
||||
)
|
||||
119
redbot/cogs/audio/managed_node/ll_server_config.py
Normal file
119
redbot/cogs/audio/managed_node/ll_server_config.py
Normal file
@@ -0,0 +1,119 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, Final
|
||||
|
||||
from . import version_pins
|
||||
|
||||
__all__ = (
|
||||
"DEFAULT_LAVALINK_YAML",
|
||||
"get_default_server_config",
|
||||
"generate_server_config",
|
||||
"change_dict_naming_convention",
|
||||
)
|
||||
|
||||
YT_PLUGIN_REPOSITORY: Final[str] = "https://maven.lavalink.dev/releases"
|
||||
|
||||
DEFAULT_LAVALINK_YAML = {
|
||||
# The nesting structure of this dict is very important, it's a 1:1 mirror of application.yaml in JSON
|
||||
"yaml__server__address": "localhost",
|
||||
"yaml__server__port": 2333,
|
||||
"yaml__lavalink__server__password": "youshallnotpass",
|
||||
"yaml__lavalink__server__sources__http": True,
|
||||
"yaml__lavalink__server__sources__bandcamp": True,
|
||||
"yaml__lavalink__server__sources__local": True,
|
||||
"yaml__lavalink__server__sources__soundcloud": True,
|
||||
"yaml__lavalink__server__sources__youtube": True,
|
||||
"yaml__lavalink__server__sources__twitch": True,
|
||||
"yaml__lavalink__server__sources__vimeo": True,
|
||||
"yaml__lavalink__server__bufferDurationMs": 400,
|
||||
"yaml__lavalink__server__frameBufferDurationMs": 1000,
|
||||
# 100 pages - 100 entries per page = 10,000 tracks which is the Audio Limit for a single playlist.
|
||||
"yaml__lavalink__server__youtubePlaylistLoadLimit": 100,
|
||||
"yaml__lavalink__server__playerUpdateInterval": 1,
|
||||
"yaml__lavalink__server__youtubeSearchEnabled": True,
|
||||
"yaml__lavalink__server__soundcloudSearchEnabled": True,
|
||||
"yaml__lavalink__server__gc_warnings": True,
|
||||
"yaml__metrics__prometheus__enabled": False,
|
||||
"yaml__metrics__prometheus__endpoint": "/metrics",
|
||||
"yaml__sentry__dsn": "",
|
||||
"yaml__sentry__environment": "",
|
||||
"yaml__logging__file__path": "./logs/",
|
||||
"yaml__logging__level__root": "INFO",
|
||||
"yaml__logging__level__lavalink": "INFO",
|
||||
"yaml__logging__logback__rollingpolicy__max_history": 15,
|
||||
"yaml__logging__logback__rollingpolicy__max_size": "10MB",
|
||||
# plugin configuration - note that the plugin may be disabled by the manager
|
||||
"yaml__plugins__youtube__enabled": True,
|
||||
"yaml__plugins__youtube__allowSearch": True,
|
||||
"yaml__plugins__youtube__allowDirectVideoIds": True,
|
||||
"yaml__plugins__youtube__allowDirectPlaylistIds": True,
|
||||
"yaml__plugins__youtube__clients": [
|
||||
"MUSIC",
|
||||
"WEB",
|
||||
"ANDROID_TESTSUITE",
|
||||
"TVHTML5EMBEDDED",
|
||||
"ANDROID_LITE",
|
||||
"MEDIA_CONNECT",
|
||||
"IOS",
|
||||
],
|
||||
"yaml__plugins__youtube__WEB__playback": True,
|
||||
"yaml__plugins__youtube__TVHTML5EMBEDDED__playlistLoading": False,
|
||||
"yaml__plugins__youtube__TVHTML5EMBEDDED__videoLoading": False,
|
||||
"yaml__plugins__youtube__TVHTML5EMBEDDED__searching": False,
|
||||
}
|
||||
|
||||
|
||||
def _unflatten_config_defaults(config_defaults: Dict[str, Any]) -> Dict[str, Any]:
|
||||
ret: Dict[str, Any] = {}
|
||||
|
||||
# based on Config._get_defaults_dict()
|
||||
for flat_key, value in config_defaults.items():
|
||||
keys = flat_key.split("__")
|
||||
partial = ret
|
||||
for idx, key in enumerate(keys, start=1):
|
||||
if idx == len(keys):
|
||||
partial[key] = value
|
||||
else:
|
||||
partial = partial.setdefault(key, {})
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
def get_default_server_config() -> Dict[str, Any]:
|
||||
return generate_server_config(_unflatten_config_defaults(DEFAULT_LAVALINK_YAML)["yaml"])
|
||||
|
||||
|
||||
def generate_server_config(config_data: Dict[str, Any]) -> Dict[str, Any]:
|
||||
data = change_dict_naming_convention(config_data)
|
||||
ll_config = data["lavalink"]
|
||||
sources = ll_config["server"]["sources"]
|
||||
plugins = ll_config.setdefault("plugins", [])
|
||||
|
||||
enable_yt_plugin = sources["youtube"]
|
||||
if enable_yt_plugin:
|
||||
sources["youtube"] = False
|
||||
yt_plugin = {
|
||||
"dependency": f"dev.lavalink.youtube:youtube-plugin:{version_pins.YT_PLUGIN_VERSION}",
|
||||
"repository": YT_PLUGIN_REPOSITORY,
|
||||
}
|
||||
plugins.append(yt_plugin)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
# This assumes all keys with `_` should be converted from `part1_part2` to `part1-part2`
|
||||
def _convert_function(key: str) -> str:
|
||||
return key.replace("_", "-")
|
||||
|
||||
|
||||
def change_dict_naming_convention(data: Any) -> Any:
|
||||
ret: Any = data
|
||||
if isinstance(data, dict):
|
||||
ret = {}
|
||||
for key, value in data.items():
|
||||
ret[_convert_function(key)] = change_dict_naming_convention(value)
|
||||
elif isinstance(data, list):
|
||||
ret = []
|
||||
for value in data:
|
||||
ret.append(change_dict_naming_convention(value))
|
||||
return ret
|
||||
204
redbot/cogs/audio/managed_node/ll_version.py
Normal file
204
redbot/cogs/audio/managed_node/ll_version.py
Normal file
@@ -0,0 +1,204 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from typing import Final, Optional, Pattern, Tuple
|
||||
|
||||
__all__ = (
|
||||
"LAVALINK_BUILD_LINE",
|
||||
"LavalinkOldVersion",
|
||||
"LavalinkVersion",
|
||||
)
|
||||
|
||||
|
||||
# present until Lavalink 3.5-rc4
|
||||
LAVALINK_BUILD_LINE: Final[Pattern] = re.compile(rb"^Build:\s+(?P<build>\d+)$", re.MULTILINE)
|
||||
# we don't actually care about what the version format before 3.5-rc4 is exactly
|
||||
# as the comparison is based entirely on the build number
|
||||
_LAVALINK_VERSION_LINE_PRE35: Final[Pattern] = re.compile(
|
||||
rb"^Version:\s+(?P<version>\S+)$", re.MULTILINE | re.VERBOSE
|
||||
)
|
||||
# used for LL versions >=3.5-rc4 but below 3.6.
|
||||
# Since this only applies to historical version, this regex is based only on
|
||||
# version numbers that actually existed, not ones that technically could.
|
||||
_LAVALINK_VERSION_LINE_PRE36: Final[Pattern] = re.compile(
|
||||
rb"""
|
||||
^
|
||||
Version:\s+
|
||||
(?P<version>
|
||||
(?P<major>3)\.(?P<minor>[0-5])
|
||||
# Before LL 3.6, when patch version == 0, it was stripped from the version string
|
||||
(?:\.(?P<patch>[1-9]\d*))?
|
||||
# Before LL 3.6, the dot in rc.N was optional
|
||||
(?:-rc\.?(?P<rc>0|[1-9]\d*))?
|
||||
# additional build metadata, can be used by our downstream Lavalink
|
||||
# if we need to alter an upstream release
|
||||
(?:\+red\.(?P<red>[1-9]\d*))?
|
||||
)
|
||||
$
|
||||
""",
|
||||
re.MULTILINE | re.VERBOSE,
|
||||
)
|
||||
# used for LL 3.6 and newer
|
||||
# This regex is limited to the realistic usage in the LL version number,
|
||||
# not everything that could be a part of it according to the spec.
|
||||
# We can easily release an update to this regex in the future if it ever becomes necessary.
|
||||
_LAVALINK_VERSION_LINE: Final[Pattern] = re.compile(
|
||||
rb"""
|
||||
^
|
||||
Version:\s+
|
||||
(?P<version>
|
||||
(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)
|
||||
(?:-rc\.(?P<rc>0|[1-9]\d*))?
|
||||
# additional build metadata, can be used by our downstream Lavalink
|
||||
# if we need to alter an upstream release
|
||||
(?:\+red\.(?P<red>[1-9]\d*))?
|
||||
)
|
||||
$
|
||||
""",
|
||||
re.MULTILINE | re.VERBOSE,
|
||||
)
|
||||
|
||||
|
||||
class LavalinkOldVersion:
|
||||
def __init__(self, raw_version: str, *, build_number: int) -> None:
|
||||
self.raw_version = raw_version
|
||||
self.build_number = build_number
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.raw_version}_{self.build_number}"
|
||||
|
||||
@classmethod
|
||||
def from_version_output(cls, output: bytes) -> LavalinkOldVersion:
|
||||
build_match = LAVALINK_BUILD_LINE.search(output)
|
||||
if build_match is None:
|
||||
raise ValueError(
|
||||
"Could not find 'Build' line in the given `--version` output,"
|
||||
" or invalid build number given."
|
||||
)
|
||||
version_match = _LAVALINK_VERSION_LINE_PRE35.search(output)
|
||||
if version_match is None:
|
||||
raise ValueError(
|
||||
"Could not find 'Version' line in the given `--version` output,"
|
||||
" or invalid version number given."
|
||||
)
|
||||
return cls(
|
||||
raw_version=version_match["version"].decode(),
|
||||
build_number=int(build_match["build"]),
|
||||
)
|
||||
|
||||
def __eq__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return self.build_number == other.build_number
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
def __lt__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return self.build_number < other.build_number
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return True
|
||||
return NotImplemented
|
||||
|
||||
def __le__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return self.build_number <= other.build_number
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return True
|
||||
return NotImplemented
|
||||
|
||||
def __gt__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return self.build_number > other.build_number
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
def __ge__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return self.build_number >= other.build_number
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
|
||||
class LavalinkVersion:
|
||||
def __init__(
|
||||
self,
|
||||
major: int,
|
||||
minor: int,
|
||||
patch: int = 0,
|
||||
*,
|
||||
rc: Optional[int] = None,
|
||||
red: int = 0,
|
||||
) -> None:
|
||||
self.major = major
|
||||
self.minor = minor
|
||||
self.patch = patch
|
||||
self.rc = rc
|
||||
self.red = red
|
||||
|
||||
def __str__(self) -> str:
|
||||
version = f"{self.major}.{self.minor}.{self.patch}"
|
||||
if self.rc is not None:
|
||||
version += f"-rc.{self.rc}"
|
||||
if self.red:
|
||||
version += f"+red.{self.red}"
|
||||
return version
|
||||
|
||||
@classmethod
|
||||
def from_version_output(cls, output: bytes) -> LavalinkVersion:
|
||||
match = _LAVALINK_VERSION_LINE.search(output)
|
||||
if match is None:
|
||||
# >=3.5-rc4, <3.6
|
||||
match = _LAVALINK_VERSION_LINE_PRE36.search(output)
|
||||
if match is None:
|
||||
raise ValueError(
|
||||
"Could not find 'Version' line in the given `--version` output,"
|
||||
" or invalid version number given."
|
||||
)
|
||||
return cls(
|
||||
major=int(match["major"]),
|
||||
minor=int(match["minor"]),
|
||||
patch=int(match["patch"] or 0),
|
||||
rc=int(match["rc"]) if match["rc"] is not None else None,
|
||||
red=int(match["red"] or 0),
|
||||
)
|
||||
|
||||
def _get_comparison_tuple(self) -> Tuple[int, int, int, bool, int, int]:
|
||||
return self.major, self.minor, self.patch, self.rc is None, self.rc or 0, self.red
|
||||
|
||||
def __eq__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return self._get_comparison_tuple() == other._get_comparison_tuple()
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
def __lt__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return self._get_comparison_tuple() < other._get_comparison_tuple()
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
def __le__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return self._get_comparison_tuple() <= other._get_comparison_tuple()
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
def __gt__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return self._get_comparison_tuple() > other._get_comparison_tuple()
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return True
|
||||
return NotImplemented
|
||||
|
||||
def __ge__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return self._get_comparison_tuple() >= other._get_comparison_tuple()
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return True
|
||||
return NotImplemented
|
||||
17
redbot/cogs/audio/managed_node/locales/ar-SA.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/ar-SA.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Arabic\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=6; plural=(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: ar\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: ar_SA\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/bg-BG.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/bg-BG.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Bulgarian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: bg\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: bg_BG\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/cs-CZ.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/cs-CZ.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Czech\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 3;\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: cs\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: cs_CZ\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/da-DK.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/da-DK.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Danish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: da\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: da_DK\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/de-DE.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/de-DE.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: German\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: de\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: de_DE\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/es-ES.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/es-ES.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Spanish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: es-ES\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: es_ES\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/fi-FI.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/fi-FI.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Finnish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: fi\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: fi_FI\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/fr-FR.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/fr-FR.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: French\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: fr\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: fr_FR\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/hi-IN.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/hi-IN.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Hindi\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: hi\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: hi_IN\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/hr-HR.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/hr-HR.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Croatian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: hr\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: hr_HR\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/hu-HU.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/hu-HU.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Hungarian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: hu\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: hu_HU\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/id-ID.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/id-ID.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Indonesian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: id\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: id_ID\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/it-IT.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/it-IT.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Italian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: it\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: it_IT\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/ja-JP.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/ja-JP.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Japanese\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: ja\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: ja_JP\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/ko-KR.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/ko-KR.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Korean\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: ko\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: ko_KR\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/nb-NO.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/nb-NO.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Norwegian Bokmal\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: nb\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: nb_NO\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/nl-NL.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/nl-NL.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Dutch\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: nl\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: nl_NL\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/pl-PL.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/pl-PL.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Polish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: pl\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: pl_PL\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/pt-BR.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/pt-BR.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Portuguese, Brazilian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: pt-BR\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: pt_BR\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/pt-PT.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/pt-PT.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Portuguese\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: pt-PT\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: pt_PT\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/ru-RU.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/ru-RU.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Russian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=4; plural=((n%10==1 && n%100!=11) ? 0 : ((n%10 >= 2 && n%10 <=4 && (n%100 < 12 || n%100 > 14)) ? 1 : ((n%10 == 0 || (n%10 >= 5 && n%10 <=9)) || (n%100 >= 11 && n%100 <= 14)) ? 2 : 3));\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: ru\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: ru_RU\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/sk-SK.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/sk-SK.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Slovak\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 3;\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: sk\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: sk_SK\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/sl-SI.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/sl-SI.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Slovenian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: sl\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: sl_SI\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/sv-SE.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/sv-SE.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Swedish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: sv-SE\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: sv_SE\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/tr-TR.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/tr-TR.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Turkish\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: tr\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: tr_TR\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/uk-UA.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/uk-UA.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Ukrainian\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=4; plural=((n%10==1 && n%100!=11) ? 0 : ((n%10 >= 2 && n%10 <=4 && (n%100 < 12 || n%100 > 14)) ? 1 : ((n%10 == 0 || (n%10 >= 5 && n%10 <=9)) || (n%100 >= 11 && n%100 <= 14)) ? 2 : 3));\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: uk\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: uk_UA\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/vi-VN.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/vi-VN.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Vietnamese\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: vi\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: vi_VN\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/zh-CN.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/zh-CN.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Chinese Simplified\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: zh-CN\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: zh_CN\n"
|
||||
|
||||
17
redbot/cogs/audio/managed_node/locales/zh-TW.po
generated
Normal file
17
redbot/cogs/audio/managed_node/locales/zh-TW.po
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: red-discordbot\n"
|
||||
"POT-Creation-Date: 2024-08-26 17:35+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Chinese Traditional\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: redgettext 3.4.2\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Crowdin-Project: red-discordbot\n"
|
||||
"X-Crowdin-Project-ID: 289505\n"
|
||||
"X-Crowdin-Language: zh-TW\n"
|
||||
"X-Crowdin-File-ID: 728\n"
|
||||
"Language: zh_TW\n"
|
||||
|
||||
9
redbot/cogs/audio/managed_node/version_pins.py
Normal file
9
redbot/cogs/audio/managed_node/version_pins.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import Final
|
||||
|
||||
from .ll_version import LavalinkVersion
|
||||
|
||||
__all__ = ("JAR_VERSION", "YT_PLUGIN_VERSION")
|
||||
|
||||
|
||||
JAR_VERSION: Final[LavalinkVersion] = LavalinkVersion(3, 7, 12, red=1)
|
||||
YT_PLUGIN_VERSION: Final[str] = "1.7.2"
|
||||
@@ -22,6 +22,7 @@ from red_commons.logging import getLogger
|
||||
from redbot.core import data_manager, Config
|
||||
from redbot.core.i18n import Translator
|
||||
|
||||
from . import managed_node
|
||||
from .errors import (
|
||||
LavalinkDownloadFailed,
|
||||
InvalidArchitectureException,
|
||||
@@ -35,8 +36,8 @@ from .errors import (
|
||||
NoProcessFound,
|
||||
NodeUnhealthy,
|
||||
)
|
||||
from .managed_node.ll_version import LAVALINK_BUILD_LINE, LavalinkVersion, LavalinkOldVersion
|
||||
from .utils import (
|
||||
change_dict_naming_convention,
|
||||
get_max_allocation_size,
|
||||
replace_p_with_prefix,
|
||||
)
|
||||
@@ -55,7 +56,7 @@ _LL_PLUGIN_LOG: Final[Pattern[bytes]] = re.compile(
|
||||
)
|
||||
_FAILED_TO_START: Final[Pattern[bytes]] = re.compile(rb"Web server failed to start\. (.*)")
|
||||
|
||||
# Version regexes
|
||||
# Java version regexes
|
||||
#
|
||||
# We expect the output to look something like:
|
||||
# $ java -version
|
||||
@@ -103,210 +104,14 @@ LAVALINK_LAVAPLAYER_LINE: Final[Pattern] = re.compile(
|
||||
LAVALINK_BUILD_TIME_LINE: Final[Pattern] = re.compile(
|
||||
rb"^Build time:\s+(?P<build_time>\d+[.\d+]*).*$", re.MULTILINE
|
||||
)
|
||||
# present until Lavalink 3.5-rc4
|
||||
LAVALINK_BUILD_LINE: Final[Pattern] = re.compile(rb"^Build:\s+(?P<build>\d+)$", re.MULTILINE)
|
||||
# we don't actually care about what the version format before 3.5-rc4 is exactly
|
||||
# as the comparison is based entirely on the build number
|
||||
LAVALINK_VERSION_LINE_PRE35: Final[Pattern] = re.compile(
|
||||
rb"^Version:\s+(?P<version>\S+)$", re.MULTILINE | re.VERBOSE
|
||||
)
|
||||
# used for LL versions >=3.5-rc4 but below 3.6.
|
||||
# Since this only applies to historical version, this regex is based only on
|
||||
# version numbers that actually existed, not ones that technically could.
|
||||
LAVALINK_VERSION_LINE_PRE36: Final[Pattern] = re.compile(
|
||||
rb"""
|
||||
^
|
||||
Version:\s+
|
||||
(?P<version>
|
||||
(?P<major>3)\.(?P<minor>[0-5])
|
||||
# Before LL 3.6, when patch version == 0, it was stripped from the version string
|
||||
(?:\.(?P<patch>[1-9]\d*))?
|
||||
# Before LL 3.6, the dot in rc.N was optional
|
||||
(?:-rc\.?(?P<rc>0|[1-9]\d*))?
|
||||
# additional build metadata, can be used by our downstream Lavalink
|
||||
# if we need to alter an upstream release
|
||||
(?:\+red\.(?P<red>[1-9]\d*))?
|
||||
)
|
||||
$
|
||||
""",
|
||||
re.MULTILINE | re.VERBOSE,
|
||||
)
|
||||
# used for LL 3.6 and newer
|
||||
# This regex is limited to the realistic usage in the LL version number,
|
||||
# not everything that could be a part of it according to the spec.
|
||||
# We can easily release an update to this regex in the future if it ever becomes necessary.
|
||||
LAVALINK_VERSION_LINE: Final[Pattern] = re.compile(
|
||||
rb"""
|
||||
^
|
||||
Version:\s+
|
||||
(?P<version>
|
||||
(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)
|
||||
(?:-rc\.(?P<rc>0|[1-9]\d*))?
|
||||
# additional build metadata, can be used by our downstream Lavalink
|
||||
# if we need to alter an upstream release
|
||||
(?:\+red\.(?P<red>[1-9]\d*))?
|
||||
)
|
||||
$
|
||||
""",
|
||||
re.MULTILINE | re.VERBOSE,
|
||||
)
|
||||
|
||||
|
||||
class LavalinkOldVersion:
|
||||
def __init__(self, raw_version: str, *, build_number: int) -> None:
|
||||
self.raw_version = raw_version
|
||||
self.build_number = build_number
|
||||
|
||||
def __str__(self) -> None:
|
||||
return f"{self.raw_version}_{self.build_number}"
|
||||
|
||||
@classmethod
|
||||
def from_version_output(cls, output: bytes) -> Self:
|
||||
build_match = LAVALINK_BUILD_LINE.search(output)
|
||||
if build_match is None:
|
||||
raise ValueError(
|
||||
"Could not find 'Build' line in the given `--version` output,"
|
||||
" or invalid build number given."
|
||||
)
|
||||
version_match = LAVALINK_VERSION_LINE_PRE35.search(output)
|
||||
if version_match is None:
|
||||
raise ValueError(
|
||||
"Could not find 'Version' line in the given `--version` output,"
|
||||
" or invalid version number given."
|
||||
)
|
||||
return cls(
|
||||
raw_version=version_match["version"].decode(),
|
||||
build_number=int(build_match["build"]),
|
||||
)
|
||||
|
||||
def __eq__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return self.build_number == other.build_number
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
def __lt__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return self.build_number < other.build_number
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return True
|
||||
return NotImplemented
|
||||
|
||||
def __le__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return self.build_number <= other.build_number
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return True
|
||||
return NotImplemented
|
||||
|
||||
def __gt__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return self.build_number > other.build_number
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
def __ge__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return self.build_number >= other.build_number
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
|
||||
class LavalinkVersion:
|
||||
def __init__(
|
||||
self,
|
||||
major: int,
|
||||
minor: int,
|
||||
patch: int = 0,
|
||||
*,
|
||||
rc: Optional[int] = None,
|
||||
red: int = 0,
|
||||
) -> None:
|
||||
self.major = major
|
||||
self.minor = minor
|
||||
self.patch = patch
|
||||
self.rc = rc
|
||||
self.red = red
|
||||
|
||||
def __str__(self) -> None:
|
||||
version = f"{self.major}.{self.minor}.{self.patch}"
|
||||
if self.rc is not None:
|
||||
version += f"-rc.{self.rc}"
|
||||
if self.red:
|
||||
version += f"+red.{self.red}"
|
||||
return version
|
||||
|
||||
@classmethod
|
||||
def from_version_output(cls, output: bytes) -> Self:
|
||||
match = LAVALINK_VERSION_LINE.search(output)
|
||||
if match is None:
|
||||
# >=3.5-rc4, <3.6
|
||||
match = LAVALINK_VERSION_LINE_PRE36.search(output)
|
||||
if match is None:
|
||||
raise ValueError(
|
||||
"Could not find 'Version' line in the given `--version` output,"
|
||||
" or invalid version number given."
|
||||
)
|
||||
return LavalinkVersion(
|
||||
major=int(match["major"]),
|
||||
minor=int(match["minor"]),
|
||||
patch=int(match["patch"] or 0),
|
||||
rc=int(match["rc"]) if match["rc"] is not None else None,
|
||||
red=int(match["red"] or 0),
|
||||
)
|
||||
|
||||
def _get_comparison_tuple(self) -> Tuple[int, int, int, bool, int, int]:
|
||||
return self.major, self.minor, self.patch, self.rc is None, self.rc or 0, self.red
|
||||
|
||||
def __eq__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return self._get_comparison_tuple() == other._get_comparison_tuple()
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
def __lt__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return self._get_comparison_tuple() < other._get_comparison_tuple()
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
def __le__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return self._get_comparison_tuple() <= other._get_comparison_tuple()
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return False
|
||||
return NotImplemented
|
||||
|
||||
def __gt__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return self._get_comparison_tuple() > other._get_comparison_tuple()
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return True
|
||||
return NotImplemented
|
||||
|
||||
def __ge__(self, other: object) -> bool:
|
||||
if isinstance(other, LavalinkVersion):
|
||||
return self._get_comparison_tuple() >= other._get_comparison_tuple()
|
||||
if isinstance(other, LavalinkOldVersion):
|
||||
return True
|
||||
return NotImplemented
|
||||
|
||||
|
||||
class ServerManager:
|
||||
JAR_VERSION: Final[str] = LavalinkVersion(3, 7, 11, red=3)
|
||||
YT_PLUGIN_VERSION: Final[str] = "1.5.2"
|
||||
|
||||
LAVALINK_DOWNLOAD_URL: Final[str] = (
|
||||
"https://github.com/Cog-Creators/Lavalink-Jars/releases/download/"
|
||||
f"{JAR_VERSION}/"
|
||||
f"{managed_node.JAR_VERSION}/"
|
||||
"Lavalink.jar"
|
||||
)
|
||||
YT_PLUGIN_REPOSITORY: Final[str] = "https://maven.lavalink.dev/releases"
|
||||
|
||||
_java_available: ClassVar[Optional[bool]] = None
|
||||
_java_version: ClassVar[Optional[Tuple[int, int]]] = None
|
||||
@@ -429,19 +234,7 @@ class ServerManager:
|
||||
raise
|
||||
|
||||
async def process_settings(self):
|
||||
data = change_dict_naming_convention(await self._config.yaml.all())
|
||||
ll_config = data["lavalink"]
|
||||
sources = ll_config["server"]["sources"]
|
||||
plugins = ll_config.setdefault("plugins", [])
|
||||
|
||||
enable_yt_plugin = sources["youtube"]
|
||||
if enable_yt_plugin:
|
||||
sources["youtube"] = False
|
||||
yt_plugin = {
|
||||
"dependency": f"dev.lavalink.youtube:youtube-plugin:{self.YT_PLUGIN_VERSION}",
|
||||
"repository": self.YT_PLUGIN_REPOSITORY,
|
||||
}
|
||||
plugins.append(yt_plugin)
|
||||
data = managed_node.generate_server_config(await self._config.yaml.all())
|
||||
|
||||
with open(self.lavalink_app_yml, "w", encoding="utf-8") as f:
|
||||
yaml.safe_dump(data, f)
|
||||
@@ -584,7 +377,8 @@ class ServerManager:
|
||||
# A 404 means our LAVALINK_DOWNLOAD_URL is invalid, so likely the jar version
|
||||
# hasn't been published yet
|
||||
raise LavalinkDownloadFailed(
|
||||
f"Lavalink jar version {self.JAR_VERSION} hasn't been published yet",
|
||||
f"Lavalink jar version {managed_node.JAR_VERSION}"
|
||||
" hasn't been published yet",
|
||||
response=response,
|
||||
should_retry=False,
|
||||
)
|
||||
@@ -670,7 +464,7 @@ class ServerManager:
|
||||
self._jvm = java["jvm"].decode()
|
||||
self._lavaplayer = lavaplayer["lavaplayer"].decode()
|
||||
self._buildtime = date
|
||||
self._up_to_date = self._lavalink_version >= self.JAR_VERSION
|
||||
self._up_to_date = self._lavalink_version >= managed_node.JAR_VERSION
|
||||
return self._up_to_date
|
||||
|
||||
async def maybe_download_jar(self):
|
||||
@@ -690,7 +484,7 @@ class ServerManager:
|
||||
log.info(
|
||||
"Lavalink version outdated, triggering update from %s to %s...",
|
||||
self._lavalink_version,
|
||||
self.JAR_VERSION,
|
||||
managed_node.JAR_VERSION,
|
||||
)
|
||||
await self._download_jar()
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ from redbot.core import commands
|
||||
from redbot.core.bot import Red
|
||||
from redbot.core.i18n import Translator
|
||||
|
||||
from .managed_node.ll_server_config import DEFAULT_LAVALINK_YAML, change_dict_naming_convention
|
||||
|
||||
log = getLogger("red.cogs.Audio.task.callback")
|
||||
_ = Translator("Audio", Path(__file__))
|
||||
|
||||
@@ -54,55 +56,6 @@ def get_jar_ram_defaults() -> Tuple[str, str]:
|
||||
|
||||
MIN_JAVA_RAM, MAX_JAVA_RAM = get_jar_ram_defaults()
|
||||
|
||||
DEFAULT_LAVALINK_YAML = {
|
||||
# The nesting structure of this dict is very important, it's a 1:1 mirror of application.yaml in JSON
|
||||
"yaml__server__address": "localhost",
|
||||
"yaml__server__port": 2333,
|
||||
"yaml__lavalink__server__password": "youshallnotpass",
|
||||
"yaml__lavalink__server__sources__http": True,
|
||||
"yaml__lavalink__server__sources__bandcamp": True,
|
||||
"yaml__lavalink__server__sources__local": True,
|
||||
"yaml__lavalink__server__sources__soundcloud": True,
|
||||
"yaml__lavalink__server__sources__youtube": True,
|
||||
"yaml__lavalink__server__sources__twitch": True,
|
||||
"yaml__lavalink__server__sources__vimeo": True,
|
||||
"yaml__lavalink__server__bufferDurationMs": 400,
|
||||
"yaml__lavalink__server__frameBufferDurationMs": 1000,
|
||||
# 100 pages - 100 entries per page = 10,000 tracks which is the Audio Limit for a single playlist.
|
||||
"yaml__lavalink__server__youtubePlaylistLoadLimit": 100,
|
||||
"yaml__lavalink__server__playerUpdateInterval": 1,
|
||||
"yaml__lavalink__server__youtubeSearchEnabled": True,
|
||||
"yaml__lavalink__server__soundcloudSearchEnabled": True,
|
||||
"yaml__lavalink__server__gc_warnings": True,
|
||||
"yaml__metrics__prometheus__enabled": False,
|
||||
"yaml__metrics__prometheus__endpoint": "/metrics",
|
||||
"yaml__sentry__dsn": "",
|
||||
"yaml__sentry__environment": "",
|
||||
"yaml__logging__file__path": "./logs/",
|
||||
"yaml__logging__level__root": "INFO",
|
||||
"yaml__logging__level__lavalink": "INFO",
|
||||
"yaml__logging__logback__rollingpolicy__max_history": 15,
|
||||
"yaml__logging__logback__rollingpolicy__max_size": "10MB",
|
||||
# plugin configuration - note that the plugin may be disabled by the manager
|
||||
"yaml__plugins__youtube__enabled": True,
|
||||
"yaml__plugins__youtube__allowSearch": True,
|
||||
"yaml__plugins__youtube__allowDirectVideoIds": True,
|
||||
"yaml__plugins__youtube__allowDirectPlaylistIds": True,
|
||||
"yaml__plugins__youtube__clients": [
|
||||
"MUSIC",
|
||||
"WEB",
|
||||
"ANDROID_TESTSUITE",
|
||||
"TVHTML5EMBEDDED",
|
||||
"ANDROID_LITE",
|
||||
"MEDIA_CONNECT",
|
||||
"IOS",
|
||||
],
|
||||
"yaml__plugins__youtube__WEB__playback": True,
|
||||
"yaml__plugins__youtube__TVHTML5EMBEDDED__playlistLoading": False,
|
||||
"yaml__plugins__youtube__TVHTML5EMBEDDED__videoLoading": False,
|
||||
"yaml__plugins__youtube__TVHTML5EMBEDDED__searching": False,
|
||||
}
|
||||
|
||||
DEFAULT_LAVALINK_SETTINGS = {
|
||||
"host": DEFAULT_LAVALINK_YAML["yaml__server__address"],
|
||||
"rest_port": DEFAULT_LAVALINK_YAML["yaml__server__port"],
|
||||
@@ -122,24 +75,6 @@ def sizeof_fmt(num: Union[float, int]) -> str:
|
||||
return f"{num:.1f}Y"
|
||||
|
||||
|
||||
# This assumes all keys with `_` should be converted from `part1_part2` to `part1-part2`
|
||||
def convert_function(key: str) -> str:
|
||||
return key.replace("_", "-")
|
||||
|
||||
|
||||
def change_dict_naming_convention(data) -> dict:
|
||||
ret: Any = data
|
||||
if isinstance(data, dict):
|
||||
ret = {}
|
||||
for key, value in data.items():
|
||||
ret[convert_function(key)] = change_dict_naming_convention(value)
|
||||
elif isinstance(data, list):
|
||||
ret = []
|
||||
for value in data:
|
||||
ret.append(change_dict_naming_convention(value))
|
||||
return ret
|
||||
|
||||
|
||||
class CacheLevel:
|
||||
__slots__ = ("value",)
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ Hanna-Barbera rose to fame by creating what duo for MGM?:
|
||||
He directed "The Godfather"?:
|
||||
- Francis Ford Coppola
|
||||
He directed the movie E.T.?:
|
||||
- Stephen Spielberg
|
||||
- Steven Spielberg
|
||||
He starred in, "City Lights"?:
|
||||
- Charlie Chaplin
|
||||
He was known as the "Elephant Man"?:
|
||||
@@ -427,7 +427,7 @@ The Who had a guinness world record for what?:
|
||||
The Who's rock musical stars Elton John. It's called ________?:
|
||||
- Tommy
|
||||
The director of Jaws, Raiders of the Lost Ark?:
|
||||
- Stephen spielberg
|
||||
- Steven Spielberg
|
||||
The eldest sister in the TV Series Charmed, is played by who?:
|
||||
- Shannon Doherty
|
||||
The film "Crouching Tiger, Hidden Dragon" takes place in which dynasty?:
|
||||
|
||||
@@ -8,11 +8,11 @@ aiohttp-json-rpc==0.13.3
|
||||
# via -r base.in
|
||||
aiosignal==1.3.1
|
||||
# via aiohttp
|
||||
apsw==3.46.0.1
|
||||
apsw==3.46.1.0
|
||||
# via -r base.in
|
||||
attrs==24.1.0
|
||||
attrs==24.2.0
|
||||
# via aiohttp
|
||||
babel==2.15.0
|
||||
babel==2.16.0
|
||||
# via -r base.in
|
||||
brotli==1.1.0
|
||||
# via -r base.in
|
||||
@@ -26,9 +26,9 @@ frozenlist==1.4.1
|
||||
# via
|
||||
# aiohttp
|
||||
# aiosignal
|
||||
idna==3.7
|
||||
idna==3.8
|
||||
# via yarl
|
||||
markdown==3.6
|
||||
markdown==3.7
|
||||
# via -r base.in
|
||||
markdown-it-py==3.0.0
|
||||
# via rich
|
||||
@@ -38,7 +38,7 @@ multidict==6.0.5
|
||||
# via
|
||||
# aiohttp
|
||||
# yarl
|
||||
orjson==3.10.6
|
||||
orjson==3.10.7
|
||||
# via -r base.in
|
||||
packaging==24.1
|
||||
# via -r base.in
|
||||
@@ -50,9 +50,9 @@ pygments==2.18.0
|
||||
# via rich
|
||||
python-dateutil==2.9.0.post0
|
||||
# via -r base.in
|
||||
pyyaml==6.0.1
|
||||
pyyaml==6.0.2
|
||||
# via -r base.in
|
||||
rapidfuzz==3.9.5
|
||||
rapidfuzz==3.9.6
|
||||
# via -r base.in
|
||||
red-commons==1.0.0
|
||||
# via
|
||||
@@ -60,7 +60,7 @@ red-commons==1.0.0
|
||||
# red-lavalink
|
||||
red-lavalink==0.11.0
|
||||
# via -r base.in
|
||||
rich==13.7.1
|
||||
rich==13.8.0
|
||||
# via -r base.in
|
||||
schema==0.7.7
|
||||
# via -r base.in
|
||||
@@ -80,11 +80,11 @@ colorama==0.4.6; sys_platform == "win32"
|
||||
# via click
|
||||
distro==1.9.0; sys_platform == "linux" and sys_platform == "linux"
|
||||
# via -r base.in
|
||||
importlib-metadata==8.2.0; python_version != "3.10" and python_version != "3.11"
|
||||
importlib-metadata==8.4.0; python_version != "3.10" and python_version != "3.11"
|
||||
# via markdown
|
||||
pytz==2024.1; python_version == "3.8"
|
||||
# via babel
|
||||
uvloop==0.19.0; (sys_platform != "win32" and platform_python_implementation == "CPython") and sys_platform != "win32"
|
||||
uvloop==0.20.0; (sys_platform != "win32" and platform_python_implementation == "CPython") and sys_platform != "win32"
|
||||
# via -r base.in
|
||||
zipp==3.19.2; python_version != "3.10" and python_version != "3.11"
|
||||
zipp==3.20.1; python_version != "3.10" and python_version != "3.11"
|
||||
# via importlib-metadata
|
||||
|
||||
@@ -11,7 +11,7 @@ docutils==0.20.1
|
||||
# sphinx-rtd-theme
|
||||
imagesize==1.4.1
|
||||
# via sphinx
|
||||
importlib-metadata==8.2.0
|
||||
importlib-metadata==8.4.0
|
||||
# via
|
||||
# -c base.txt
|
||||
# sphinx
|
||||
@@ -56,7 +56,7 @@ sphinxcontrib-trio==1.1.2
|
||||
# via -r extra-doc.in
|
||||
urllib3==2.2.2
|
||||
# via requests
|
||||
zipp==3.19.2
|
||||
zipp==3.20.1
|
||||
# via
|
||||
# -c base.txt
|
||||
# importlib-metadata
|
||||
|
||||
@@ -21,7 +21,7 @@ pytest-asyncio==0.21.2
|
||||
# via -r extra-test.in
|
||||
pytest-mock==3.14.0
|
||||
# via -r extra-test.in
|
||||
tomlkit==0.13.0
|
||||
tomlkit==0.13.2
|
||||
# via pylint
|
||||
exceptiongroup==1.2.2; python_version != "3.11"
|
||||
# via pytest
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import Optional
|
||||
|
||||
import pytest
|
||||
|
||||
from redbot.cogs.audio.manager import LavalinkOldVersion, LavalinkVersion
|
||||
from redbot.cogs.audio.managed_node.ll_version import LavalinkOldVersion, LavalinkVersion
|
||||
|
||||
|
||||
ORDERED_VERSIONS = [
|
||||
Reference in New Issue
Block a user