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
19a44076
Commit
19a44076
authored
3 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command/file: pass directory uri to read_stream_art()
parent
809a1891
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
FileCommands.cxx
src/command/FileCommands.cxx
+8
-5
No files found.
src/command/FileCommands.cxx
View file @
19a44076
...
...
@@ -187,10 +187,9 @@ find_stream_art(std::string_view directory, Mutex &mutex)
}
static
CommandResult
read_stream_art
(
Response
&
r
,
const
char
*
uri
,
size_t
offset
)
read_stream_art
(
Response
&
r
,
const
std
::
string_view
art_directory
,
size_t
offset
)
{
const
auto
art_directory
=
PathTraitsUTF8
::
GetParent
(
uri
);
// TODO: eliminate this const_cast
auto
&
client
=
const_cast
<
Client
&>
(
r
.
GetClient
());
...
...
@@ -252,7 +251,8 @@ read_db_art(Client &client, Response &r, const char *uri, const uint64_t offset)
return
CommandResult
::
ERROR
;
}
std
::
string
uri2
=
storage
->
MapUTF8
(
uri
);
return
read_stream_art
(
r
,
uri2
.
c_str
(),
offset
);
return
read_stream_art
(
r
,
PathTraitsUTF8
::
GetParent
(
uri2
.
c_str
()),
offset
);
}
#endif
...
...
@@ -273,7 +273,10 @@ handle_album_art(Client &client, Request args, Response &r)
switch
(
located_uri
.
type
)
{
case
LocatedUri
:
:
Type
::
ABSOLUTE
:
case
LocatedUri
:
:
Type
::
PATH
:
return
read_stream_art
(
r
,
located_uri
.
canonical_uri
,
offset
);
return
read_stream_art
(
r
,
PathTraitsUTF8
::
GetParent
(
located_uri
.
canonical_uri
),
offset
);
case
LocatedUri
:
:
Type
::
RELATIVE
:
#ifdef ENABLE_DATABASE
return
read_db_art
(
client
,
r
,
located_uri
.
canonical_uri
,
offset
);
...
...
This diff is collapsed.
Click to expand it.
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