跳转到主内容

LastFM

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

功能

显示 LastFM 用户当前正在播放的歌曲。

注意

请注意:暂停播放时 LastFM 的更新可能会有严重延迟,歌曲可能会长时间停留在"正在播放"状态。

此外,我们使用 HTTP 请求获取数据, 因此你可能需要调整 http_timeout 参数以获得更好的效果。

必须在 LastFM 网站上申请 API key

示例配置

{
"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"
}

选项

NameTypeDefaultDescription
playing_iconstring\uE602 text/icon to show when playing
stopped_iconstring\uF04D text/icon to show when stopped
api_keytemplate.your LastFM API key
usernamestring.your LastFM username
http_timeoutint20in milliseconds - the timeout for http request

模板 (信息)

默认模板
{{ .Icon }}{{ if ne .Status \"stopped\" }}{{ .Full }}{{ end }}

属性

NameTypeDescription
.Statusstringplayer status (playing, paused, stopped)
.Artiststringcurrent artist
.Trackstringcurrent track
.Fullstringwill output Artist - Track
.Iconstringicon (based on .Status)