File tree 4 files changed +16
-0
lines changed
4 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -80,11 +80,13 @@ func (c *Controller) ServeGetMusicDirectory(r *http.Request) *spec.Response {
80
80
Where ("parent_id=?" , id .Value ).
81
81
Preload ("AlbumStar" , "user_id=?" , user .ID ).
82
82
Preload ("AlbumRating" , "user_id=?" , user .ID ).
83
+ Order ("tag_year" ).
83
84
Order ("albums.right_path COLLATE NOCASE" ).
84
85
Find (& childFolders )
85
86
for _ , ch := range childFolders {
86
87
childrenObj = append (childrenObj , spec .NewTCAlbumByFolder (ch ))
87
88
}
89
+
88
90
// start looking for child childTracks in the current dir
89
91
var childTracks []* db.Track
90
92
c .dbc .
@@ -94,6 +96,7 @@ func (c *Controller) ServeGetMusicDirectory(r *http.Request) *spec.Response {
94
96
Preload ("Artists" ).
95
97
Preload ("TrackStar" , "user_id=?" , user .ID ).
96
98
Preload ("TrackRating" , "user_id=?" , user .ID ).
99
+ Order ("tag_track_number" ).
97
100
Order ("filename" ).
98
101
Find (& childTracks )
99
102
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ func NewTCAlbumByFolder(f *db.Album) *TrackChild {
40
40
ParentID : f .ParentSID (),
41
41
CreatedAt : f .CreatedAt ,
42
42
AverageRating : formatRating (f .AverageRating ),
43
+ Year : f .TagYear ,
43
44
}
44
45
if f .AlbumStar != nil {
45
46
trCh .Starred = & f .AlbumStar .StarDate
Original file line number Diff line number Diff line change 23
23
"isVideo": false,
24
24
"parent": "al-2",
25
25
"title": "album-0",
26
+ "year": 2021,
26
27
"musicBrainzId": "",
27
28
"replayGain": null
28
29
},
39
40
"isVideo": false,
40
41
"parent": "al-2",
41
42
"title": "album-1",
43
+ "year": 2021,
42
44
"musicBrainzId": "",
43
45
"replayGain": null
44
46
},
55
57
"isVideo": false,
56
58
"parent": "al-2",
57
59
"title": "album-2",
60
+ "year": 2021,
58
61
"musicBrainzId": "",
59
62
"replayGain": null
60
63
}
Original file line number Diff line number Diff line change 20
20
"isVideo": false,
21
21
"parent": "al-2",
22
22
"title": "album-0",
23
+ "year": 2021,
23
24
"musicBrainzId": "",
24
25
"replayGain": null
25
26
},
36
37
"isVideo": false,
37
38
"parent": "al-2",
38
39
"title": "album-1",
40
+ "year": 2021,
39
41
"musicBrainzId": "",
40
42
"replayGain": null
41
43
},
52
54
"isVideo": false,
53
55
"parent": "al-2",
54
56
"title": "album-2",
57
+ "year": 2021,
55
58
"musicBrainzId": "",
56
59
"replayGain": null
57
60
},
68
71
"isVideo": false,
69
72
"parent": "al-6",
70
73
"title": "album-0",
74
+ "year": 2021,
71
75
"musicBrainzId": "",
72
76
"replayGain": null
73
77
},
84
88
"isVideo": false,
85
89
"parent": "al-6",
86
90
"title": "album-1",
91
+ "year": 2021,
87
92
"musicBrainzId": "",
88
93
"replayGain": null
89
94
},
100
105
"isVideo": false,
101
106
"parent": "al-6",
102
107
"title": "album-2",
108
+ "year": 2021,
103
109
"musicBrainzId": "",
104
110
"replayGain": null
105
111
},
116
122
"isVideo": false,
117
123
"parent": "al-10",
118
124
"title": "album-0",
125
+ "year": 2021,
119
126
"musicBrainzId": "",
120
127
"replayGain": null
121
128
},
132
139
"isVideo": false,
133
140
"parent": "al-10",
134
141
"title": "album-1",
142
+ "year": 2021,
135
143
"musicBrainzId": "",
136
144
"replayGain": null
137
145
},
148
156
"isVideo": false,
149
157
"parent": "al-10",
150
158
"title": "album-2",
159
+ "year": 2021,
151
160
"musicBrainzId": "",
152
161
"replayGain": null
153
162
}
You can’t perform that action at this time.
0 commit comments