Fix LastFM API scrobble parsing when song is currently playing
This commit is contained in:
parent
c57bf18627
commit
a314fd447d
1 changed files with 2 additions and 1 deletions
|
|
@ -103,7 +103,8 @@ pub fn post(request: *jetzig.Request) !jetzig.View {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
.LastFMWeb => |scrobbles| {
|
.LastFMWeb => |scrobbles| {
|
||||||
for (scrobbles) |scrobble| {
|
appends: for (scrobbles) |scrobble| {
|
||||||
|
if (scrobble.date == null) continue :appends;
|
||||||
const filtered_scrobble = Data.Scrobble{
|
const filtered_scrobble = Data.Scrobble{
|
||||||
.album = if (scrobble.album) |album| album.@"#text" else "Not Provided",
|
.album = if (scrobble.album) |album| album.@"#text" else "Not Provided",
|
||||||
.artists_album = &[_][]const u8{scrobble.artist.@"#text"},
|
.artists_album = &[_][]const u8{scrobble.artist.@"#text"},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue