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

Show: name -> title

parent c3f6ceea
......@@ -33,7 +33,7 @@ class IShow
public:
virtual ~IShow() {}
virtual int64_t id() const = 0;
virtual const std::string& name() const = 0;
virtual const std::string& title() const = 0;
virtual time_t releaseDate() const = 0;
virtual const std::string& shortSummary() const = 0;
virtual const std::string& artworkMrl() const = 0;
......
......@@ -44,7 +44,7 @@ Show::Show( MediaLibraryPtr ml, sqlite::Row& row )
: m_ml( ml )
{
row >> m_id
>> m_name
>> m_title
>> m_releaseDate
>> m_shortSummary
>> m_artworkMrl
......@@ -54,7 +54,7 @@ Show::Show( MediaLibraryPtr ml, sqlite::Row& row )
Show::Show( MediaLibraryPtr ml, const std::string& name )
: m_ml( ml )
, m_id( 0 )
, m_name( name )
, m_title( name )
, m_releaseDate( 0 )
{
}
......@@ -64,9 +64,9 @@ int64_t Show::id() const
return m_id;
}
const std::string& Show::name() const
const std::string& Show::title() const
{
return m_name;
return m_title;
}
time_t Show::releaseDate() const
......@@ -182,7 +182,7 @@ void Show::createTable( sqlite::Connection* dbConnection )
{
const std::string req = "CREATE TABLE IF NOT EXISTS " + policy::ShowTable::Name + "("
"id_show INTEGER PRIMARY KEY AUTOINCREMENT,"
"name TEXT, "
"title TEXT, "
"release_date UNSIGNED INTEGER,"
"short_summary TEXT,"
"artwork_mrl TEXT,"
......@@ -195,7 +195,7 @@ std::shared_ptr<Show> Show::create( MediaLibraryPtr ml, const std::string& name
{
auto show = std::make_shared<Show>( ml, name );
static const std::string req = "INSERT INTO " + policy::ShowTable::Name
+ "(name) VALUES(?)";
+ "(title) VALUES(?)";
if ( insert( ml, show, req, name ) == false )
return nullptr;
return show;
......@@ -213,7 +213,7 @@ Query<IShow> Show::listAll( MediaLibraryPtr ml, const QueryParameters* params )
case SortingCriteria::Default:
case SortingCriteria::Alpha:
default:
req += "name";
req += "title";
break;
}
......
......@@ -50,10 +50,10 @@ class Show : public IShow, public DatabaseHelpers<Show, policy::ShowTable>
{
public:
Show( MediaLibraryPtr ml, sqlite::Row& row );
Show( MediaLibraryPtr ml, const std::string& name );
Show( MediaLibraryPtr ml, const std::string& title );
virtual int64_t id() const override;
virtual const std::string& name() const override;
virtual const std::string& title() const override;
virtual time_t releaseDate() const override;
bool setReleaseDate( time_t date );
virtual const std::string& shortSummary() const override;
......@@ -70,7 +70,7 @@ class Show : public IShow, public DatabaseHelpers<Show, policy::ShowTable>
virtual uint32_t nbEpisodes() const override;
static void createTable( sqlite::Connection* dbConnection );
static std::shared_ptr<Show> create( MediaLibraryPtr ml, const std::string& name );
static std::shared_ptr<Show> create( MediaLibraryPtr ml, const std::string& title );
static Query<IShow> listAll( MediaLibraryPtr ml, const QueryParameters* params );
......@@ -78,7 +78,7 @@ class Show : public IShow, public DatabaseHelpers<Show, policy::ShowTable>
MediaLibraryPtr m_ml;
int64_t m_id;
std::string m_name;
std::string m_title;
time_t m_releaseDate;
std::string m_shortSummary;
std::string m_artworkMrl;
......
......@@ -148,7 +148,7 @@ TEST_F( Shows, FetchShowFromEpisode )
ASSERT_NE( nullptr, f->showEpisode() );
s2 = f->showEpisode()->show();
ASSERT_NE( s2, nullptr );
ASSERT_EQ( s->name(), s2->name() );
ASSERT_EQ( s->title(), s2->title() );
}
TEST_F( Shows, SetEpisodeSeasonNumber )
......
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