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
0adcda38
Commit
0adcda38
authored
May 10, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PlaylistCommands: remove redundant playlist_load_spl() call
This case is handled already by playlist_open_in_playlist_dir() (via playlist_mapper_open()). And the call didn't work anyway.
parent
fc1664d9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
55 deletions
+0
-55
PlaylistSave.cxx
src/PlaylistSave.cxx
+0
-29
PlaylistSave.hxx
src/PlaylistSave.hxx
+0
-10
PlaylistCommands.cxx
src/command/PlaylistCommands.cxx
+0
-16
No files found.
src/PlaylistSave.cxx
View file @
0adcda38
...
@@ -99,32 +99,3 @@ spl_save_playlist(const char *name_utf8, const playlist &playlist)
...
@@ -99,32 +99,3 @@ spl_save_playlist(const char *name_utf8, const playlist &playlist)
{
{
return
spl_save_queue
(
name_utf8
,
playlist
.
queue
);
return
spl_save_queue
(
name_utf8
,
playlist
.
queue
);
}
}
bool
playlist_load_spl
(
struct
playlist
&
playlist
,
PlayerControl
&
pc
,
const
char
*
name_utf8
,
unsigned
start_index
,
unsigned
end_index
,
Error
&
error
)
{
PlaylistFileContents
contents
=
LoadPlaylistFile
(
name_utf8
,
error
);
if
(
contents
.
empty
()
&&
error
.
IsDefined
())
return
false
;
if
(
end_index
>
contents
.
size
())
end_index
=
contents
.
size
();
const
SongLoader
loader
(
nullptr
,
nullptr
);
Error
error2
;
for
(
unsigned
i
=
start_index
;
i
<
end_index
;
++
i
)
{
const
auto
&
uri_utf8
=
contents
[
i
];
unsigned
id
=
playlist
.
AppendURI
(
pc
,
loader
,
uri_utf8
.
c_str
(),
error2
);
if
(
id
==
0
)
FormatError
(
error2
,
"can't add file
\"
%s
\"
"
,
uri_utf8
.
c_str
());
}
return
true
;
}
src/PlaylistSave.hxx
View file @
0adcda38
...
@@ -48,14 +48,4 @@ spl_save_queue(const char *name_utf8, const Queue &queue);
...
@@ -48,14 +48,4 @@ spl_save_queue(const char *name_utf8, const Queue &queue);
PlaylistResult
PlaylistResult
spl_save_playlist
(
const
char
*
name_utf8
,
const
playlist
&
playlist
);
spl_save_playlist
(
const
char
*
name_utf8
,
const
playlist
&
playlist
);
/**
* Loads a stored playlist file, and append all songs to the global
* playlist.
*/
bool
playlist_load_spl
(
struct
playlist
&
playlist
,
PlayerControl
&
pc
,
const
char
*
name_utf8
,
unsigned
start_index
,
unsigned
end_index
,
Error
&
error
);
#endif
#endif
src/command/PlaylistCommands.cxx
View file @
0adcda38
...
@@ -74,23 +74,7 @@ handle_load(Client &client, int argc, char *argv[])
...
@@ -74,23 +74,7 @@ handle_load(Client &client, int argc, char *argv[])
client
.
player_control
,
loader
,
error
))
client
.
player_control
,
loader
,
error
))
return
print_error
(
client
,
error
);
return
print_error
(
client
,
error
);
if
(
playlist_load_spl
(
client
.
playlist
,
client
.
player_control
,
argv
[
1
],
start_index
,
end_index
,
error
))
return
CommandResult
::
OK
;
return
CommandResult
::
OK
;
if
(
error
.
IsDomain
(
playlist_domain
)
&&
PlaylistResult
(
error
.
GetCode
())
==
PlaylistResult
::
BAD_NAME
)
{
/* the message for BAD_NAME is confusing when the
client wants to load a playlist file from the music
directory; patch the Error object to show "no such
playlist" instead */
Error
error2
(
playlist_domain
,
int
(
PlaylistResult
::
NO_SUCH_LIST
),
error
.
GetMessage
());
error
=
std
::
move
(
error2
);
}
return
print_error
(
client
,
error
);
}
}
CommandResult
CommandResult
...
...
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