File 0004-Fix-reading-Album-Artist-Compilation-Disc-Number-in-.patch of Package amarok

From df6d5c3ded956787797c90cc9ecec8b009b1b096 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bruno=20L=C3=A9on?= <bruno.leon@nividic.org>
Date: Fri, 30 Aug 2013 18:29:49 +0200
Subject: [PATCH 1/1] Fix reading Album Artist / Compilation / Disc Number in
 APE tags.

Fix reading of Album Artist and Compilation tag in APE tags.
Add support for reading Disc Number in APE tags.

REVIEW: 112266
BUG: 323735
---
 ChangeLog                           |  2 ++
 shared/tag_helpers/APETagHelper.cpp | 11 ++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/shared/tag_helpers/APETagHelper.cpp b/shared/tag_helpers/APETagHelper.cpp
index c628694..ba39a10 100644
--- a/shared/tag_helpers/APETagHelper.cpp
+++ b/shared/tag_helpers/APETagHelper.cpp
@@ -30,11 +30,11 @@ APETagHelper::APETagHelper( TagLib::Tag *tag, TagLib::APE::Tag *apeTag, Amarok::
             : TagHelper( tag, fileType )
             , m_tag( apeTag )
 {
-    m_fieldMap.insert( Meta::valAlbumArtist, TagLib::String( "Album Artist" ) );
+    m_fieldMap.insert( Meta::valAlbumArtist, TagLib::String( "ALBUM ARTIST" ) );
     m_fieldMap.insert( Meta::valBpm,         TagLib::String( "BPM" ) );
-    m_fieldMap.insert( Meta::valCompilation, TagLib::String( "Compilation" ) );
+    m_fieldMap.insert( Meta::valCompilation, TagLib::String( "COMPILATION" ) );
     m_fieldMap.insert( Meta::valComposer,    TagLib::String( "Composer" ) );
-    m_fieldMap.insert( Meta::valDiscNr,      TagLib::String( "Disc" ) );
+    m_fieldMap.insert( Meta::valDiscNr,      TagLib::String( "DISC" ) );
     m_fieldMap.insert( Meta::valPlaycount,   TagLib::String( "FMPS_PLAYCOUNT" ) );
     m_fieldMap.insert( Meta::valRating,      TagLib::String( "FMPS_RATING" ) );
     m_fieldMap.insert( Meta::valScore,       TagLib::String( "FMPS_RATING_AMAROK_SCORE" ) );
@@ -58,6 +58,11 @@ APETagHelper::tags() const
                 data.insert( field, qRound( value.toFloat() * 10.0 ) );
             else if( field == Meta::valScore )
                 data.insert( field, value.toFloat() * 100.0 );
+            else if( field == Meta::valDiscNr ) {
+                int disc;
+                disc = splitDiscNr( value ).first;
+                data.insert( field, disc );
+            }
             else
                 data.insert( field, value );
         }
-- 
1.8.4

openSUSE Build Service is sponsored by