Manual token submission functionality

This commit is contained in:
Core 2022-06-28 13:39:09 +01:00
parent e032302b5d
commit f58ca1c613
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6
4 changed files with 14 additions and 5 deletions

View file

@ -237,6 +237,7 @@
"action.delete": "Delete",
"action.edit": "Edit",
"action.done": "Done",
"action.submit": "Submit",
"action.editTracklist": "Edit Tracklist",
"action.addToLibrary": "Add to Library",
"action.addToLibrary.success": "Added to Library",
@ -535,6 +536,7 @@
"settings.option.connectivity.lastfmScrobble.filterLoop": "Filter looped track (Last.fm)",
"settings.option.connectivity.lastfmScrobble.filterLoop.description": "Prevent looped tracks from being scrobbled or displayed in the Now Playing list on Last.fm.",
"settings.option.connectivity.lastfmScrobble.filterTypes": "Filter Media Types (Last.fm)",
"settings.option.connectivity.lastfmScrobble.manualToken": "Enter Last.fm Token Manually",
"settings.notyf.connectivity.lastfmScrobble.connectError": "Last.fm Connection Timed Out",
"settings.notyf.connectivity.lastfmScrobble.connectSuccess": "Last.fm Connection Successful",
"settings.notyf.connectivity.lastfmScrobble.connecting": "Connecting to Last.fm...",

View file

@ -232,6 +232,7 @@
"action.delete": "Delete",
"action.edit": "Edit",
"action.done": "Done",
"action.submit": "Submit",
"action.editTracklist": "Edit Tracklist",
"action.addToLibrary": "Add to Library",
"action.addToLibrary.success": "Added to Library",
@ -522,6 +523,7 @@
"settings.option.connectivity.lastfmScrobble.filterLoop": "Filter looped track (Last.fm)",
"settings.option.connectivity.lastfmScrobble.filterLoop.description": "Prevent looped tracks from being scrobbled or displayed in the Now Playing list on Last.fm.",
"settings.option.connectivity.lastfmScrobble.filterTypes": "Filter Media Types (Last.fm)",
"settings.option.connectivity.lastfmScrobble.manualToken": "Enter Last.fm Token Manually",
"settings.notyf.connectivity.lastfmScrobble.connectError": "Last.fm Connection Timed Out",
"settings.notyf.connectivity.lastfmScrobble.connectSuccess": "Last.fm Connection Successful",
"settings.notyf.connectivity.lastfmScrobble.connecting": "Connecting to Last.fm...",

View file

@ -38,7 +38,7 @@ export default class lastfm {
// Register the ipcMain handlers
this._utils.getIPCMain().handle('lastfm:url', (event: any) => {
console.debug(`${lastfm.name}:url`, event)
console.debug(`${lastfm.name}:url`)
return this._lfm.getAuthenticationUrl({"cb": "cider://auth/lastfm"})
})
@ -114,6 +114,8 @@ export default class lastfm {
this._lfm.authenticate(token, (err: any, session: any) => {
if (err) {
console.error(err);
this._utils.getWindow().webContents.executeJavaScript(`app.notyf.error("${err.message}");`)
return;
}
this._utils.getWindow().webContents.send('lastfm:authenticated', session)

View file

@ -1096,17 +1096,20 @@
</button>
</div>
</div>
<div class="md-option-line" v-show="app.cfg.lastfm.enabled">
<div class="md-option-line" v-show="lastfmConnecting">
<div class="md-option-segment">
{{$root.getLz('settings.option.connectivity.lastfmScrobble.delay')}}
{{$root.getLz('settings.option.connectivity.lastfmScrobble.manualToken')}}
</div>
<div class="md-option-segment md-option-segment_auto">
<label>
<input type="number" min="50" max="100" v-model="app.cfg.lastfm.scrobble_after" />
<form @submit.prevent="submitToken">
<input type="text" autofocus id="lfmToken" />
<input type="submit" class="md-btn" @value="$root.getLz('action.submit')" />
</form>
</label>
</div>
</div>
<div class="md-option-line" v-show="app.cfg.lastfm.enabled">
<div class="md-option-line" v-show="app.cfg.connectivity.lastfm.enabled">
<div class="md-option-segment">
{{$root.getLz('settings.option.connectivity.lastfmScrobble.delay')}}
</div>