Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
fa9de2ad
Commit
fa9de2ad
authored
Jul 03, 2018
by
Hugo Beauzée-Luyssen
Browse files
Show: name -> title
parent
c3f6ceea
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/medialibrary/IShow.h
View file @
fa9de2ad
...
...
@@ -33,7 +33,7 @@ class IShow
public:
virtual
~
IShow
()
{}
virtual
int64_t
id
()
const
=
0
;
virtual
const
std
::
string
&
nam
e
()
const
=
0
;
virtual
const
std
::
string
&
titl
e
()
const
=
0
;
virtual
time_t
releaseDate
()
const
=
0
;
virtual
const
std
::
string
&
shortSummary
()
const
=
0
;
virtual
const
std
::
string
&
artworkMrl
()
const
=
0
;
...
...
src/Show.cpp
View file @
fa9de2ad
...
...
@@ -44,7 +44,7 @@ Show::Show( MediaLibraryPtr ml, sqlite::Row& row )
:
m_ml
(
ml
)
{
row
>>
m_id
>>
m_
nam
e
>>
m_
titl
e
>>
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_
nam
e
(
name
)
,
m_
titl
e
(
name
)
,
m_releaseDate
(
0
)
{
}
...
...
@@ -64,9 +64,9 @@ int64_t Show::id() const
return
m_id
;
}
const
std
::
string
&
Show
::
nam
e
()
const
const
std
::
string
&
Show
::
titl
e
()
const
{
return
m_
nam
e
;
return
m_
titl
e
;
}
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,"
"
nam
e TEXT, "
"
titl
e 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
+
"(
nam
e) VALUES(?)"
;
+
"(
titl
e) 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
+=
"
nam
e"
;
req
+=
"
titl
e"
;
break
;
}
...
...
src/Show.h
View file @
fa9de2ad
...
...
@@ -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
&
nam
e
);
Show
(
MediaLibraryPtr
ml
,
const
std
::
string
&
titl
e
);
virtual
int64_t
id
()
const
override
;
virtual
const
std
::
string
&
nam
e
()
const
override
;
virtual
const
std
::
string
&
titl
e
()
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
&
nam
e
);
static
std
::
shared_ptr
<
Show
>
create
(
MediaLibraryPtr
ml
,
const
std
::
string
&
titl
e
);
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_
nam
e
;
std
::
string
m_
titl
e
;
time_t
m_releaseDate
;
std
::
string
m_shortSummary
;
std
::
string
m_artworkMrl
;
...
...
test/unittest/ShowTests.cpp
View file @
fa9de2ad
...
...
@@ -148,7 +148,7 @@ TEST_F( Shows, FetchShowFromEpisode )
ASSERT_NE
(
nullptr
,
f
->
showEpisode
()
);
s2
=
f
->
showEpisode
()
->
show
();
ASSERT_NE
(
s2
,
nullptr
);
ASSERT_EQ
(
s
->
nam
e
(),
s2
->
nam
e
()
);
ASSERT_EQ
(
s
->
titl
e
(),
s2
->
titl
e
()
);
}
TEST_F
(
Shows
,
SetEpisodeSeasonNumber
)
...
...
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