Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Soomin Lee
medialibrary
Commits
e478e1fd
Commit
e478e1fd
authored
Apr 24, 2018
by
Hugo Beauzée-Luyssen
Browse files
Rename some old files() functions to media()
parent
a6768047
Changes
10
Hide whitespace changes
Inline
Side-by-side
include/medialibrary/ILabel.h
View file @
e478e1fd
...
...
@@ -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
;
};
}
...
...
include/medialibrary/IMovie.h
View file @
e478e1fd
...
...
@@ -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
;
};
}
...
...
include/medialibrary/IShowEpisode.h
View file @
e478e1fd
...
...
@@ -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
;
};
}
...
...
src/Label.cpp
View file @
e478e1fd
...
...
@@ -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 "
...
...
src/Label.h
View file @
e478e1fd
...
...
@@ -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
);
...
...
src/Movie.cpp
View file @
e478e1fd
...
...
@@ -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 = ?"
;
...
...
src/Movie.h
View file @
e478e1fd
...
...
@@ -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
);
...
...
src/ShowEpisode.cpp
View file @
e478e1fd
...
...
@@ -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 = ?"
;
...
...
src/ShowEpisode.h
View file @
e478e1fd
...
...
@@ -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
);
...
...
test/unittest/LabelTests.cpp
View file @
e478e1fd
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment