Commit 9a3c2050 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

Remove CachePolicy & CacheColumns leftovers

parent cfc11e0f
......@@ -25,7 +25,7 @@
#include "Media.h"
const std::string policy::AudioTrackTable::Name = "AudioTrack";
const std::string policy::AudioTrackTable::CacheColumn = "id_track";
const std::string policy::AudioTrackTable::PrimaryKeyColumn = "id_track";
unsigned int AudioTrack::* const policy::AudioTrackTable::PrimaryKey = &AudioTrack::m_id;
AudioTrack::AudioTrack( DBConnection dbConnection, sqlite::Row& row )
......@@ -95,7 +95,7 @@ bool AudioTrack::createTable( DBConnection dbConnection )
//FIXME: Index on media_id ? Unless it's already implied by the foreign key
static const std::string req = "CREATE TABLE IF NOT EXISTS " + policy::AudioTrackTable::Name
+ "(" +
policy::AudioTrackTable::CacheColumn + " INTEGER PRIMARY KEY AUTOINCREMENT,"
policy::AudioTrackTable::PrimaryKeyColumn + " INTEGER PRIMARY KEY AUTOINCREMENT,"
"codec TEXT,"
"bitrate UNSIGNED INTEGER,"
"samplerate UNSIGNED INTEGER,"
......
......@@ -34,7 +34,7 @@ namespace policy
struct AudioTrackTable
{
static const std::string Name;
static const std::string CacheColumn;
static const std::string PrimaryKeyColumn;
static unsigned int AudioTrack::* const PrimaryKey;
};
}
......
......@@ -89,13 +89,3 @@ bool Label::createTable(DBConnection dbConnection)
"FOREIGN KEY(id_media) REFERENCES Media(id_media) ON DELETE CASCADE);";
return sqlite::Tools::executeRequest( dbConnection, req );
}
const std::string&policy::LabelCachePolicy::key( const ILabel* self )
{
return self->name();
}
std::string policy::LabelCachePolicy::key( const sqlite::Row& row )
{
return row.load<KeyType>( 1 );
}
......@@ -40,14 +40,6 @@ struct LabelTable
static const std::string PrimaryKeyColumn;
static unsigned int Label::*const PrimaryKey;
};
struct LabelCachePolicy
{
typedef std::string KeyType;
static const std::string& key(const ILabel* self );
static std::string key( const sqlite::Row& row );
};
}
class Label : public ILabel, public DatabaseHelpers<Label, policy::LabelTable>
......
......@@ -24,7 +24,7 @@
#include "Media.h"
const std::string policy::VideoTrackTable::Name = "VideoTrack";
const std::string policy::VideoTrackTable::CacheColumn = "id_track";
const std::string policy::VideoTrackTable::PrimaryKeyColumn = "id_track";
unsigned int VideoTrack::* const policy::VideoTrackTable::PrimaryKey = &VideoTrack::m_id;
VideoTrack::VideoTrack( DBConnection dbConnection, sqlite::Row& row )
......@@ -89,7 +89,7 @@ bool VideoTrack::createTable( DBConnection dbConnection )
{
static const std::string req = "CREATE TABLE IF NOT EXISTS " + policy::VideoTrackTable::Name
+ "(" +
policy::VideoTrackTable::CacheColumn + " INTEGER PRIMARY KEY AUTOINCREMENT,"
policy::VideoTrackTable::PrimaryKeyColumn + " INTEGER PRIMARY KEY AUTOINCREMENT,"
"codec TEXT,"
"width UNSIGNED INTEGER,"
"height UNSIGNED INTEGER,"
......
......@@ -35,7 +35,7 @@ namespace policy
struct VideoTrackTable
{
static const std::string Name;
static const std::string CacheColumn;
static const std::string PrimaryKeyColumn;
static unsigned int VideoTrack::* const PrimaryKey;
};
}
......
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