Commit 306ab2c7 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

AlbumTrack: Mark most fields as immutable

parent 8d4e6281
......@@ -42,17 +42,16 @@ int64_t AlbumTrack::* const AlbumTrack::Table::PrimaryKey = &AlbumTrack::m_id;
AlbumTrack::AlbumTrack( MediaLibraryPtr ml, sqlite::Row& row )
: m_ml( ml )
, m_id( row.load<decltype(m_id)>( 0 ) )
, m_mediaId( row.load<decltype(m_mediaId)>( 1 ) )
// Skip duration
, m_artistId( row.load<decltype(m_artistId)>( 3 ) )
, m_genreId( row.load<decltype(m_genreId)>( 4 ) )
, m_trackNumber( row.load<decltype(m_trackNumber)>( 5 ) )
, m_albumId( row.load<decltype(m_albumId)>( 6 ) )
, m_discNumber( row.load<decltype(m_discNumber)>( 7 ) )
, m_isPresent( row.load<decltype(m_isPresent)>( 8 ) )
{
int64_t dummyDuration;
row >> m_id
>> m_mediaId
>> dummyDuration
>> m_artistId
>> m_genreId
>> m_trackNumber
>> m_albumId
>> m_discNumber
>> m_isPresent;
}
AlbumTrack::AlbumTrack( MediaLibraryPtr ml, int64_t mediaId, int64_t artistId, int64_t genreId,
......
......@@ -77,12 +77,12 @@ class AlbumTrack : public IAlbumTrack, public DatabaseHelpers<AlbumTrack>
private:
MediaLibraryPtr m_ml;
int64_t m_id;
int64_t m_mediaId;
int64_t m_artistId;
const int64_t m_mediaId;
const int64_t m_artistId;
int64_t m_genreId;
unsigned int m_trackNumber;
int64_t m_albumId;
unsigned int m_discNumber;
const unsigned int m_trackNumber;
const int64_t m_albumId;
const unsigned int m_discNumber;
bool m_isPresent;
mutable Cache<std::weak_ptr<Album>> m_album;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment