Skip to content

Commit

Permalink
improve last.fm failure logging
Browse files Browse the repository at this point in the history
  • Loading branch information
wakingrufus committed Dec 31, 2021
1 parent 6de0bc3 commit e395710
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ This method will work on almost any computer with Java 17.

#### Debian Linux
This method is preferred for Debian linux. It requires no Java to be installed.
Download the `.deb` from the [latest release](https://github.com/wakingrufus/JaMM/releases/latest) and install it with your package manager.
To add the Jamm deb repo, run the following terminal commands:
```bash
curl -L https://packagecloud.io/wakingrufus/public/gpgkey | sudo apt-key add -
sudo add-apt-repository "deb https://packagecloud.io/wakingrufus/public/any/ any main"
sudo apt install jamm
```

You can also download the `.deb` from the [latest release](https://github.com/wakingrufus/JaMM/releases/latest) and install it with your package manager.

### Set music library directory
The default Music library directory is `~/Music`. To change this, use the Settings menu.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package com.github.wakingrufus.jamm.lastfm

import com.github.wakingrufus.jamm.common.Track
import com.github.wakingrufus.jamm.desktop.Logging
import com.github.wakingrufus.jamm.desktop.globalLogger
import com.github.wakingrufus.jamm.desktop.logger
import java.nio.charset.StandardCharsets
import java.time.Instant

class LastFmClient(val sessionKey: String) : Logging {
Expand All @@ -23,6 +25,7 @@ class LastFmClient(val sessionKey: String) : Logging {
signedPost("track.scrobble", sessionKey, args).response().also {
if (it.third.component2() != null) {
logger().warn(it.second.responseMessage)
logger().warn(it.second.body().toByteArray().toString(StandardCharsets.UTF_8))
}
}
}
Expand All @@ -43,6 +46,7 @@ class LastFmClient(val sessionKey: String) : Logging {
signedPost("track.updatenowplaying", sessionKey, args).response().also {
if (it.third.component2() != null) {
logger().warn(it.second.responseMessage)
logger().warn(it.second.body().toByteArray().toString(StandardCharsets.UTF_8))
}
}
}
Expand Down

0 comments on commit e395710

Please sign in to comment.