Merge pull request #1284 from chme/web-update

Web interface v1.1.0
This commit is contained in:
Christian Meffert 2021-07-09 10:03:38 +02:00 committed by GitHub
commit dc8e66109e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 822 additions and 440 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -808,6 +808,9 @@ jsonapi_reply_config(struct httpd_request *hreq)
json_object_object_add(jreply, "allow_modifying_stored_playlists", json_object_new_boolean(allow_modifying_stored_playlists));
safe_json_add_string(jreply, "default_playlist_directory", default_playlist_directory);
// Wether libspotify should be used instead of librespot
json_object_object_add(jreply, "use_libspotify", json_object_new_boolean(cfg_getbool(cfg_getsec(cfg, "spotify"), "use_libspotify")));
CHECK_ERRNO(L_WEB, evbuffer_add_printf(hreq->reply, "%s", json_object_to_json_string(jreply)));
jparse_free(jreply);
@ -1227,8 +1230,8 @@ jsonapi_reply_spotify(struct httpd_request *hreq)
free(oauth_uri);
spotify_status_get(&sp_status);
json_object_object_add(jreply, "libspotify_installed", json_object_new_boolean(sp_status.installed));
json_object_object_add(jreply, "libspotify_logged_in", json_object_new_boolean(sp_status.logged_in));
json_object_object_add(jreply, "spotify_installed", json_object_new_boolean(sp_status.installed));
json_object_object_add(jreply, "spotify_logged_in", json_object_new_boolean(sp_status.logged_in));
safe_json_add_string(jreply, "libspotify_user", sp_status.username);
spotifywebapi_status_info_get(&webapi_info);

1123
web-src/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "owntone-web",
"version": "1.0.1",
"version": "1.1.0",
"private": true,
"description": "OwnTone web interface",
"author": "chme <christian.meffert@googlemail.com>",
@ -12,23 +12,23 @@
},
"dependencies": {
"axios": "^0.21.1",
"bulma": "^0.9.2",
"bulma": "^0.9.3",
"bulma-switch": "^2.0.0",
"core-js": "^3.12.1",
"core-js": "^3.15.2",
"mdi": "^2.2.43",
"moment": "^2.29.1",
"moment-duration-format": "^2.3.2",
"npm": "^7.12.1",
"npm": "^7.19.1",
"reconnectingwebsocket": "^1.0.0",
"spotify-web-api-js": "^1.5.1",
"string-to-color": "^2.2.2",
"v-click-outside": "^3.1.2",
"vue": "^2.6.12",
"vue": "^2.6.14",
"vue-infinite-loading": "^2.4.5",
"vue-observe-visibility": "^1.0.0",
"vue-progressbar": "^0.7.5",
"vue-range-slider": "^0.6.0",
"vue-router": "^3.5.1",
"vue-router": "^3.5.2",
"vue-scrollto": "^2.20.0",
"vue-tiny-lazyload-img": "^0.1.0",
"vuedraggable": "^2.24.3",
@ -40,15 +40,15 @@
"@vue/cli-service": "^4.5.13",
"@vue/eslint-config-standard": "^6.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.26.0",
"eslint-plugin-import": "^2.22.1",
"eslint": "^7.30.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"eslint-plugin-vue": "^7.9.0",
"sass": "^1.32.13",
"eslint-plugin-vue": "^7.12.1",
"sass": "^1.35.1",
"sass-loader": "^10",
"vue-template-compiler": "^2.6.12"
"vue-template-compiler": "^2.6.14"
},
"license": "GPL-2.0"
}

View File

@ -74,6 +74,10 @@
<span class="heading">Rating</span>
<span class="title is-6">{{ Math.floor(track.rating / 10) }} / 10</span>
</p>
<p v-if="track.comment">
<span class="heading">Comment</span>
<span class="title is-6">{{ track.comment }}</span>
</p>
</div>
</div>
<footer class="card-footer">

View File

@ -8,22 +8,22 @@
</template>
<template slot="content">
<div class="notification is-size-7" v-if="!spotify.libspotify_installed">
<div class="notification is-size-7" v-if="!spotify.spotify_installed">
<p>OwnTone was either built without support for Spotify or libspotify is not installed.</p>
</div>
<div v-if="spotify.libspotify_installed">
<div v-if="spotify.spotify_installed">
<div class="notification is-size-7">
<b>You must have a Spotify premium account</b>. If you normally log into Spotify with your Facebook account you must first go to Spotify's web site where you can get the Spotify username and password that matches your account.
<b>You must have a Spotify premium account</b>. <span v-if="use_libspotity">If you normally log into Spotify with your Facebook account you must first go to Spotify's web site where you can get the Spotify username and password that matches your account.</span>
</div>
<div>
<div v-if="use_libspotity">
<p class="content">
<b>libspotify</b> - Login with your Spotify username and password
</p>
<p v-if="spotify.libspotify_logged_in" class="fd-has-margin-bottom">
Logged in as <b><code>{{ spotify.libspotify_user }}</code></b>
</p>
<form v-if="spotify.libspotify_installed && !spotify.libspotify_logged_in" @submit.prevent="login_libspotify">
<form v-if="spotify.spotify_installed && !spotify.libspotify_logged_in" @submit.prevent="login_libspotify">
<div class="field is-grouped">
<div class="control is-expanded">
<input class="input" type="text" placeholder="Username" v-model="libspotify.user">
@ -152,6 +152,10 @@ export default {
return this.spotify.webapi_required_scope.split(' ').filter(scope => this.spotify.webapi_granted_scope.indexOf(scope) < 0)
}
return []
},
use_libspotify () {
return this.$store.state.config.use_libspotify
}
},