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
bcf46452
Commit
bcf46452
authored
Apr 03, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/simple/Directory: add LookupResult::uri
parent
6c8eb3c7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
9 deletions
+10
-9
Directory.cxx
src/db/plugins/simple/Directory.cxx
+2
-2
Directory.hxx
src/db/plugins/simple/Directory.hxx
+5
-0
SimpleDatabasePlugin.cxx
src/db/plugins/simple/SimpleDatabasePlugin.cxx
+2
-2
Service.cxx
src/db/update/Service.cxx
+1
-5
No files found.
src/db/plugins/simple/Directory.cxx
View file @
bcf46452
...
...
@@ -133,7 +133,7 @@ Directory::LookupDirectory(const char *_uri) noexcept
assert
(
_uri
!=
nullptr
);
if
(
isRootDirectory
(
_uri
))
return
{
this
,
nullptr
};
return
{
this
,
_uri
,
nullptr
};
StringView
uri
(
_uri
);
...
...
@@ -156,7 +156,7 @@ Directory::LookupDirectory(const char *_uri) noexcept
uri
=
rest
;
}
while
(
uri
!=
nullptr
);
return
{
d
,
uri
.
data
};
return
{
d
,
StringView
(
_uri
,
uri
.
data
-
1
),
uri
.
data
};
}
void
...
...
src/db/plugins/simple/Directory.hxx
View file @
bcf46452
...
...
@@ -183,6 +183,11 @@ public:
Directory
*
directory
;
/**
* The URI part which resolved to the #directory.
*/
std
::
string_view
uri
;
/**
* The remaining URI part (without leading slash) or
* nullptr if the given URI was consumed completely.
*/
...
...
src/db/plugins/simple/SimpleDatabasePlugin.cxx
View file @
bcf46452
...
...
@@ -217,7 +217,7 @@ SimpleDatabase::GetSong(const char *uri) const
return
nullptr
;
prefixed_light_song
=
new
PrefixedLightSong
(
*
song
,
r
.
directory
->
GetPath
()
);
new
PrefixedLightSong
(
*
song
,
r
.
uri
);
r
.
directory
->
mounted_database
->
ReturnSong
(
song
);
return
prefixed_light_song
;
}
...
...
@@ -289,7 +289,7 @@ SimpleDatabase::Visit(const DatabaseSelection &selection,
/* pass the request and the remaining uri to the mounted database */
protect
.
unlock
();
WalkMount
(
r
.
directory
->
GetPath
()
,
*
(
r
.
directory
->
mounted_database
),
WalkMount
(
r
.
uri
,
*
(
r
.
directory
->
mounted_database
),
(
r
.
rest
==
nullptr
)
?
""
:
r
.
rest
,
selection
,
visit_directory
,
visit_song
,
visit_playlist
);
...
...
src/db/update/Service.cxx
View file @
bcf46452
...
...
@@ -196,11 +196,7 @@ UpdateService::Enqueue(const char *path, bool discard)
storage2
=
storage
.
GetMount
(
path
);
path
=
""
;
}
else
{
assert
(
lr
.
rest
>
path
);
assert
(
lr
.
rest
<
path
+
strlen
(
path
));
assert
(
lr
.
rest
[
-
1
]
==
'/'
);
const
std
::
string
mountpoint
(
path
,
lr
.
rest
-
1
);
const
std
::
string
mountpoint
(
lr
.
uri
);
storage2
=
storage
.
GetMount
(
mountpoint
.
c_str
());
path
=
lr
.
rest
;
}
...
...
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