Changeset 104

Show
Ignore:
Timestamp:
03/01/07 13:36:35 (2 years ago)
Author:
bsmith7
Message:

Songs no longer get added more than once from 1 server

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dmp/trunk/Bridge/Bridge.cs

    r100 r104  
    6060                                //lib.name = newClient.Name; 
    6161                                //lib = db.addLibrary(lib); 
    62                                 this.clientList.Add(newClient.Id, newClient); 
     62                                if(!clientList.ContainsKey(newClient.Id)) 
     63                    this.clientList.Add(newClient.Id, newClient); 
    6364 
    6465                newClient.Login(); // Passwords are for wimps 
  • dmp/trunk/daap-sharp/BridgeDatabase.cs

    r103 r104  
    262262            command.CommandText = "SELECT id FROM libraries WHERE name=\"" + name + "\""; 
    263263            reader = command.ExecuteReader(); 
     264            reader.Read(); 
    264265            int libid = reader.GetInt32(0); 
    265266            reader.Dispose(); 
  • dmp/trunk/daap-sharp/Client.cs

    r103 r104  
    125125            serverInfo = ServerInfo.FromNode (node); 
    126126 
    127             /*int libraryId = theData.getRemoteLibraryId(this.Name); 
    128             if(libraryId == -1){*/ 
     127            int libraryId = theData.getRemoteLibraryId(this.Name); 
     128            if(libraryId == -1){ 
    129129                //Puts this instance of the client in the SQLite database 
    130130                theData.addLibrary(this); 
    131             /*
     131           
    132132            else 
    133                 this.Id = libraryId;*/ 
     133                this.Id = libraryId; 
    134134        } 
    135135