add more omitempty changes
This commit is contained in:
@@ -52,6 +52,16 @@ func NewTrackByTags(t *db.Track, album *db.Album) *TrackChild {
|
|||||||
if album.TagArtist != nil {
|
if album.TagArtist != nil {
|
||||||
ret.ArtistID = album.TagArtist.ID
|
ret.ArtistID = album.TagArtist.ID
|
||||||
}
|
}
|
||||||
|
// replace tags that we're present
|
||||||
|
if ret.Title == "" {
|
||||||
|
ret.Title = "<title>"
|
||||||
|
}
|
||||||
|
if ret.Artist == "" {
|
||||||
|
ret.Artist = "<artist>"
|
||||||
|
}
|
||||||
|
if ret.Album == "" {
|
||||||
|
ret.Album = "<album>"
|
||||||
|
}
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -134,12 +134,12 @@ type TrackChild struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Artists struct {
|
type Artists struct {
|
||||||
List []*Index `xml:"index,omitempty" json:"index"`
|
List []*Index `xml:"index" json:"index"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Artist struct {
|
type Artist struct {
|
||||||
ID int `xml:"id,attr,omitempty" json:"id,string"`
|
ID int `xml:"id,attr,omitempty" json:"id,string"`
|
||||||
Name string `xml:"name,attr,omitempty" json:"name"`
|
Name string `xml:"name,attr" json:"name"`
|
||||||
CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty,string"`
|
CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty,string"`
|
||||||
AlbumCount int `xml:"albumCount,attr" json:"albumCount"`
|
AlbumCount int `xml:"albumCount,attr" json:"albumCount"`
|
||||||
Albums []*Album `xml:"album,omitempty" json:"album,omitempty"`
|
Albums []*Album `xml:"album,omitempty" json:"album,omitempty"`
|
||||||
@@ -147,12 +147,12 @@ type Artist struct {
|
|||||||
|
|
||||||
type Indexes struct {
|
type Indexes struct {
|
||||||
LastModified int `xml:"lastModified,attr,omitempty" json:"lastModified"`
|
LastModified int `xml:"lastModified,attr,omitempty" json:"lastModified"`
|
||||||
Index []*Index `xml:"index,omitempty" json:"index"`
|
Index []*Index `xml:"index" json:"index"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Index struct {
|
type Index struct {
|
||||||
Name string `xml:"name,attr,omitempty" json:"name"`
|
Name string `xml:"name,attr,omitempty" json:"name"`
|
||||||
Artists []*Artist `xml:"artist,omitempty" json:"artist"`
|
Artists []*Artist `xml:"artist" json:"artist"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Directory struct {
|
type Directory struct {
|
||||||
@@ -164,7 +164,7 @@ type Directory struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MusicFolders struct {
|
type MusicFolders struct {
|
||||||
List []*MusicFolder `xml:"musicFolder,omitempty" json:"musicFolder,omitempty"`
|
List []*MusicFolder `xml:"musicFolder" json:"musicFolder"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MusicFolder struct {
|
type MusicFolder struct {
|
||||||
@@ -224,7 +224,7 @@ type Playlist struct {
|
|||||||
Created time.Time `xml:"created,attr" json:"created"`
|
Created time.Time `xml:"created,attr" json:"created"`
|
||||||
Duration string `xml:"duration,attr" json:"duration,omitempty"`
|
Duration string `xml:"duration,attr" json:"duration,omitempty"`
|
||||||
Public bool `xml:"public,attr" json:"public,omitempty"`
|
Public bool `xml:"public,attr" json:"public,omitempty"`
|
||||||
List []*TrackChild `xml:"entry" json:"entry,omitempty"`
|
List []*TrackChild `xml:"entry" json:"entry"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SimilarArtist struct {
|
type SimilarArtist struct {
|
||||||
|
|||||||
@@ -6,28 +6,6 @@
|
|||||||
"gonicVersion": "v0.7.0",
|
"gonicVersion": "v0.7.0",
|
||||||
"albumList": {
|
"albumList": {
|
||||||
"album": [
|
"album": [
|
||||||
{
|
|
||||||
"id": "19",
|
|
||||||
"coverArt": "19",
|
|
||||||
"artist": "Ten Years After",
|
|
||||||
"title": "(1967) Ten Years After",
|
|
||||||
"parent": "18",
|
|
||||||
"isDir": true,
|
|
||||||
"songCount": 15,
|
|
||||||
"duration": 0,
|
|
||||||
"created": "0001-01-01T00:00:00Z"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "8",
|
|
||||||
"coverArt": "8",
|
|
||||||
"artist": "13th Floor Lowervators",
|
|
||||||
"title": "(1967) Easter Nowhere",
|
|
||||||
"parent": "7",
|
|
||||||
"isDir": true,
|
|
||||||
"songCount": 10,
|
|
||||||
"duration": 0,
|
|
||||||
"created": "0001-01-01T00:00:00Z"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "9",
|
"id": "9",
|
||||||
"coverArt": "9",
|
"coverArt": "9",
|
||||||
@@ -39,6 +17,17 @@
|
|||||||
"duration": 0,
|
"duration": 0,
|
||||||
"created": "0001-01-01T00:00:00Z"
|
"created": "0001-01-01T00:00:00Z"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "19",
|
||||||
|
"coverArt": "19",
|
||||||
|
"artist": "Ten Years After",
|
||||||
|
"title": "(1967) Ten Years After",
|
||||||
|
"parent": "18",
|
||||||
|
"isDir": true,
|
||||||
|
"songCount": 15,
|
||||||
|
"duration": 0,
|
||||||
|
"created": "0001-01-01T00:00:00Z"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "13",
|
"id": "13",
|
||||||
"coverArt": "13",
|
"coverArt": "13",
|
||||||
@@ -51,23 +40,24 @@
|
|||||||
"created": "0001-01-01T00:00:00Z"
|
"created": "0001-01-01T00:00:00Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "3",
|
"id": "21",
|
||||||
"coverArt": "3",
|
"coverArt": "21",
|
||||||
"artist": "Jah Wobble, The Edge, Holger Czukay",
|
"artist": "Captain Beefheart",
|
||||||
"title": "(1983) Snake Charmer",
|
"title": "(1970) Lick My Decals Off, Bitch",
|
||||||
"parent": "2",
|
"parent": "20",
|
||||||
"isDir": true,
|
"isDir": true,
|
||||||
"songCount": 5,
|
"songCount": 15,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"created": "0001-01-01T00:00:00Z"
|
"created": "0001-01-01T00:00:00Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "6",
|
"id": "17",
|
||||||
"artist": "A Certain Ratio",
|
"coverArt": "17",
|
||||||
"title": "(1981) To EachOTHER.",
|
"artist": "Swell Maps",
|
||||||
"parent": "4",
|
"title": "(1979) A Trip to Marineville",
|
||||||
|
"parent": "15",
|
||||||
"isDir": true,
|
"isDir": true,
|
||||||
"songCount": 9,
|
"songCount": 18,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"created": "0001-01-01T00:00:00Z"
|
"created": "0001-01-01T00:00:00Z"
|
||||||
},
|
},
|
||||||
@@ -83,13 +73,12 @@
|
|||||||
"created": "0001-01-01T00:00:00Z"
|
"created": "0001-01-01T00:00:00Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "21",
|
"id": "6",
|
||||||
"coverArt": "21",
|
"artist": "A Certain Ratio",
|
||||||
"artist": "Captain Beefheart",
|
"title": "(1981) To EachOTHER.",
|
||||||
"title": "(1970) Lick My Decals Off, Bitch",
|
"parent": "4",
|
||||||
"parent": "20",
|
|
||||||
"isDir": true,
|
"isDir": true,
|
||||||
"songCount": 15,
|
"songCount": 9,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"created": "0001-01-01T00:00:00Z"
|
"created": "0001-01-01T00:00:00Z"
|
||||||
},
|
},
|
||||||
@@ -105,13 +94,24 @@
|
|||||||
"created": "0001-01-01T00:00:00Z"
|
"created": "0001-01-01T00:00:00Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "17",
|
"id": "8",
|
||||||
"coverArt": "17",
|
"coverArt": "8",
|
||||||
"artist": "Swell Maps",
|
"artist": "13th Floor Lowervators",
|
||||||
"title": "(1979) A Trip to Marineville",
|
"title": "(1967) Easter Nowhere",
|
||||||
"parent": "15",
|
"parent": "7",
|
||||||
"isDir": true,
|
"isDir": true,
|
||||||
"songCount": 18,
|
"songCount": 10,
|
||||||
|
"duration": 0,
|
||||||
|
"created": "0001-01-01T00:00:00Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "3",
|
||||||
|
"coverArt": "3",
|
||||||
|
"artist": "Jah Wobble, The Edge, Holger Czukay",
|
||||||
|
"title": "(1983) Snake Charmer",
|
||||||
|
"parent": "2",
|
||||||
|
"isDir": true,
|
||||||
|
"songCount": 5,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"created": "0001-01-01T00:00:00Z"
|
"created": "0001-01-01T00:00:00Z"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,45 +7,14 @@
|
|||||||
"albumList2": {
|
"albumList2": {
|
||||||
"album": [
|
"album": [
|
||||||
{
|
{
|
||||||
"id": "13",
|
"id": "6",
|
||||||
"coverArt": "13",
|
"artistId": "2",
|
||||||
"artistId": "4",
|
"artist": "A Certain Ratio",
|
||||||
"artist": "Anikas",
|
"name": "To Each...",
|
||||||
"name": "Anika",
|
|
||||||
"songCount": 9,
|
"songCount": 9,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"created": "2019-05-23T15:12:02.921473302+01:00"
|
"created": "2019-05-23T15:12:02.921473302+01:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "19",
|
|
||||||
"coverArt": "19",
|
|
||||||
"artistId": "6",
|
|
||||||
"artist": "Ten Years After",
|
|
||||||
"name": "Ten Years After",
|
|
||||||
"songCount": 15,
|
|
||||||
"duration": 0,
|
|
||||||
"created": "2019-04-30T16:48:30+01:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "5",
|
|
||||||
"coverArt": "5",
|
|
||||||
"artistId": "2",
|
|
||||||
"artist": "A Certain Ratio",
|
|
||||||
"name": "The Graveyard and the Ballroom",
|
|
||||||
"songCount": 14,
|
|
||||||
"duration": 0,
|
|
||||||
"created": "2019-06-05T17:46:37.675917974+01:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "17",
|
|
||||||
"coverArt": "17",
|
|
||||||
"artistId": "5",
|
|
||||||
"artist": "Swell Maps",
|
|
||||||
"name": "A Trip to Marineville",
|
|
||||||
"songCount": 18,
|
|
||||||
"duration": 0,
|
|
||||||
"created": "2019-04-30T16:48:48+01:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "3",
|
"id": "3",
|
||||||
"coverArt": "3",
|
"coverArt": "3",
|
||||||
@@ -56,6 +25,26 @@
|
|||||||
"duration": 0,
|
"duration": 0,
|
||||||
"created": "2019-05-16T22:10:52+01:00"
|
"created": "2019-05-16T22:10:52+01:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "17",
|
||||||
|
"coverArt": "17",
|
||||||
|
"artistId": "5",
|
||||||
|
"artist": "Swell Maps",
|
||||||
|
"name": "A Trip to Marineville",
|
||||||
|
"songCount": 18,
|
||||||
|
"duration": 0,
|
||||||
|
"created": "2019-04-30T16:48:48+01:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "5",
|
||||||
|
"coverArt": "5",
|
||||||
|
"artistId": "2",
|
||||||
|
"artist": "A Certain Ratio",
|
||||||
|
"name": "The Graveyard and the Ballroom",
|
||||||
|
"songCount": 14,
|
||||||
|
"duration": 0,
|
||||||
|
"created": "2019-06-05T17:46:37.675917974+01:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "21",
|
"id": "21",
|
||||||
"coverArt": "21",
|
"coverArt": "21",
|
||||||
@@ -66,6 +55,16 @@
|
|||||||
"duration": 0,
|
"duration": 0,
|
||||||
"created": "2019-06-10T19:26:30.944742894+01:00"
|
"created": "2019-06-10T19:26:30.944742894+01:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "13",
|
||||||
|
"coverArt": "13",
|
||||||
|
"artistId": "4",
|
||||||
|
"artist": "Anikas",
|
||||||
|
"name": "Anika",
|
||||||
|
"songCount": 9,
|
||||||
|
"duration": 0,
|
||||||
|
"created": "2019-05-23T15:12:02.921473302+01:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "9",
|
"id": "9",
|
||||||
"coverArt": "9",
|
"coverArt": "9",
|
||||||
@@ -77,23 +76,14 @@
|
|||||||
"created": "2019-06-13T12:57:24.306717554+01:00"
|
"created": "2019-06-13T12:57:24.306717554+01:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "16",
|
"id": "19",
|
||||||
"coverArt": "16",
|
"coverArt": "19",
|
||||||
"artistId": "5",
|
"artistId": "6",
|
||||||
"artist": "Swell Maps",
|
"artist": "Ten Years After",
|
||||||
"name": "Jane From Occupied Europe",
|
"name": "Ten Years After",
|
||||||
"songCount": 16,
|
"songCount": 15,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"created": "2019-04-30T16:48:48+01:00"
|
"created": "2019-04-30T16:48:30+01:00"
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "6",
|
|
||||||
"artistId": "2",
|
|
||||||
"artist": "A Certain Ratio",
|
|
||||||
"name": "To Each...",
|
|
||||||
"songCount": 9,
|
|
||||||
"duration": 0,
|
|
||||||
"created": "2019-05-23T15:12:02.921473302+01:00"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "8",
|
"id": "8",
|
||||||
@@ -104,6 +94,16 @@
|
|||||||
"songCount": 10,
|
"songCount": 10,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"created": "2019-06-13T12:57:28.850090338+01:00"
|
"created": "2019-06-13T12:57:28.850090338+01:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "16",
|
||||||
|
"coverArt": "16",
|
||||||
|
"artistId": "5",
|
||||||
|
"artist": "Swell Maps",
|
||||||
|
"name": "Jane From Occupied Europe",
|
||||||
|
"songCount": 16,
|
||||||
|
"duration": 0,
|
||||||
|
"created": "2019-04-30T16:48:48+01:00"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user