Bug#678302: [pkg-cli-apps-team] Bug#678302: tangerine assigns duplicate IDs to tracks newly added to existing database

2012-06-21 Thread Chow Loong Jin
forwarded 678302 https://bugs.launchpad.net/bugs/1015985
kthxbye

On 21/06/2012 02:11, Nemo Inis wrote:
 Package: tangerine
 Version: 0.3.4-3
 
 Starting from scratch, tangerine correctly scans and imports all the tracks 
 from my library folder.
 However, if I quit tangerine, add new tracks (or folders of tracks) to my 
 library, and start
 tangerine again, the new tracks do not show up or do not play in my clients 
 (Rhythmbox and
 XBMC). But if I delete  ~/.config/tangerine/tracks.db and start tangerine 
 again, the tracks
 appear correctly in my clients.
 I tracked the problem to some code in daap-sharp/src/Database.cs that results 
 in a duplicate
 track ID being assigned to any new track being added to an existing tracks 
 database.
 The attached patch fixes that problem for me.
 
 System: Debian GNU/Linux testing (wheezy)





signature.asc
Description: OpenPGP digital signature


Bug#678302: tangerine assigns duplicate IDs to tracks newly added to existing database

2012-06-20 Thread Nemo Inis
Package: tangerine
Version: 0.3.4-3

Starting from scratch, tangerine correctly scans and imports all the tracks 
from my library folder.
However, if I quit tangerine, add new tracks (or folders of tracks) to my 
library, and start
tangerine again, the new tracks do not show up or do not play in my clients 
(Rhythmbox and
XBMC). But if I delete  ~/.config/tangerine/tracks.db and start tangerine 
again, the tracks
appear correctly in my clients.
I tracked the problem to some code in daap-sharp/src/Database.cs that results 
in a duplicate
track ID being assigned to any new track being added to an existing tracks 
database.
The attached patch fixes that problem for me.

System: Debian GNU/Linux testing (wheezy)
diff --git a/daap-sharp/src/Database.cs b/daap-sharp/src/Database.cs
index 82aca1b..63bae66 100644
--- a/daap-sharp/src/Database.cs
+++ b/daap-sharp/src/Database.cs
@@ -432,8 +432,7 @@ namespace DAAP {
 }
 
 public void AddTrack (Track track) {
-if (track.Id == 0)
-track.SetId (nextTrackId++);
+track.SetId (nextTrackId++);
 
 tracks.Add (track);
 basePlaylist.AddTrack (track);