{"record":{"id":"38f17c6eb244e779","repo":"JanDeDobbeleer/oh-my-posh","slug":"no-data-found","errorCode":null,"errorMessage":"no data found","messagePattern":"no data found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/segments/lastfm.go","lineNumber":97,"sourceCode":"\t\treturn new(lfmDataResponse), err\n\t}\n\n\terr = json.Unmarshal(body, &response)\n\tif err != nil {\n\t\treturn new(lfmDataResponse), err\n\t}\n\n\treturn response, nil\n}\n\nfunc (d *LastFM) setStatus() error {\n\tq, err := d.getResult()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(q.TracksInfo.Tracks) == 0 {\n\t\treturn errors.New(\"no data found\")\n\t}\n\n\ttrack := q.TracksInfo.Tracks[0]\n\n\td.Artist = track.Artist.Name\n\td.Track = track.Name\n\td.Full = fmt.Sprintf(\"%s - %s\", d.Artist, d.Track)\n\n\tisPlaying := track.Info != nil && track.Info.IsPlaying != nil && *track.Info.IsPlaying == \"true\"\n\n\tif isPlaying {\n\t\td.Icon = d.options.String(PlayingIcon, \"\\uE602 \")\n\t\td.Status = \"playing\"\n\t} else {\n\t\td.Icon = d.options.String(StoppedIcon, \"\\uF04D \")\n\t\td.Status = \"stopped\"\n\t}\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/segments/lastfm.go#L79-L115","documentation":"The lastfm segment queries the Last.fm API for the user's recent tracks. setStatus() calls getResult() and, if the response contains zero tracks (TracksInfo.Tracks empty), returns 'no data found' — meaning the account has no scrobbled/recent track data for the query period.","triggerScenarios":"Enabled() runs, the API call succeeds, but the returned recent-tracks list is empty: account with no scrobbles, no tracks played recently, or a freshly created API account.","commonSituations":"User hasn't listened to music since enabling scrobbling; scrobbling is paused/disconnected in the player; Last.fm profile is new; private profile hiding data.","solutions":["Play and scrobble some music, then let the prompt re-render.","Verify your player is actually scrobbling to Last.fm (check the recent tracks page on last.fm).","Confirm the api_key and user options point to the correct Last.fm account.","Disable the segment until the account has track data."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// check recent tracks before enabling:\ncurl \"https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=<user>&api_key=<key>&format=json&limit=1\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm the Last.fm account has recent scrobbles before enabling the segment.","Verify the player's scrobbling connection is active.","Check the user option matches the scrobbling account."],"tags":["api","lastfm","empty-data"],"backgroundTag":"no-data-found","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}