Commit 5453b7d
ShimmerGlass
fix: use request track count, better mix artist similar songs
The plugin used a config value for the track count to return for
GetSimilarSongsByTrack, and returned everything for
GetSimilarSongsByArtist. This ignores the "count" parameter in the
request, which indicates how many songs the player wants.
This change makes use of this parameter and removes the plugin config
value to be better match what navidrome expects, and have one less thing
for users to configure / worry about.
For GetSimilarSongsByTrack we simply use the parameter from the query
and keep the same logic.
For GetSimilarSongsByArtist, however, no limit was implemented. Before
this change the plugin returned tracks in "clumps": a few tracks for
artist1, a few tracks for artist2, etc. I changed the logic to instead
alternate between the "base artist" (from the request) and related
artists, stopping when we have the desired number of tracks. This IMHO
better emulates the "radio" features of popular streaming services.1 parent c279bc1 commit 5453b7d
2 files changed
+51
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
84 | | - | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
88 | 86 | | |
89 | | - | |
| 87 | + | |
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
94 | | - | |
| 92 | + | |
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
| |||
151 | 149 | | |
152 | 150 | | |
153 | 151 | | |
154 | | - | |
155 | | - | |
156 | 152 | | |
157 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
158 | 157 | | |
| 158 | + | |
| 159 | + | |
159 | 160 | | |
160 | 161 | | |
| 162 | + | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 166 | + | |
| 167 | + | |
167 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
168 | 172 | | |
| 173 | + | |
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
176 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
177 | 185 | | |
178 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
179 | 194 | | |
180 | 195 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
185 | 215 | | |
186 | 216 | | |
187 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 18 | | |
27 | 19 | | |
28 | 20 | | |
| |||
62 | 54 | | |
63 | 55 | | |
64 | 56 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 57 | | |
70 | 58 | | |
71 | 59 | | |
| |||
100 | 88 | | |
101 | 89 | | |
102 | 90 | | |
103 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
104 | 94 | | |
105 | 95 | | |
106 | | - | |
| 96 | + | |
0 commit comments