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
455b39fa
Commit
455b39fa
authored
Dec 16, 2008
by
Viliam Mateicka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
song: adding support for songs in archives
parent
4d604a75
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
1 deletion
+39
-1
directory.h
src/directory.h
+2
-0
song.c
src/song.c
+34
-1
song.h
src/song.h
+3
-0
No files found.
src/directory.h
View file @
455b39fa
...
...
@@ -34,6 +34,8 @@
#define DIRECTORY_MPD_VERSION "mpd_version: "
#define DIRECTORY_FS_CHARSET "fs_charset: "
#define DEVICE_INARCHIVE (unsigned)(-1)
struct
directory
{
struct
dirvec
children
;
struct
songvec
songs
;
...
...
src/song.c
View file @
455b39fa
...
...
@@ -74,7 +74,12 @@ song_file_load(const char *path, struct directory *parent)
song
=
song_file_new
(
path
,
parent
);
ret
=
song_file_update
(
song
);
//in archive ?
if
(
parent
->
device
==
DEVICE_INARCHIVE
)
{
ret
=
song_file_update_inarchive
(
song
);
}
else
{
ret
=
song_file_update
(
song
);
}
if
(
!
ret
)
{
song_free
(
song
);
return
NULL
;
...
...
@@ -123,6 +128,34 @@ song_file_update(struct song *song)
return
song
->
tag
!=
NULL
;
}
bool
song_file_update_inarchive
(
struct
song
*
song
)
{
char
buffer
[
MPD_PATH_MAX
];
const
char
*
path_fs
;
const
struct
decoder_plugin
*
plugin
;
assert
(
song_is_file
(
song
));
path_fs
=
map_song_fs
(
song
,
buffer
);
if
(
path_fs
==
NULL
)
return
false
;
if
(
song
->
tag
!=
NULL
)
{
tag_free
(
song
->
tag
);
song
->
tag
=
NULL
;
}
//accept every file that has music suffix
//because we dont support tag reading throught
//input streams
plugin
=
hasMusicSuffix
(
path_fs
,
0
);
if
(
plugin
)
{
song
->
tag
=
tag_new
();
//tag_add_item(tag, TAG_ITEM_TITLE, f->title);
}
return
song
->
tag
!=
NULL
;
}
char
*
song_get_url
(
const
struct
song
*
song
,
char
*
path_max_tmp
)
{
...
...
src/song.h
View file @
455b39fa
...
...
@@ -58,6 +58,9 @@ song_free(struct song *song);
bool
song_file_update
(
struct
song
*
song
);
bool
song_file_update_inarchive
(
struct
song
*
song
);
/*
* song_get_url - Returns a path of a song in UTF8-encoded form
* path_max_tmp is the argument that the URL is written to, this
...
...
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