internal int AddSong(SongTable songTable) { sqlConnection.Insert(songTable); return(songTable.SongId); }
public SongModel AddNewSong(string artist, string album, string albumArtist, string title, string path, SongOriginSource origin, long duration, uint rating, uint trackNumber) { ArtistModel artistModel = LookupArtistByName(artist); ArtistModel albumArtistModel = LookupArtistByName(albumArtist); AlbumModel albumModel = LookupAlbumByName(album, albumArtistModel.ArtistId); SongModel currentTableEntry = LookupSongByPath(path); if (currentTableEntry == null) { SongTable newSong = new SongTable(albumModel.AlbumId, artistModel.ArtistId, duration, 0, title, origin, 0, rating, path, trackNumber); DatabaseManager.Current.AddSong(newSong); SongModel songModel = new SongModel(newSong); _allSongs.Add(songModel); songLookupDictionary.Add(songModel.SongId, songModel); return songModel; } return null; }
internal int AddSong(SongTable songTable) { sqlConnection.Insert(songTable); return songTable.SongId; }