#12 add album when scrobbling to last.fm

Closed
conn wants to merge 1 commits from conn/freezerpc:master into master
  1. +3
    -2
      app/src/integrations.js
  2. +2
    -2
      app/src/server.js

+ 3
- 2
app/src/integrations.js View File

@ -54,11 +54,12 @@ class Integrations extends EventEmitter {
} }
//LastFM Scrobble //LastFM Scrobble
async scrobbleLastFM(title, artist) {
async scrobbleLastFM(title, artist, album) {
if (this.settings.lastFM) if (this.settings.lastFM)
this.lastfm.track.scrobble({ this.lastfm.track.scrobble({
artist: artist, artist: artist,
track: title, track: title,
album: album,
timestamp: Math.floor((new Date()).getTime() / 1000) timestamp: Math.floor((new Date()).getTime() / 1000)
}); });
} }
@ -137,4 +138,4 @@ class Integrations extends EventEmitter {
} }
module.exports = {Integrations};
module.exports = {Integrations};

+ 2
- 2
app/src/server.js View File

@ -463,7 +463,7 @@ app.delete('/downloads/:index', async (req, res) => {
//Log listen to deezer & lastfm //Log listen to deezer & lastfm
app.post('/log', async (req, res) => { app.post('/log', async (req, res) => {
//LastFM //LastFM
integrations.scrobbleLastFM(req.body.title, req.body.artists[0].name);
integrations.scrobbleLastFM(req.body.title, req.body.artists[0].name, req.body.album.title);
//Deezer //Deezer
if (settings.logListen) if (settings.logListen)
@ -723,4 +723,4 @@ async function createServer(electron = false, ecb, override = {}) {
return settings; return settings;
} }
module.exports = {createServer};
module.exports = {createServer};

Loading…
Cancel
Save