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

IShowEpisode: Remove artworkMrl

As it is a duplicate of the associated media artwork mrl
parent 62e0780a
......@@ -34,7 +34,6 @@ class IShowEpisode
virtual ~IShowEpisode(){}
virtual int64_t id() const = 0;
virtual const std::string& artworkMrl() const = 0;
virtual unsigned int episodeNumber() const = 0;
virtual const std::string& name() const = 0;
virtual unsigned int seasonNumber() const = 0;
......
......@@ -42,7 +42,6 @@ ShowEpisode::ShowEpisode( MediaLibraryPtr ml, sqlite::Row& row )
{
row >> m_id
>> m_mediaId
>> m_artworkMrl
>> m_episodeNumber
>> m_name
>> m_seasonNumber
......@@ -67,21 +66,6 @@ int64_t ShowEpisode::id() const
return m_id;
}
const std::string& ShowEpisode::artworkMrl() const
{
return m_artworkMrl;
}
bool ShowEpisode::setArtworkMrl( const std::string& artworkMrl )
{
static const std::string req = "UPDATE " + policy::ShowEpisodeTable::Name
+ " SET artwork_mrl = ? WHERE id_episode = ?";
if ( sqlite::Tools::executeUpdate( m_ml->getConn(), req, artworkMrl, m_id ) == false )
return false;
m_artworkMrl = artworkMrl;
return true;
}
unsigned int ShowEpisode::episodeNumber() const
{
return m_episodeNumber;
......@@ -159,7 +143,6 @@ void ShowEpisode::createTable( sqlite::Connection* dbConnection )
+ "("
"id_episode INTEGER PRIMARY KEY AUTOINCREMENT,"
"media_id UNSIGNED INTEGER NOT NULL,"
"artwork_mrl TEXT,"
"episode_number UNSIGNED INT,"
"title TEXT,"
"season_number UNSIGNED INT,"
......
......@@ -53,8 +53,6 @@ class ShowEpisode : public IShowEpisode, public DatabaseHelpers<ShowEpisode, pol
ShowEpisode( MediaLibraryPtr ml, int64_t mediaId, const std::string& name, unsigned int episodeNumber, int64_t showId );
virtual int64_t id() const override;
virtual const std::string& artworkMrl() const override;
bool setArtworkMrl( const std::string& artworkMrl );
virtual unsigned int episodeNumber() const override;
virtual const std::string& name() const override;
unsigned int seasonNumber() const override;
......@@ -74,7 +72,6 @@ class ShowEpisode : public IShowEpisode, public DatabaseHelpers<ShowEpisode, pol
MediaLibraryPtr m_ml;
int64_t m_id;
int64_t m_mediaId;
std::string m_artworkMrl;
unsigned int m_episodeNumber;
std::string m_name;
unsigned int m_seasonNumber;
......
......@@ -152,22 +152,6 @@ TEST_F( Shows, FetchShowFromEpisode )
ASSERT_EQ( s->name(), s2->name() );
}
TEST_F( Shows, SetEpisodeArtwork )
{
auto show = ml->createShow( "show" );
auto media = std::static_pointer_cast<Media>( ml->addMedia( "episode.mkv" ) );
auto e = show->addEpisode( *media, "episode 1", 1 );
bool res = e->setArtworkMrl( "path-to-art" );
ASSERT_TRUE( res );
ASSERT_EQ( e->artworkMrl(), "path-to-art" );
Reload();
show = std::static_pointer_cast<Show>( ml->show( "show" ) );
auto episodes = show->episodes()->all();
ASSERT_EQ( episodes[0]->artworkMrl(), e->artworkMrl() );
}
TEST_F( Shows, SetEpisodeSeasonNumber )
{
auto show = ml->createShow( "show" );
......
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