[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bamarok=5D_src/core-impl/collections/db/sql=3A_Set_c?=
From: Sergey Ivanov <123kash () gmail ! com>
Date: 2011-03-18 13:06:01
Message-ID: 20110318130601.36FC7A609B () git ! kde ! org
[Download RAW message or body]
Git commit 77c65f6fa760b3e3181865ede1ec8867a34c6fde by Sergey Ivanov.
Committed on 18/03/2011 at 14:06.
Pushed by ivanov into branch 'master'.
Set correct year for destination track on Move/Copy to SqlCollection.
Fix odd checks for numerical fields.
M +9 -9 src/core-impl/collections/db/sql/SqlCollectionLocation.cpp
http://commits.kde.org/amarok/77c65f6fa760b3e3181865ede1ec8867a34c6fde
diff --git a/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp \
b/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp index 5d05770..15801bb \
100644
--- a/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp
+++ b/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp
@@ -205,8 +205,8 @@ SqlCollectionLocation::insert( const Meta::TrackPtr &track, const \
QString &url ) if( track->composer() )
metaTrack->setComposer( track->composer()->name() );
- if( track->year() > 0 )
- metaTrack->setYear( track->year() );
+ if( track->year() && track->year()->year() > 0 )
+ metaTrack->setYear( track->year()->year() );
if( track->genre() )
metaTrack->setGenre( track->genre()->name() );
@@ -223,28 +223,28 @@ SqlCollectionLocation::insert( const Meta::TrackPtr &track, \
const QString &url ) metaTrack->setUidUrl( uid );
*/
- if( !track->bpm() >= 0 )
+ if( track->bpm() > 0 )
metaTrack->setBpm( track->bpm() );
if( !track->comment().isEmpty() )
metaTrack->setComment( track->comment() );
- if( !track->length() >= 0 )
+ if( track->length() > 0 )
metaTrack->setLength( track->length() );
// the filesize is updated every time after the
// file is changed. Doesn't make sense to set it.
- if( !track->sampleRate() >= 0 )
+ if( track->sampleRate() > 0 )
metaTrack->setSampleRate( track->sampleRate() );
- if( !track->bitrate() >= 0 )
+ if( track->bitrate() > 0 )
metaTrack->setBitrate( track->bitrate() );
- if( !track->trackNumber() >= 0 )
+ if( track->trackNumber() > 0 )
metaTrack->setTrackNumber( track->trackNumber() );
- if( !track->discNumber() >= 0 )
+ if( track->discNumber() > 0 )
metaTrack->setDiscNumber( track->discNumber() );
Meta::ReplayGainTag modes[] = { Meta::ReplayGain_Track_Gain,
@@ -253,7 +253,7 @@ SqlCollectionLocation::insert( const Meta::TrackPtr &track, const \
QString &url ) Meta::ReplayGain_Album_Peak };
for( int i=0; i<4; i++ )
- if( !track->replayGain( modes[i] ) != 0 )
+ if( track->replayGain( modes[i] ) != 0 )
metaTrack->setReplayGain( modes[i], track->replayGain( modes[i] ) );
Meta::LabelList labels = track->labels();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic