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
660e40d0
Commit
660e40d0
authored
Jun 13, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update_walk: split update_regular_file()
parent
9f3db5a7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
16 deletions
+53
-16
update_walk.c
src/update_walk.c
+53
-16
No files found.
src/update_walk.c
View file @
660e40d0
...
@@ -465,33 +465,70 @@ update_song_file(struct directory *directory,
...
@@ -465,33 +465,70 @@ update_song_file(struct directory *directory,
}
}
}
}
static
void
static
bool
update_regular_file
(
struct
directory
*
directory
,
update_song_file2
(
struct
directory
*
directory
,
const
char
*
name
,
const
struct
stat
*
st
)
const
char
*
name
,
const
char
*
suffix
,
const
struct
stat
*
st
)
{
{
const
char
*
suffix
=
uri_get_suffix
(
name
);
const
struct
decoder_plugin
*
plugin
=
const
struct
decoder_plugin
*
plugin
;
decoder_plugin_from_suffix
(
suffix
,
false
);
#ifdef ENABLE_ARCHIVE
if
(
plugin
==
NULL
)
const
struct
archive_plugin
*
archive
;
return
false
;
#endif
if
(
suffix
==
NULL
)
return
;
if
((
plugin
=
decoder_plugin_from_suffix
(
suffix
,
false
))
!=
NULL
)
{
update_song_file
(
directory
,
name
,
st
,
plugin
);
update_song_file
(
directory
,
name
,
st
,
plugin
);
return
true
;
}
static
bool
update_archive_file2
(
struct
directory
*
directory
,
const
char
*
name
,
const
char
*
suffix
,
const
struct
stat
*
st
)
{
#ifdef ENABLE_ARCHIVE
#ifdef ENABLE_ARCHIVE
}
else
if
((
archive
=
archive_plugin_from_suffix
(
suffix
)))
{
const
struct
archive_plugin
*
plugin
=
update_archive_file
(
directory
,
name
,
st
,
archive
);
archive_plugin_from_suffix
(
suffix
);
if
(
plugin
==
NULL
)
return
false
;
update_archive_file
(
directory
,
name
,
st
,
plugin
);
return
true
;
#else
(
void
)
directory
;
(
void
)
name
;
(
void
)
suffix
;
(
void
)
st
;
return
false
;
#endif
#endif
}
static
bool
update_playlist_file2
(
struct
directory
*
directory
,
const
char
*
name
,
const
char
*
suffix
,
const
struct
stat
*
st
)
{
if
(
!
playlist_suffix_supported
(
suffix
))
return
false
;
}
else
if
(
playlist_suffix_supported
(
suffix
))
{
db_lock
();
db_lock
();
if
(
playlist_vector_update_or_add
(
&
directory
->
playlists
,
name
,
if
(
playlist_vector_update_or_add
(
&
directory
->
playlists
,
name
,
st
->
st_mtime
))
st
->
st_mtime
))
modified
=
true
;
modified
=
true
;
db_unlock
();
db_unlock
();
}
return
true
;
}
static
bool
update_regular_file
(
struct
directory
*
directory
,
const
char
*
name
,
const
struct
stat
*
st
)
{
const
char
*
suffix
=
uri_get_suffix
(
name
);
if
(
suffix
==
NULL
)
return
false
;
return
update_song_file2
(
directory
,
name
,
suffix
,
st
)
||
update_archive_file2
(
directory
,
name
,
suffix
,
st
)
||
update_playlist_file2
(
directory
,
name
,
suffix
,
st
);
}
}
static
bool
static
bool
...
...
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