return a "-1" id (like airsonic) for "nil" items
This commit is contained in:
@@ -265,7 +265,7 @@ func (c *Controller) ServeGetArtistInfoTwo(r *http.Request) *spec.Response {
|
||||
continue
|
||||
}
|
||||
similar := &spec.SimilarArtist{
|
||||
ID: &specid.ID{Type: specid.Artist, Value: -1},
|
||||
ID: &specid.ID{},
|
||||
}
|
||||
if artist.ID != 0 {
|
||||
similar.ID = artist.SID()
|
||||
|
||||
@@ -51,6 +51,9 @@ func New(in string) (ID, error) {
|
||||
}
|
||||
|
||||
func (i ID) String() string {
|
||||
if i.Value == 0 {
|
||||
return "-1"
|
||||
}
|
||||
return fmt.Sprintf("%s%s%d", i.Type, separator, i.Value)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user