diff options
author | Jonathan Marshall <jmarshall@never.you.mind> | 2012-06-02 15:29:33 +1200 |
---|---|---|
committer | Jonathan Marshall <jmarshall@never.you.mind> | 2012-07-01 11:16:24 +1200 |
commit | 625625ede41aaceafcef22eefce1f3bb19579209 (patch) | |
tree | 6cc54dba7d876fe5d87e432a523ddaf806f840ed | |
parent | 2046165596d4c89813ac5760147efaa9f8905ac9 (diff) |
[cuesheet] adds startOffset to CMusicDatabase::GetSongByFileName() to differentiate cue items
-rw-r--r-- | xbmc/music/MusicDatabase.cpp | 4 | ||||
-rw-r--r-- | xbmc/music/MusicDatabase.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp index 8010d9f146..f811933cd3 100644 --- a/xbmc/music/MusicDatabase.cpp +++ b/xbmc/music/MusicDatabase.cpp @@ -971,7 +971,7 @@ CArtist CMusicDatabase::GetArtistFromDataset(dbiplus::Dataset* pDS, bool needThu return artist; } -bool CMusicDatabase::GetSongByFileName(const CStdString& strFileName, CSong& song) +bool CMusicDatabase::GetSongByFileName(const CStdString& strFileName, CSong& song, int startOffset) { try { @@ -998,6 +998,8 @@ bool CMusicDatabase::GetSongByFileName(const CStdString& strFileName, CSong& son "where dwFileNameCRC='%ul' and strPath='%s'" , crc, strPath.c_str()); + if (startOffset) + strSQL += PrepareSQL(" AND iStartOffset=%i", startOffset); if (!m_pDS->query(strSQL.c_str())) return false; int iRowsFound = m_pDS->num_rows(); diff --git a/xbmc/music/MusicDatabase.h b/xbmc/music/MusicDatabase.h index f83b2fef6b..52a882f802 100644 --- a/xbmc/music/MusicDatabase.h +++ b/xbmc/music/MusicDatabase.h @@ -137,7 +137,7 @@ public: bool GetAlbumInfo(int idAlbum, CAlbum &info, VECSONGS* songs); bool HasAlbumInfo(int idAlbum); bool GetArtistInfo(int idArtist, CArtist &info, bool needAll=true); - bool GetSongByFileName(const CStdString& strFileName, CSong& song); + bool GetSongByFileName(const CStdString& strFileName, CSong& song, int startOffset = 0); int GetAlbumIdByPath(const CStdString& path); bool GetSongById(int idSong, CSong& song); bool GetSongByKaraokeNumber( int number, CSong& song ); |