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
cf38505d
Commit
cf38505d
authored
Dec 26, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playlist_queue: load playlists from music directory
Try the playlist directory first, and if that file does not exist, try the same relative path within the music directory.
parent
af964e89
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
3 deletions
+35
-3
playlist_queue.c
src/playlist_queue.c
+35
-3
No files found.
src/playlist_queue.c
View file @
cf38505d
...
@@ -122,6 +122,9 @@ playlist_open_path_into_queue(const char *path_fs, struct playlist *dest)
...
@@ -122,6 +122,9 @@ playlist_open_path_into_queue(const char *path_fs, struct playlist *dest)
return
result
;
return
result
;
}
}
/**
* Load a playlist from the configured playlist directory.
*/
static
enum
playlist_result
static
enum
playlist_result
playlist_open_local_into_queue
(
const
char
*
uri
,
struct
playlist
*
dest
)
playlist_open_local_into_queue
(
const
char
*
uri
,
struct
playlist
*
dest
)
{
{
...
@@ -142,13 +145,42 @@ playlist_open_local_into_queue(const char *uri, struct playlist *dest)
...
@@ -142,13 +145,42 @@ playlist_open_local_into_queue(const char *uri, struct playlist *dest)
return
result
;
return
result
;
}
}
/**
* Load a playlist from the configured music directory.
*/
static
enum
playlist_result
playlist_open_local_into_queue2
(
const
char
*
uri
,
struct
playlist
*
dest
)
{
char
*
path_fs
;
enum
playlist_result
result
;
assert
(
uri_safe_local
(
uri
));
path_fs
=
map_uri_fs
(
uri
);
if
(
path_fs
==
NULL
)
return
PLAYLIST_RESULT_NO_SUCH_LIST
;
result
=
playlist_open_path_into_queue
(
path_fs
,
dest
);
g_free
(
path_fs
);
return
result
;
}
enum
playlist_result
enum
playlist_result
playlist_open_into_queue
(
const
char
*
uri
,
struct
playlist
*
dest
)
playlist_open_into_queue
(
const
char
*
uri
,
struct
playlist
*
dest
)
{
{
if
(
uri_has_scheme
(
uri
))
if
(
uri_has_scheme
(
uri
))
return
playlist_open_remote_into_queue
(
uri
,
dest
);
return
playlist_open_remote_into_queue
(
uri
,
dest
);
else
if
(
spl_valid_name
(
uri
))
return
playlist_open_local_into_queue
(
uri
,
dest
);
if
(
spl_valid_name
(
uri
))
{
else
enum
playlist_result
result
=
playlist_open_local_into_queue
(
uri
,
dest
);
if
(
result
!=
PLAYLIST_RESULT_NO_SUCH_LIST
)
return
result
;
}
if
(
uri_safe_local
(
uri
))
return
playlist_open_local_into_queue2
(
uri
,
dest
);
return
PLAYLIST_RESULT_NO_SUCH_LIST
;
return
PLAYLIST_RESULT_NO_SUCH_LIST
;
}
}
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