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
b9c248e7
Commit
b9c248e7
authored
Feb 03, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PlaylistFile: use class SongLoader
parent
d533b59e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
20 deletions
+12
-20
NEWS
NEWS
+1
-0
PlaylistFile.cxx
src/PlaylistFile.cxx
+5
-12
PlaylistFile.hxx
src/PlaylistFile.hxx
+4
-1
PlaylistCommands.cxx
src/command/PlaylistCommands.cxx
+2
-7
No files found.
NEWS
View file @
b9c248e7
...
...
@@ -3,6 +3,7 @@ ver 0.19 (not yet released)
- new commands "addtagid", "cleartagid"
- "lsinfo" and "readcomments" allowed for remote files
- "listneighbors" lists file servers on the local network
- "playlistadd" supports file:///
* database
- proxy: forward "idle" events
- proxy: copy "Last-Modified" from remote directories
...
...
src/PlaylistFile.cxx
View file @
b9c248e7
...
...
@@ -22,8 +22,8 @@
#include "PlaylistSave.hxx"
#include "db/PlaylistInfo.hxx"
#include "db/PlaylistVector.hxx"
#include "db/DatabaseSong.hxx"
#include "DetachedSong.hxx"
#include "SongLoader.hxx"
#include "Mapper.hxx"
#include "fs/TextFile.hxx"
#include "config/ConfigGlobal.hxx"
...
...
@@ -402,24 +402,17 @@ spl_append_song(const char *utf8path, const DetachedSong &song, Error &error)
}
bool
spl_append_uri
(
const
char
*
utf8file
,
const
char
*
url
,
Error
&
error
)
spl_append_uri
(
const
char
*
utf8file
,
const
SongLoader
&
loader
,
const
char
*
url
,
Error
&
error
)
{
if
(
uri_has_scheme
(
url
))
{
return
spl_append_song
(
utf8file
,
DetachedSong
(
url
),
error
);
}
else
{
#ifdef ENABLE_DATABASE
DetachedSong
*
song
=
DatabaseDetachSong
(
url
,
error
);
DetachedSong
*
song
=
loader
.
LoadSong
(
url
,
error
);
if
(
song
==
nullptr
)
return
false
;
bool
success
=
spl_append_song
(
utf8file
,
*
song
,
error
);
delete
song
;
return
success
;
#else
return
false
;
#endif
}
}
static
bool
...
...
src/PlaylistFile.hxx
View file @
b9c248e7
...
...
@@ -24,6 +24,7 @@
#include <string>
class
DetachedSong
;
class
SongLoader
;
class
PlaylistVector
;
class
Error
;
...
...
@@ -71,7 +72,9 @@ bool
spl_append_song
(
const
char
*
utf8path
,
const
DetachedSong
&
song
,
Error
&
error
);
bool
spl_append_uri
(
const
char
*
path_utf8
,
const
char
*
uri_utf8
,
Error
&
error
);
spl_append_uri
(
const
char
*
path_utf8
,
const
SongLoader
&
loader
,
const
char
*
uri_utf8
,
Error
&
error
);
bool
spl_rename
(
const
char
*
utf8from
,
const
char
*
utf8to
,
Error
&
error
);
...
...
src/command/PlaylistCommands.cxx
View file @
b9c248e7
...
...
@@ -188,13 +188,8 @@ handle_playlistadd(Client &client, gcc_unused int argc, char *argv[])
bool
success
;
Error
error
;
if
(
uri_has_scheme
(
uri
))
{
if
(
!
uri_supported_scheme
(
uri
))
{
command_error
(
client
,
ACK_ERROR_NO_EXIST
,
"unsupported URI scheme"
);
return
CommandResult
::
ERROR
;
}
success
=
spl_append_uri
(
playlist
,
uri
,
error
);
const
SongLoader
loader
(
client
);
success
=
spl_append_uri
(
playlist
,
loader
,
uri
,
error
);
}
else
{
#ifdef ENABLE_DATABASE
success
=
search_add_to_playlist
(
uri
,
playlist
,
nullptr
,
...
...
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