Skip to content

Commit

Permalink
fix: npm run format
Browse files Browse the repository at this point in the history
  • Loading branch information
phts committed Jan 29, 2024
1 parent 81bb5f9 commit ced686c
Show file tree
Hide file tree
Showing 14 changed files with 2,709 additions and 2,738 deletions.
6 changes: 2 additions & 4 deletions spotify/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# New Spotify Plugin


This repo serves as WIP for the new spotify plugin. It is currently in development and not ready for use.

## Installation

To prepare the environment for go and go librespot
To prepare the environment for go and go librespot

```bash
cd librespot-go
./prepare-env.sh
./clone-and-prepare.sh
```

131 changes: 69 additions & 62 deletions spotify/UIConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,64 @@
},
"sections": [
{
"id": "section_spotify",
"type": "section",
"label": "Spotify",
"id": "section_spotify",
"type": "section",
"label": "Spotify",
"icon": "fa-spotify",
"content": [
{
"id": "spotify_use",
"description": "TRANSLATE.OPEN_OR_INSTALL_SPOTIFY_DESCRIPTION",
"onClick": {"type":"openUrl", "url":"spotify://"}
}
]
},
"content": [
{
"id": "spotify_use",
"description": "TRANSLATE.OPEN_OR_INSTALL_SPOTIFY_DESCRIPTION",
"onClick": { "type": "openUrl", "url": "spotify://" }
}
]
},
{
"id": "section_account",
"element": "section",
"label": "TRANSLATE.SPOTIFY_BROWSING",
"hidden": false,
"content": [
{
"id":"oauth",
"element": "button",
"label": "TRANSLATE.AUTHORIZE",
"description": "TRANSLATE.AUTHORIZE_PERSONAL_CONTENT",
"onClick": {"type":"oauth", "performerUrl":"http://oauth-performer.dfs.volumio.org/spotify","plugin":"music_service/spop", "scopes":[
"user-modify-playback-state",
"user-read-playback-state",
"user-read-currently-playing",
"user-top-read",
"user-read-recently-played",
"user-read-private",
"user-read-email",
"user-library-read",
"playlist-read-private",
"playlist-read-collaborative",
"app-remote-control",
"streaming",
"user-follow-read"
]}
},
{
"id":"logout",
"element": "button",
"label": "TRANSLATE.LOGOUT",
"description": "TRANSLATE.LOGOUT",
"onClick": {"type":"emit", "message":"callMethod", "data":{"endpoint":"music_service/spop","method":"logout","data":""}},
"hidden": true
}
]
},
"id": "section_account",
"element": "section",
"label": "TRANSLATE.SPOTIFY_BROWSING",
"hidden": false,
"content": [
{
"id": "oauth",
"element": "button",
"label": "TRANSLATE.AUTHORIZE",
"description": "TRANSLATE.AUTHORIZE_PERSONAL_CONTENT",
"onClick": {
"type": "oauth",
"performerUrl": "http://oauth-performer.dfs.volumio.org/spotify",
"plugin": "music_service/spop",
"scopes": [
"user-modify-playback-state",
"user-read-playback-state",
"user-read-currently-playing",
"user-top-read",
"user-read-recently-played",
"user-read-private",
"user-read-email",
"user-library-read",
"playlist-read-private",
"playlist-read-collaborative",
"app-remote-control",
"streaming",
"user-follow-read"
]
}
},
{
"id": "logout",
"element": "button",
"label": "TRANSLATE.LOGOUT",
"description": "TRANSLATE.LOGOUT",
"onClick": {
"type": "emit",
"message": "callMethod",
"data": { "endpoint": "music_service/spop", "method": "logout", "data": "" }
},
"hidden": true
}
]
},
{
"id": "spotify_settings",
"element": "section",
Expand All @@ -63,12 +72,7 @@
},
"saveButton": {
"label": "TRANSLATE.SAVE",
"data": [
"bitrate",
"debug",
"normalisation_pregain",
"icon"
]
"data": ["bitrate", "debug", "normalisation_pregain", "icon"]
},
"content": [
{
Expand All @@ -80,10 +84,11 @@
"value": 320,
"label": "320 kbps"
},
"options": [{
"value": 320,
"label": "320 kbps"
},
"options": [
{
"value": 320,
"label": "320 kbps"
},
{
"value": 160,
"label": "160 kbps"
Expand Down Expand Up @@ -159,10 +164,11 @@
"value": "avr",
"label": "AV Receiver"
},
"options": [{
"value": "avr",
"label": "AV Receiver"
},
"options": [
{
"value": "avr",
"label": "AV Receiver"
},
{
"value": "speaker",
"label": "Speaker"
Expand All @@ -174,5 +180,6 @@
]
}
]
}]
}
]
}
46 changes: 24 additions & 22 deletions spotify/apiclient.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
var superagent = require('superagent');
let superagent = require('superagent');

