Ticket #9813: 0001-Check-for-compilation-artist-in-cddb-daemon.patch

File 0001-Check-for-compilation-artist-in-cddb-daemon.patch, 1.7 KB (added by jscipione, 7 years ago)

Patch to check for Various before looking for track specific artist info

  • src/servers/cddb_daemon/cddb_server.cpp

    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)  
    256256
    257257                trackData->trackNumber = track;
    258258
    259                 int32 pos = line.FindFirst(" / " );
     259                int32 pos = line.FindFirst("Various / ");
    260260                if (pos != B_ERROR) {
    261                     // We have track specific artist information.
     261                    // We have compilation artist information.
    262262                    BString artist;
    263                     line.MoveInto(artist, 0, pos);
     263                    line.MoveInto(artist, 0, pos + 7);
     264                        // Move "Various" from line to artist
    264265                    line.Remove(0, 3);
     266                        // Remove " / " from line
    265267                    trackData->artist = artist;
    266268                } 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                    }
    268282                }
    269283
    270284                trackData->title = line;