Bug 235030 - Some ID3 tags in files from daap share are always empty (track number, length, year)
Summary: Some ID3 tags in files from daap share are always empty (track number, length...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/DAAP (show other bugs)
Version: 2.3.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-22 03:38 UTC by emil.ostwald
Modified: 2010-07-19 20:11 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
fix daap issue (1.70 KB, patch)
2010-07-19 18:34 UTC, Silvio Frischknecht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description emil.ostwald 2010-04-22 03:38:26 UTC
Version:           2.3.0 (using KDE 4.3.5)
OS:                Linux
Installed from:    openSUSE RPMs

Some ID3 tag information in files from a daap share are always empty. These are the track number, length and year.
Checked it in Amarok version 1.4 and there it shows this information.
Comment 1 emil.ostwald 2010-04-22 14:22:54 UTC
See also:
Bug 220612 -  Track length is shown as 0:00 for all songs at a DAAP share
Comment 2 Jade Falcon 2010-05-26 23:31:50 UTC
I can confirm this behavior. When connecting to my daap server all track order information has been stripped.

Version: 2.2.0 (using KDE 4.3.2)
OS:   Kubuntu 9.10
Installed from: Ubuntu repos
Comment 3 Myriam Schweingruber 2010-05-27 11:31:50 UTC
Jade, your confirmation is not useful, your version is outdated, sorry. A confirmation needs to be with the same or a later version.
Comment 4 Sebastian Vahl 2010-06-13 11:14:39 UTC
I can confirm this with amarok-2.3.1 on Fedora 13 x86_64. 
Example debug output from command line:
amarok:   [EngineController] Artist     :  ("Black Era") 
amarok:   [EngineController] Album      :  ("Common creates nature (6)") 
amarok:   [EngineController] Title      :  ("Less than zero") 
amarok:   [EngineController] Genre      :  ("Trip-Hop") 
amarok:   [EngineController] Tracknumber:  () 
amarok:   [EngineController] Length     :  () 
amarok:   [EngineController] Track changed:  false 

The tracknumber is present in the meta tags (this is an ogg file here but it's also not shown in mp3). The year is even missing here.
Comment 5 Sebastian Vahl 2010-06-13 11:17:09 UTC
(In reply to comment #4)
> I can confirm this with amarok-2.3.1 on Fedora 13 x86_64. 

Just forgotten: KDE 4.4.3 and mt-daapd 0.2.4.2
Comment 6 Myriam Schweingruber 2010-06-13 15:47:03 UTC
Confirmed by comment.
Comment 7 Silvio Frischknecht 2010-07-19 18:34:32 UTC
Created attachment 49317 [details]
fix daap issue

I have had a look at it and I think i have solved it.

The problem was that track_number and year were search for with the wrong type and the time was converted to second instead of leaving it miliseconds.

Could anyone test my patch and commit it.
Comment 8 Bart Cerneels 2010-07-19 20:11:58 UTC
commit ce18dd81b6fb4e295499738d36aea9d163cec657
Author: Bart Cerneels <bart.cerneels@kde.org>
Date:   Mon Jul 19 20:10:57 2010 +0200

    Fix DAAP tracknumbers and tracktime.
    
    BUG:235030
    
    Patch by Silvio Frischknecht.

diff --git a/ChangeLog b/ChangeLog
index 6e39b5c..15c7e00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@ VERSION 2.3.2-Beta 1
       Patch by Richard Longland <rlongland@hotmail.com>.
 
   BUGFIXES:
+    * Fix track number on DAAP shares. Patch by Silvio Frischknecht. (BR 235030)
     * Fixed filtering by rating in the playlist. (BR 240293)
     * The scripts categories are now translatable. (BR 240563)
     * Fixed Amarok 1.4 Database Importer not importing statistics and lyrics of
diff --git a/src/core-impl/collections/daap/daapreader/Reader.cpp b/src/core-impl/collections/daap/daapreader/Reader.cpp
index 92db790..0fd70e5 100644
--- a/src/core-impl/collections/daap/daapreader/Reader.cpp
+++ b/src/core-impl/collections/daap/daapreader/Reader.cpp
@@ -356,6 +356,10 @@ Reader::parseSongList( const QByteArray &data )
             {
                 qint16 shortData;
                 raw >> shortData; DEBUGTAG( shortData )
+                if ( QString( tag ) == "astn" )
+                    trackNumber = shortData;
+                else if ( QString( tag ) == "asyr" )
+                     year = QString::number(shortData);
                 break;
             }
             case LONG:
@@ -365,9 +369,7 @@ Reader::parseSongList( const QByteArray &data )
                 if ( QString( tag ) == "miid" )
                     itemId = QString::number( longData );
                 if ( QString( tag ) == "astm" )
-                    songTime = longData/1000;
-                if ( QString( tag ) == "astn" )
-                    trackNumber = longData;
+                    songTime = longData;
                 break;
             }
             case LONGLONG:
@@ -392,8 +394,6 @@ Reader::parseSongList( const QByteArray &data )
                      composer = QString::fromUtf8( stringData, tagLength );
                 else if ( QString( tag ) == "ascm" )
                      comment = QString::fromUtf8( stringData, tagLength );
-                else if ( QString( tag ) == "asyr" )
-                     year = QString::fromUtf8( stringData, tagLength );
                 else if ( QString( tag ) == "asgn" )
                      genre = QString::fromUtf8( stringData, tagLength );
                 break;