var apiEndpoint = 'http://127.0.0.1:9879';
let apiEndpoint = 'http://127.0.0.1:9879';

superagent
.post(apiEndpoint + '/player/volume')
.accept('application/json')
.send({ volume: 50, volume_steps: 100 })
.then((results) => {
console.log(results.body);
})
.catch((err) => {
console.log(err);
});

superagent.post(apiEndpoint + '/player/volume')
.accept('application/json')
.send({ 'volume': 50, 'volume_steps': 100 })
.then((results) => {
console.log(results.body);
}).catch((err) => {
console.log(err);
})
superagent
.get(apiEndpoint + '/status')
.accept('application/json')
.then((results) => {
console.log(results.body);
});


superagent.get(apiEndpoint + '/status')
.accept('application/json')
.then((results) => {
console.log(results.body);
})

superagent.get(apiEndpoint + '/player/volume')
.accept('application/json')
.then((results) => {
console.log(results.body);
})
superagent
.get(apiEndpoint + '/player/volume')
.accept('application/json')
.then((results) => {
console.log(results.body);
});
27 changes: 13 additions & 14 deletions spotify/i18n/strings_ca.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"SPOTIFY_USERNAME":"Nom Usuari Spotify",
"SPOTIFY_PASSWORD":"Contrasenya Spotify",
"HIGH_BITRATE":"Alta qualitat",
"SEARCH_RESULTS":"Numero de resultats",
"PLUGINS":"Last.fm",
"LAST_FM_USERNAME":"Usuari Last.fm ",
"LAST_FM_PASSWORD":"ContrasenyaLast.fm",
"SEARCH_SONGS_SECTION":"Cançons Spotify",
"SEARCH_ALBUMS_SECTION":"Albums Spotity",
"SEARCH_ARTISTS_SECTION":"Artistes Spotify",
"SPOTIFY_CONFIGURATION":"Configuració Spotify",
"SPOTIFY_ACCOUNT":"Compte Spotify",
"SAVE":"Guarda"

"SPOTIFY_USERNAME": "Nom Usuari Spotify",
"SPOTIFY_PASSWORD": "Contrasenya Spotify",
"HIGH_BITRATE": "Alta qualitat",
"SEARCH_RESULTS": "Numero de resultats",
"PLUGINS": "Last.fm",
"LAST_FM_USERNAME": "Usuari Last.fm ",
"LAST_FM_PASSWORD": "ContrasenyaLast.fm",
"SEARCH_SONGS_SECTION": "Cançons Spotify",
"SEARCH_ALBUMS_SECTION": "Albums Spotity",
"SEARCH_ARTISTS_SECTION": "Artistes Spotify",
"SPOTIFY_CONFIGURATION": "Configuració Spotify",
"SPOTIFY_ACCOUNT": "Compte Spotify",
"SAVE": "Guarda"
}
27 changes: 13 additions & 14 deletions spotify/i18n/strings_de.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"SPOTIFY_USERNAME":"Spotify Benutzername",
"SPOTIFY_PASSWORD":"Spotify Passwort",
"HIGH_BITRATE":"Hohe Qualität",
"SEARCH_RESULTS":"Anzahl der Suchergebnisse",
"PLUGINS":"Last.fm",
"LAST_FM_USERNAME":"Last.fm Benutzername",
"LAST_FM_PASSWORD":"Last.fm Passwort",
"SEARCH_SONGS_SECTION":"Spotify Lieder",
"SEARCH_ALBUMS_SECTION":"Spotity Alben",
"SEARCH_ARTISTS_SECTION":"Spotify Künstler",
"SPOTIFY_CONFIGURATION":"Spotify Einstellungen",
"SPOTIFY_ACCOUNT":"Spotify Konto",
"SAVE":"Speichern"

