From f26bad4744f0afa976696c2b0534912b965ba4fb Mon Sep 17 00:00:00 2001
From: John Scipione <jscipione@gmail.com>
Date: Tue, 4 Jun 2013 17:18:48 -0400
Subject: [PATCH] Check for compilation artist in cddb daemon
... before looking for track specific artist information. Fixes #9813
---
src/servers/cddb_daemon/cddb_server.cpp | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/src/servers/cddb_daemon/cddb_server.cpp b/src/servers/cddb_daemon/cddb_server.cpp
index d0d8ebb..b201d30 100644
a
|
b
|
CDDBServer::Read(QueryResponseData* diskData, ReadResponseData* readResponse)
|
256 | 256 | |
257 | 257 | trackData->trackNumber = track; |
258 | 258 | |
259 | | int32 pos = line.FindFirst(" / " ); |
| 259 | int32 pos = line.FindFirst("Various / "); |
260 | 260 | if (pos != B_ERROR) { |
261 | | // We have track specific artist information. |
| 261 | // We have compilation artist information. |
262 | 262 | BString artist; |
263 | | line.MoveInto(artist, 0, pos); |
| 263 | line.MoveInto(artist, 0, pos + 7); |
| 264 | // Move "Various" from line to artist |
264 | 265 | line.Remove(0, 3); |
| 266 | // Remove " / " from line |
265 | 267 | trackData->artist = artist; |
266 | 268 | } else { |
267 | | trackData->artist = diskData->artist; |
| 269 | // Check for track specific artist information. |
| 270 | pos = line.FindFirst(" / "); |
| 271 | if (pos != B_ERROR) { |
| 272 | // We have track specific artist information. |
| 273 | BString artist; |
| 274 | line.MoveInto(artist, 0, pos); |
| 275 | // Move the artist information from line to artist |
| 276 | line.Remove(0, 3); |
| 277 | // Remove " / " from line |
| 278 | trackData->artist = artist; |
| 279 | } else { |
| 280 | trackData->artist = diskData->artist; |
| 281 | } |
268 | 282 | } |
269 | 283 | |
270 | 284 | trackData->title = line; |