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
cf554d30
Commit
cf554d30
authored
Oct 06, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LocateUri: implement UriPluginKind::STORAGE properly
This way, URI schemes supported by arbitrary storage plugins are allowed. Closes
https://github.com/MusicPlayerDaemon/MPD/issues/1270
parent
ef24cfa5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
NEWS
NEWS
+1
-0
LocateUri.cxx
src/LocateUri.cxx
+10
-1
No files found.
NEWS
View file @
cf554d30
...
@@ -2,6 +2,7 @@ ver 0.23 (not yet released)
...
@@ -2,6 +2,7 @@ ver 0.23 (not yet released)
* protocol
* protocol
- new command "getvol"
- new command "getvol"
- show the audio format in "playlistinfo"
- show the audio format in "playlistinfo"
- support "listfiles" with arbitrary storage plugins
* database
* database
- proxy: require MPD 0.20 or later
- proxy: require MPD 0.20 or later
- proxy: require libmpdclient 2.11 or later
- proxy: require libmpdclient 2.11 or later
...
...
src/LocateUri.cxx
View file @
cf554d30
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include "client/Client.hxx"
#include "client/Client.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/AllocatedPath.hxx"
#include "ls.hxx"
#include "ls.hxx"
#include "storage/Registry.hxx"
#include "util/ASCII.hxx"
#include "util/ASCII.hxx"
#include "util/UriExtract.hxx"
#include "util/UriExtract.hxx"
...
@@ -67,11 +68,15 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri
...
@@ -67,11 +68,15 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri
{
{
switch
(
kind
)
{
switch
(
kind
)
{
case
UriPluginKind
:
:
INPUT
:
case
UriPluginKind
:
:
INPUT
:
case
UriPluginKind
:
:
STORAGE
:
// TODO: separate check for storage plugins
if
(
!
uri_supported_scheme
(
uri
))
if
(
!
uri_supported_scheme
(
uri
))
throw
std
::
invalid_argument
(
"Unsupported URI scheme"
);
throw
std
::
invalid_argument
(
"Unsupported URI scheme"
);
break
;
break
;
case
UriPluginKind
:
:
STORAGE
:
/* plugin support will be checked after the
Storage::MapToRelativeUTF8() call */
break
;
case
UriPluginKind
:
:
PLAYLIST
:
case
UriPluginKind
:
:
PLAYLIST
:
/* for now, no validation for playlist URIs; this is
/* for now, no validation for playlist URIs; this is
more complicated because there are three ways to
more complicated because there are three ways to
...
@@ -88,6 +93,10 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri
...
@@ -88,6 +93,10 @@ LocateAbsoluteUri(UriPluginKind kind, const char *uri
return
LocatedUri
(
LocatedUri
::
Type
::
RELATIVE
,
return
LocatedUri
(
LocatedUri
::
Type
::
RELATIVE
,
suffix
.
data
());
suffix
.
data
());
}
}
if
(
kind
==
UriPluginKind
::
STORAGE
&&
GetStoragePluginByUri
(
uri
)
==
nullptr
)
throw
std
::
invalid_argument
(
"Unsupported URI scheme"
);
#endif
#endif
return
LocatedUri
(
LocatedUri
::
Type
::
ABSOLUTE
,
uri
);
return
LocatedUri
(
LocatedUri
::
Type
::
ABSOLUTE
,
uri
);
...
...
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