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
5e73007b
Commit
5e73007b
authored
Nov 08, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/upnp/Object: apply coding style
parent
2d9876a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
21 deletions
+28
-21
Directory.cxx
src/db/plugins/upnp/Directory.cxx
+8
-8
Object.hxx
src/db/plugins/upnp/Object.hxx
+13
-6
UpnpDatabasePlugin.cxx
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
+7
-7
No files found.
src/db/plugins/upnp/Directory.cxx
View file @
5e73007b
...
...
@@ -129,7 +129,7 @@ public:
state
(
NONE
),
tag_type
(
TAG_NUM_OF_ITEM_TYPES
)
{
m_tobj
.
c
lear
();
m_tobj
.
C
lear
();
}
protected
:
...
...
@@ -147,31 +147,31 @@ protected:
switch
(
name
[
0
])
{
case
'c'
:
if
(
!
strcmp
(
name
,
"container"
))
{
m_tobj
.
c
lear
();
m_tobj
.
C
lear
();
m_tobj
.
type
=
UPnPDirObject
::
Type
::
CONTAINER
;
const
char
*
id
=
GetAttribute
(
attrs
,
"id"
);
if
(
id
!=
nullptr
)
m_tobj
.
m_
id
=
id
;
m_tobj
.
id
=
id
;
const
char
*
pid
=
GetAttribute
(
attrs
,
"parentID"
);
if
(
pid
!=
nullptr
)
m_tobj
.
m_p
id
=
pid
;
m_tobj
.
parent_
id
=
pid
;
}
break
;
case
'i'
:
if
(
!
strcmp
(
name
,
"item"
))
{
m_tobj
.
c
lear
();
m_tobj
.
C
lear
();
m_tobj
.
type
=
UPnPDirObject
::
Type
::
ITEM
;
const
char
*
id
=
GetAttribute
(
attrs
,
"id"
);
if
(
id
!=
nullptr
)
m_tobj
.
m_
id
=
id
;
m_tobj
.
id
=
id
;
const
char
*
pid
=
GetAttribute
(
attrs
,
"parentID"
);
if
(
pid
!=
nullptr
)
m_tobj
.
m_p
id
=
pid
;
m_tobj
.
parent_
id
=
pid
;
}
break
;
...
...
@@ -198,7 +198,7 @@ protected:
}
bool
checkobjok
()
{
if
(
m_tobj
.
m_id
.
empty
()
||
m_tobj
.
m_p
id
.
empty
()
||
if
(
m_tobj
.
id
.
empty
()
||
m_tobj
.
parent_
id
.
empty
()
||
m_tobj
.
name
.
empty
()
||
(
m_tobj
.
type
==
UPnPDirObject
::
Type
::
ITEM
&&
m_tobj
.
item_class
==
UPnPDirObject
::
ItemClass
::
UNKNOWN
))
...
...
src/db/plugins/upnp/Object.hxx
View file @
5e73007b
...
...
@@ -50,8 +50,16 @@ public:
PLAYLIST
,
};
std
::
string
m_id
;
// ObjectId
std
::
string
m_pid
;
// Parent ObjectId
/**
* ObjectId
*/
std
::
string
id
;
/**
* Parent's ObjectId
*/
std
::
string
parent_id
;
std
::
string
url
;
/**
...
...
@@ -71,10 +79,9 @@ public:
UPnPDirObject
&
operator
=
(
UPnPDirObject
&&
)
=
default
;
void
clear
()
{
m_id
.
clear
();
m_pid
.
clear
();
void
Clear
()
{
id
.
clear
();
parent_id
.
clear
();
url
.
clear
();
type
=
Type
::
UNKNOWN
;
item_class
=
ItemClass
::
UNKNOWN
;
...
...
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
View file @
5e73007b
...
...
@@ -412,7 +412,7 @@ UpnpDatabase::SearchSongs(const ContentDirectoryService &server,
// So we return synthetic and ugly paths based on the object id,
// which we later have to detect.
const
std
::
string
path
=
songPath
(
server
.
getFriendlyName
(),
dirent
.
m_
id
);
dirent
.
id
);
if
(
!
visitSong
(
std
::
move
(
dirent
),
path
.
c_str
(),
selection
,
visit_song
,
error
))
...
...
@@ -447,13 +447,13 @@ UpnpDatabase::BuildPath(const ContentDirectoryService &server,
std
::
string
&
path
,
Error
&
error
)
const
{
const
char
*
pid
=
idirent
.
m_
id
.
c_str
();
const
char
*
pid
=
idirent
.
id
.
c_str
();
path
.
clear
();
UPnPDirObject
dirent
;
while
(
strcmp
(
pid
,
rootid
)
!=
0
)
{
if
(
!
ReadNode
(
server
,
pid
,
dirent
,
error
))
return
false
;
pid
=
dirent
.
m_p
id
.
c_str
();
pid
=
dirent
.
parent_
id
.
c_str
();
if
(
path
.
empty
())
path
=
dirent
.
name
;
...
...
@@ -509,7 +509,7 @@ UpnpDatabase::Namei(const ContentDirectoryService &server,
return
false
;
}
objid
=
std
::
move
(
child
->
m_
id
);
objid
=
std
::
move
(
child
->
id
);
}
}
...
...
@@ -621,7 +621,7 @@ UpnpDatabase::VisitServer(const ContentDirectoryService &server,
}
std
::
string
path
=
songPath
(
server
.
getFriendlyName
(),
dirent
.
m_
id
);
dirent
.
id
);
if
(
!
visitSong
(
std
::
move
(
dirent
),
path
.
c_str
(),
selection
,
visit_song
,
error
))
...
...
@@ -640,7 +640,7 @@ UpnpDatabase::VisitServer(const ContentDirectoryService &server,
recursion (1-deep) here, which will handle the "add dir"
case. */
if
(
selection
.
recursive
&&
selection
.
filter
)
return
SearchSongs
(
server
,
tdirent
.
m_
id
.
c_str
(),
selection
,
return
SearchSongs
(
server
,
tdirent
.
id
.
c_str
(),
selection
,
visit_song
,
error
);
const
char
*
const
base_uri
=
selection
.
uri
.
empty
()
...
...
@@ -658,7 +658,7 @@ UpnpDatabase::VisitServer(const ContentDirectoryService &server,
and loop here, but it's not useful as mpd will only return
data to the client when we're done anyway. */
UPnPDirContent
dirbuf
;
if
(
!
server
.
readDir
(
handle
,
tdirent
.
m_
id
.
c_str
(),
dirbuf
,
if
(
!
server
.
readDir
(
handle
,
tdirent
.
id
.
c_str
(),
dirbuf
,
error
))
return
false
;
...
...
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