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

Migrate to lavalink-rs #13

Merged
merged 9 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .example.env
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
BOT_TOKEN=# your bot token
BOT_TOKEN=# ...

LAVALINK_ADDR=# your lavalink host & port, in the format `host:port`
LAVALINK_AUTH=# your lavalink password
SERVER_ADDRESS=# ...
SERVER_PORT=# ...
LAVALINK_SERVER_PASSWORD=# ...
PLUGINS_LAVASRC_SPOTIFY_CLIENT_ID=# ...
PLUGINS_LAVASRC_SPOTIFY_CLIENT_SECRET=# ...
PLUGINS_LAVASRC_DEEZER_MASTER_DECRYPTION_KEY=# ...

DATABASE_URL=# your postgresql database url

SPOTIFY_CLIENT_ID=# your spotify client id
SPOTIFY_CLIENT_SECRET=# your spotify client secret
DATABASE_URL=# ...
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:

env:
CARGO_TERM_COLOR: always
BOT_TOKEN: ~
SERVER_ADDRESS: ~
SERVER_PORT: ~
LAVALINK_SERVER_PASSWORD: ~
DATABASE_URL: postgres://user:password@localhost:5432/db

jobs:
Expand Down Expand Up @@ -40,6 +44,9 @@ jobs:
path: lyra
ignore_words_list: crate,ans,cant

- name: Setup Mold
uses: rui314/setup-mold@v1

- name: Rust Cache
uses: Swatinem/[email protected]

Expand All @@ -49,6 +56,9 @@ jobs:
cargo install sqlx-cli --no-default-features --features native-tls,postgres
cargo sqlx database setup

- name: Setup .env
run: touch .env

- name: Build And Test
working-directory: lyra
run: |
Expand Down
26 changes: 13 additions & 13 deletions assets/lyra2-ascii.ans

Large diffs are not rendered by default.

18 changes: 5 additions & 13 deletions lavalink/application.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
plugins:
lavasrc:
providers: # Custom providers for track loading. This is the default
- "dzisrc:%ISRC%" # Deezer ISRC provider
- "dzsearch:%QUERY%"
- 'ytsearch:"%ISRC%"' # Will be ignored if track does not have an ISRC. See https://en.wikipedia.org/wiki/International_Standard_Recording_Code
- "ytsearch:%QUERY%" # Will be used if track has no ISRC or no track could be found for the ISRC
# - "dzisrc:%ISRC%" # Deezer ISRC provider
# - "scsearch:%QUERY%" you can add multiple other fallback sources here
- "scsearch:%QUERY%" # you can add multiple other fallback sources here
sources:
spotify: true # Enable Spotify source
# applemusic: true # Enable Apple Music source
# deezer: true # Enable Deezer source
deezer: true # Enable Deezer source
# yandexmusic: true # Enable Yandex Music source
spotify:
clientId: $SPOTIFY_CLIENT_ID
clientSecret: $SPOTIFY_CLIENT_SECRET
countryCode: "US" # the country code you want to use for filtering the artists top tracks. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
# applemusic:
# countryCode: "US" # the country code you want to use for filtering the artists top tracks and language. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
# mediaAPIToken: "..." # Can be used to bypass the auto token fetching which is likely to break again in the future
# deezer:
# masterDecryptionKey: "your master decryption key" # the master key used for decrypting the deezer tracks. (yes this is not here you need to get it from somewhere else)
# yandexmusic:
# accessToken: "your access token" # the token used for accessing the yandex music api. See https://github.com/TopiSenpai/LavaSrc#yandex-music

server: # REST and WS server
port: 2333
address: 0.0.0.0
lavalink:
plugins:
- dependency: "com.github.TopiSenpai.LavaSrc:lavasrc-plugin:3.1.7"
repository: "https://jitpack.io"
- dependency: "com.github.topi314.lavasrc:lavasrc-plugin:4.0.1"
server:
password: $LAVALINK_AUTH
sources:
youtube: true
bandcamp: true
Expand Down
3 changes: 3 additions & 0 deletions lyra/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
Loading
Loading