LastFM
Traduction Bêta Non Officielle
Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →
Description
Affiche la chanson en cours de lecture d'un utilisateur LastFM.
attention
Notez que les mises à jour LastFM peuvent être fortement retardées en pause, et les chansons peuvent rester à l'état "en cours de lecture" pendant un temps prolongé.
De plus, nous utilisons des requêtes HTTP pour récupérer les données.
Vous devrez peut-être ajuster le http_timeout selon vos préférences pour de meilleurs résultats.
Vous devez demander une clé API sur le site LastFM.
Exemple de configuration
- json
- yaml
- toml
{
"background": "p:sky",
"foreground": "p:white",
"powerline_symbol": "",
"options": {
"api_key": "<YOUR_API_KEY>",
"username": "<LASTFM_USERNAME>",
"http_timeout": 20000
},
"style": "powerline",
"template": " {{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Full }}{{ end }} ",
"type": "lastfm"
}
background: p:sky
foreground: p:white
powerline_symbol:
options:
api_key: <YOUR_API_KEY>
username: <LASTFM_USERNAME>
http_timeout: 20000
style: powerline
template: ' {{ .Icon }}{{ if ne .Status "stopped" }}{{ .Full }}{{ end }} '
type: lastfm
background = "p:sky"
foreground = "p:white"
powerline_symbol = ""
style = "powerline"
template = " {{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Full }}{{ end }} "
type = "lastfm"
[options]
api_key = "<YOUR_API_KEY>"
username = "<LASTFM_USERNAME>"
http_timeout = 20000
Options
| Name | Type | Default | Description |
|---|---|---|---|
playing_icon | string | \uE602 | text/icon to show when playing |
stopped_icon | string | \uF04D | text/icon to show when stopped |
api_key | template | . | your LastFM API key |
username | string | . | your LastFM username |
http_timeout | int | 20 | in milliseconds - the timeout for http request |
Modèle (info)
modèle par défaut
{{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Full }}{{ end }}
Propriétés
| Name | Type | Description |
|---|---|---|
.Status | string | player status (playing, paused, stopped) |
.Artist | string | current artist |
.Track | string | current track |
.Full | string | will output Artist - Track |
.Icon | string | icon (based on .Status) |