From 9043627fdcc525c58eac8160e887adda1319aeec Mon Sep 17 00:00:00 2001 From: SeraphJACK Date: Sat, 16 Sep 2023 17:04:20 +0800 Subject: [PATCH] Response empty slice instead of nil --- services/playlist.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/playlist.go b/services/playlist.go index e589b0a..03c59a8 100644 --- a/services/playlist.go +++ b/services/playlist.go @@ -2,15 +2,16 @@ package services import ( "errors" + "net/http" + "strconv" + "time" + "github.com/ProjectAnni/anniv-go/meta" "github.com/ProjectAnni/anniv-go/model" "github.com/gin-gonic/gin" "github.com/mitchellh/mapstructure" "gorm.io/gorm" "gorm.io/gorm/clause" - "net/http" - "strconv" - "time" ) type PatchedPlaylistInfo struct { @@ -463,6 +464,7 @@ func playlistInfo(p model.Playlist) PlaylistInfo { func queryPlaylist(p model.Playlist) (*PlaylistDetails, error) { ret := PlaylistDetails{ PlaylistInfo: playlistInfo(p), + Items: []PlaylistItemWithId{}, } var songs []model.PlaylistSong