Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
45139f94
Commit
45139f94
authored
Jul 06, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/LightSong: pass URI to constructor
parent
80cb680f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
19 deletions
+20
-19
DetachedSong.cxx
src/DetachedSong.cxx
+1
-2
LightSong.hxx
src/db/LightSong.hxx
+2
-2
ProxyDatabasePlugin.cxx
src/db/plugins/ProxyDatabasePlugin.cxx
+1
-3
Song.cxx
src/db/plugins/simple/Song.cxx
+1
-2
UpnpDatabasePlugin.cxx
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
+15
-10
No files found.
src/DetachedSong.cxx
View file @
45139f94
...
...
@@ -33,9 +33,8 @@ DetachedSong::DetachedSong(const LightSong &other)
DetachedSong
::
operator
LightSong
()
const
noexcept
{
LightSong
result
(
tag
);
LightSong
result
(
uri
.
c_str
(),
tag
);
result
.
directory
=
nullptr
;
result
.
uri
=
uri
.
c_str
();
result
.
real_uri
=
real_uri
.
empty
()
?
nullptr
:
real_uri
.
c_str
();
result
.
mtime
=
mtime
;
result
.
start_time
=
start_time
;
...
...
src/db/LightSong.hxx
View file @
45139f94
...
...
@@ -78,8 +78,8 @@ struct LightSong {
*/
SongTime
end_time
=
SongTime
::
zero
();
explicit
LightSong
(
const
Tag
&
_tag
)
noexcept
:
tag
(
_tag
)
{}
LightSong
(
const
char
*
_uri
,
const
Tag
&
_tag
)
noexcept
:
uri
(
_uri
),
tag
(
_tag
)
{}
gcc_pure
std
::
string
GetURI
()
const
noexcept
{
...
...
src/db/plugins/ProxyDatabasePlugin.cxx
View file @
45139f94
...
...
@@ -203,10 +203,8 @@ Copy(TagBuilder &tag, TagType d_tag,
}
ProxySong
::
ProxySong
(
const
mpd_song
*
song
)
:
LightSong
(
tag2
)
:
LightSong
(
mpd_song_get_uri
(
song
),
tag2
)
{
uri
=
mpd_song_get_uri
(
song
);
const
auto
_mtime
=
mpd_song_get_last_modified
(
song
);
if
(
_mtime
>
0
)
mtime
=
std
::
chrono
::
system_clock
::
from_time_t
(
_mtime
);
...
...
src/db/plugins/simple/Song.cxx
View file @
45139f94
...
...
@@ -98,10 +98,9 @@ Song::GetURI() const noexcept
LightSong
Song
::
Export
()
const
noexcept
{
LightSong
dest
(
tag
);
LightSong
dest
(
uri
,
tag
);
dest
.
directory
=
parent
->
IsRoot
()
?
nullptr
:
parent
->
GetPath
();
dest
.
uri
=
uri
;
dest
.
real_uri
=
nullptr
;
dest
.
mtime
=
mtime
;
dest
.
start_time
=
start_time
;
...
...
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
View file @
45139f94
...
...
@@ -48,18 +48,24 @@
static
const
char
*
const
rootid
=
"0"
;
class
UpnpSong
:
public
LightSong
{
std
::
string
uri2
,
real_uri2
;
class
UpnpSongData
{
protected
:
std
::
string
uri
;
Tag
tag
;
template
<
typename
U
,
typename
T
>
UpnpSongData
(
U
&&
_uri
,
T
&&
_tag
)
noexcept
:
uri
(
std
::
forward
<
U
>
(
_uri
)),
tag
(
std
::
forward
<
T
>
(
_tag
))
{}
};
Tag
tag2
;
class
UpnpSong
:
UpnpSongData
,
public
LightSong
{
std
::
string
real_uri2
;
public
:
UpnpSong
(
UPnPDirObject
&&
object
,
std
::
string
&&
_uri
)
:
LightSong
(
tag2
),
uri2
(
std
::
move
(
_uri
)),
real_uri2
(
std
::
move
(
object
.
url
)),
tag2
(
std
::
move
(
object
.
tag
))
{
uri
=
uri2
.
c_str
();
:
UpnpSongData
(
std
::
move
(
_uri
),
std
::
move
(
object
.
tag
)),
LightSong
(
UpnpSongData
::
uri
.
c_str
(),
UpnpSongData
::
tag
),
real_uri2
(
std
::
move
(
object
.
url
))
{
real_uri
=
real_uri2
.
c_str
();
}
};
...
...
@@ -318,8 +324,7 @@ visitSong(const UPnPDirObject &meta, const char *path,
if
(
!
visit_song
)
return
;
LightSong
song
(
meta
.
tag
);
song
.
uri
=
path
;
LightSong
song
(
path
,
meta
.
tag
);
song
.
real_uri
=
meta
.
url
.
c_str
();
if
(
selection
.
Match
(
song
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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