"SPOTIFY_USERNAME": "Spotify Benutzername",
"SPOTIFY_PASSWORD": "Spotify Passwort",
"HIGH_BITRATE": "Hohe Qualität",
"SEARCH_RESULTS": "Anzahl der Suchergebnisse",
"PLUGINS": "Last.fm",
"LAST_FM_USERNAME": "Last.fm Benutzername",
"LAST_FM_PASSWORD": "Last.fm Passwort",
"SEARCH_SONGS_SECTION": "Spotify Lieder",
"SEARCH_ALBUMS_SECTION": "Spotity Alben",
"SEARCH_ARTISTS_SECTION": "Spotify Künstler",
"SPOTIFY_CONFIGURATION": "Spotify Einstellungen",
"SPOTIFY_ACCOUNT": "Spotify Konto",
"SAVE": "Speichern"
}
86 changes: 43 additions & 43 deletions spotify/i18n/strings_en.json
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
{
"SPOTIFY":"Spotify",
"USERNAME":"Username",
"PASSWORD":"Password",
"SPOTIFY_USERNAME":"Spotify username",
"SPOTIFY_PASSWORD":"Spotify password",
"HIGH_BITRATE":"High quality",
"REFRESH_TOKEN":"Refresh Token",
"SEARCH_RESULTS":"Number of results",
"PLUGINS":"Last.fm",
"LAST_FM_USERNAME":"Last.fm username",
"LAST_FM_PASSWORD":"Last.fm password",
"SEARCH_SONGS_SECTION":"Spotify songs",
"SEARCH_ALBUMS_SECTION":"Spotity albums",
"SEARCH_ARTISTS_SECTION":"Spotify artists",
"SPOTIFY_CONFIGURATION":"Spotify Configuration",
"SPOTIFY_ACCOUNT":"Spotify account",
"SAVE":"Save",
"LOGIN":"Login",
"LOGOUT":"Logout",
"AUTHORIZE_PERSONAL_CONTENT":"To be able to browse your music, playlists and favourites, please authorize the application",
"AUTHORIZE_PERSONAL_CONTENT_INSTRUCTIONS":"One more step is needed to enable Spotfy: please authorize the application by clicking the Authorize Button and follow the required steps.",
"AUTHORIZE":"Authorize",
"SPOTIFY_LOGIN":"Spotify login",
"LOGGING_IN":"Logging in Spotify",
"LOGIN_SUCCESSFUL":"Spotify Login Successful",
"LOGOUT_SUCCESSFUL":"Successfully logged out from Spotify",
"SPOTIFY_LOGIN_FAILED":"Spotify Login Failed",
"SUCCESSFULLY_AUTHORIZED":"Successfully authorized the access",
"CHECK_USERNAME_AND_PASSWORD":"Please check username and password",
"PROVIDE_USERNAME_AND_PASSWORD":"Please provide username and password",
"MY_PLAYLISTS":"My Playlists",
"MY_ALBUMS":"My Albums",
"MY_TRACKS":"My Tracks",
"SPOTIFY": "Spotify",
"USERNAME": "Username",
"PASSWORD": "Password",
"SPOTIFY_USERNAME": "Spotify username",
"SPOTIFY_PASSWORD": "Spotify password",
"HIGH_BITRATE": "High quality",
"REFRESH_TOKEN": "Refresh Token",
"SEARCH_RESULTS": "Number of results",
"PLUGINS": "Last.fm",
"LAST_FM_USERNAME": "Last.fm username",
"LAST_FM_PASSWORD": "Last.fm password",
"SEARCH_SONGS_SECTION": "Spotify songs",
"SEARCH_ALBUMS_SECTION": "Spotity albums",
"SEARCH_ARTISTS_SECTION": "Spotify artists",
"SPOTIFY_CONFIGURATION": "Spotify Configuration",
"SPOTIFY_ACCOUNT": "Spotify account",
"SAVE": "Save",
"LOGIN": "Login",
"LOGOUT": "Logout",
"AUTHORIZE_PERSONAL_CONTENT": "To be able to browse your music, playlists and favourites, please authorize the application",
"AUTHORIZE_PERSONAL_CONTENT_INSTRUCTIONS": "One more step is needed to enable Spotfy: please authorize the application by clicking the Authorize Button and follow the required steps.",
"AUTHORIZE": "Authorize",
"SPOTIFY_LOGIN": "Spotify login",
"LOGGING_IN": "Logging in Spotify",
"LOGIN_SUCCESSFUL": "Spotify Login Successful",
"LOGOUT_SUCCESSFUL": "Successfully logged out from Spotify",
"SPOTIFY_LOGIN_FAILED": "Spotify Login Failed",
"SUCCESSFULLY_AUTHORIZED": "Successfully authorized the access",
"CHECK_USERNAME_AND_PASSWORD": "Please check username and password",
"PROVIDE_USERNAME_AND_PASSWORD": "Please provide username and password",
"MY_PLAYLISTS": "My Playlists",
"MY_ALBUMS": "My Albums",
"MY_TRACKS": "My Tracks",
"MY_ARTISTS": "My Artists",
"MY_TOP_ARTISTS":"My Top Artists",
"MY_TOP_TRACKS":"My Top Tracks",
"MY_RECENTLY_PLAYED_TRACKS":"My Recently Played Tracks",
"FEATURED_PLAYLISTS":"Featured Playlists",
"WHATS_NEW":"What's New",
"GENRES_AND_MOODS":"Genres & Moods",
"MY_MUSIC":"My Music",
"MY_TOP_ARTISTS": "My Top Artists",
"MY_TOP_TRACKS": "My Top Tracks",
"MY_RECENTLY_PLAYED_TRACKS": "My Recently Played Tracks",
"FEATURED_PLAYLISTS": "Featured Playlists",
"WHATS_NEW": "What's New",
"GENRES_AND_MOODS": "Genres & Moods",
"MY_MUSIC": "My Music",
"VOLSPOTCONNECTCONF": "Spotify Configuration",
"VOLSPOTCONNECTACCOUNT": "Spotify account",
"HIGHBITRATE": "Stream bitrate",
Expand All @@ -59,12 +59,12 @@
"DESCGAPLESS": "Enable/Disable gapless playback between tracks",
"AUTOPLAY": "Autoplay",
"DESCAUTOPLAY": "Autoplay similar songs when your music ends ",
"OPEN_OR_INSTALL_SPOTIFY_TITLE":"Open or Install Spotify",
"OPEN_OR_INSTALL_SPOTIFY_DESCRIPTION":"To listen to Spotify, simply open or Install Spotify from any device in the network and select this device as output. Spotify Premium is required",
"OPEN_OR_INSTALL_SPOTIFY_TITLE": "Open or Install Spotify",
"OPEN_OR_INSTALL_SPOTIFY_DESCRIPTION": "To listen to Spotify, simply open or Install Spotify from any device in the network and select this device as output. Spotify Premium is required",
"LOGIN_TO_ENABLE_BROWSING": "To browse your tracks, albums and playlists, login with your Spotify Credentials",
"SPOTIFY_BROWSING": "Spotify Browsing",
"LOGGED_IN_AS": "Logged-in as",
"CONFIGURATION_SUCCESSFULLY_UPDATED": "Configuration has been successfully updated",
"CONNECT_DEVICE_ICON_DOC": "Choose which icon will show the device on your Spotify app in Connect Mode",
"CONNECT_DEVICE_ICON":"Device Icon"
"CONNECT_DEVICE_ICON": "Device Icon"
}
Loading

0 comments on commit ced686c

Please sign in to comment.