Ticket #9813: 0001-Check-if-disk-has-compilation-artist.patch

File 0001-Check-if-disk-has-compilation-artist.patch, 1.3 KB (added by jscipione, 7 years ago)

Let's try again. Look for disk title set to Various case-insensitively before parsing track specific artist info using ICompare()

  • src/servers/cddb_daemon/cddb_server.cpp

    From 14c3a8e8762479dc8c3a13f4b5e827d2f1b1fcb5 Mon Sep 17 00:00:00 2001
    From: John Scipione <jscipione@gmail.com>
    Date: Tue, 4 Jun 2013 18:29:48 -0400
    Subject: [PATCH] Check if disk has compilation artist
    
    ... before looking for track specific artist information. Fixes #9813
    ---
     src/servers/cddb_daemon/cddb_server.cpp | 7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/src/servers/cddb_daemon/cddb_server.cpp b/src/servers/cddb_daemon/cddb_server.cpp
    index d0d8ebb..46f369e 100644
    a b CDDBServer::Read(QueryResponseData* diskData, ReadResponseData* readResponse)  
    257257                trackData->trackNumber = track;
    258258
    259259                int32 pos = line.FindFirst(" / " );
    260                 if (pos != B_ERROR) {
    261                     // We have track specific artist information.
     260                if (pos != B_ERROR && diskData->artist.ICompare("Various") == 0) {
     261                    // Disk is set to have a compilation artist and
     262                    // we have track specific artist information.
    262263                    BString artist;
    263264                    line.MoveInto(artist, 0, pos);
     265                        // Move artist information from line to artist.
    264266                    line.Remove(0, 3);
     267                        // Remove " / " from line.
    265268                    trackData->artist = artist;
    266269                } else {
    267270                    trackData->artist = diskData->artist;