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

Rename some old files() functions to media()

parent a6768047
......@@ -38,7 +38,7 @@ class ILabel
virtual int64_t id() const = 0;
virtual const std::string& name() const = 0;
virtual Query<IMedia> files() = 0;
virtual Query<IMedia> media() = 0;
};
}
......
......@@ -37,7 +37,7 @@ class IMovie
virtual const std::string& shortSummary() const = 0;
virtual const std::string& artworkMrl() const = 0;
virtual const std::string& imdbId() const = 0;
virtual Query<IMedia> files() = 0;
virtual Query<IMedia> media() = 0;
};
}
......
......@@ -41,7 +41,7 @@ class IShowEpisode
virtual const std::string& shortSummary() const = 0;
virtual const std::string& tvdbId() const = 0;
virtual std::shared_ptr<IShow> show() = 0;
virtual Query<IMedia> files() = 0;
virtual Query<IMedia> media() = 0;
};
}
......
......@@ -64,7 +64,7 @@ const std::string& Label::name() const
return m_name;
}
Query<IMedia> Label::files()
Query<IMedia> Label::media()
{
static const std::string req = "FROM " + policy::MediaTable::Name + " f "
"INNER JOIN LabelFileRelation lfr ON lfr.media_id = f.id_media "
......
......@@ -54,7 +54,7 @@ class Label : public ILabel, public DatabaseHelpers<Label, policy::LabelTable>
public:
virtual int64_t id() const override;
virtual const std::string& name() const override;
virtual Query<IMedia> files() override;
virtual Query<IMedia> media() override;
static LabelPtr create( MediaLibraryPtr ml, const std::string& name );
static void createTable( sqlite::Connection* dbConnection );
......
......@@ -110,7 +110,7 @@ bool Movie::setImdbId( const std::string& imdbId )
return true;
}
Query<IMedia> Movie::files()
Query<IMedia> Movie::media()
{
static const std::string req = "FROM " + policy::MediaTable::Name
+ " WHERE movie_id = ?";
......
......@@ -56,7 +56,7 @@ class Movie : public IMovie, public DatabaseHelpers<Movie, policy::MovieTable>
bool setArtworkMrl(const std::string& artworkMrl);
virtual const std::string& imdbId() const override;
bool setImdbId(const std::string& imdbId);
virtual Query<IMedia> files() override;
virtual Query<IMedia> media() override;
static void createTable( sqlite::Connection* dbConnection );
static std::shared_ptr<Movie> create( MediaLibraryPtr ml, int64_t mediaId, const std::string& title );
......
......@@ -146,7 +146,7 @@ std::shared_ptr<IShow> ShowEpisode::show()
return m_show;
}
Query<IMedia> ShowEpisode::files()
Query<IMedia> ShowEpisode::media()
{
static const std::string req = "FROM " + policy::MediaTable::Name
+ " WHERE show_episode_id = ?";
......
......@@ -64,7 +64,7 @@ class ShowEpisode : public IShowEpisode, public DatabaseHelpers<ShowEpisode, pol
virtual const std::string& tvdbId() const override;
bool setTvdbId( const std::string& tvdbId );
virtual ShowPtr show() override;
virtual Query<IMedia> files() override;
virtual Query<IMedia> media() override;
static void createTable( sqlite::Connection* dbConnection );
static std::shared_ptr<ShowEpisode> create( MediaLibraryPtr ml, int64_t mediaId, const std::string& title, unsigned int episodeNumber, int64_t showId );
......
......@@ -112,8 +112,8 @@ TEST_F( Labels, Files )
f2->addLabel( l2 );
f3->addLabel( l1 );
auto label1Files = l1->files()->all();
auto label2Files = l2->files()->all();
auto label1Files = l1->media()->all();
auto label2Files = l2->media()->all();
ASSERT_EQ( label1Files.size(), 2u );
ASSERT_EQ( label2Files.size(), 1u );
......
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