Commit 5747d700 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

IMovie: Remove artworkMrl

As it is a duplicate of the associated media's artworkMrl
parent c767b426
......@@ -35,7 +35,6 @@ class IMovie
virtual int64_t id() const = 0;
virtual const std::string& title() const = 0;
virtual const std::string& shortSummary() const = 0;
virtual const std::string& artworkMrl() const = 0;
virtual const std::string& imdbId() const = 0;
virtual Query<IMedia> media() = 0;
};
......
......@@ -43,7 +43,6 @@ Movie::Movie(MediaLibraryPtr ml, sqlite::Row& row )
>> m_mediaId
>> m_title
>> m_summary
>> m_artworkMrl
>> m_imdbId;
}
......@@ -80,21 +79,6 @@ bool Movie::setShortSummary( const std::string& summary )
return true;
}
const std::string&Movie::artworkMrl() const
{
return m_artworkMrl;
}
bool Movie::setArtworkMrl( const std::string& artworkMrl )
{
static const std::string req = "UPDATE " + policy::MovieTable::Name
+ " SET artwork_mrl = ? WHERE id_movie = ?";
if ( sqlite::Tools::executeUpdate( m_ml->getConn(), req, artworkMrl, m_id ) == false )
return false;
m_artworkMrl = artworkMrl;
return true;
}
const std::string& Movie::imdbId() const
{
return m_imdbId;
......@@ -125,7 +109,6 @@ void Movie::createTable( sqlite::Connection* dbConnection )
"media_id UNSIGNED INTEGER NOT NULL,"
"title TEXT UNIQUE ON CONFLICT FAIL,"
"summary TEXT,"
"artwork_mrl TEXT,"
"imdb_id TEXT,"
"FOREIGN KEY(media_id) REFERENCES " + policy::MediaTable::Name
+ "(id_media) ON DELETE CASCADE"
......
......@@ -52,8 +52,6 @@ class Movie : public IMovie, public DatabaseHelpers<Movie, policy::MovieTable>
virtual const std::string& title() const override;
virtual const std::string& shortSummary() const override;
bool setShortSummary(const std::string& summary);
virtual const std::string& artworkMrl() const override;
bool setArtworkMrl(const std::string& artworkMrl);
virtual const std::string& imdbId() const override;
bool setImdbId(const std::string& imdbId);
virtual Query<IMedia> media() override;
......@@ -68,7 +66,6 @@ class Movie : public IMovie, public DatabaseHelpers<Movie, policy::MovieTable>
int64_t m_mediaId;
std::string m_title;
std::string m_summary;
std::string m_artworkMrl;
std::string m_imdbId;
friend struct policy::MovieTable;
......
......@@ -72,21 +72,6 @@ TEST_F( Movies, SetShortSummary )
ASSERT_EQ( m2->shortSummary(), "great movie" );
}
TEST_F( Movies, SetArtworkMrl )
{
auto media = std::static_pointer_cast<Media>( ml->addMedia( "movie.mkv" ) );
auto m = ml->createMovie( *media, "movie" );
ASSERT_EQ( m->artworkMrl().length(), 0u );
m->setArtworkMrl( "artwork" );
ASSERT_EQ( m->artworkMrl(), "artwork" );
Reload();
auto m2 = ml->movie( "movie" );
ASSERT_EQ( m2->artworkMrl(), "artwork" );
}
TEST_F( Movies, SetImdbId )
{
auto media = std::static_pointer_cast<Media>( ml->addMedia( "movie.mkv" ) );
......
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