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
2ba34012
Commit
2ba34012
authored
Feb 12, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update_walk: move code to update_song_file()
parent
1735284a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
update_walk.c
src/update_walk.c
+22
-17
No files found.
src/update_walk.c
View file @
2ba34012
...
...
@@ -567,19 +567,10 @@ directory_child_access(const struct directory *directory,
}
static
void
update_regular_file
(
struct
directory
*
directory
,
const
char
*
name
,
const
struct
stat
*
st
)
update_song_file
(
struct
directory
*
directory
,
const
char
*
name
,
const
struct
stat
*
st
,
const
struct
decoder_plugin
*
plugin
)
{
const
char
*
suffix
=
uri_get_suffix
(
name
);
const
struct
decoder_plugin
*
plugin
;
#ifdef ENABLE_ARCHIVE
const
struct
archive_plugin
*
archive
;
#endif
if
(
suffix
==
NULL
)
return
;
if
((
plugin
=
decoder_plugin_from_suffix
(
suffix
,
false
))
!=
NULL
)
{
db_lock
();
struct
song
*
song
=
directory_get_song
(
directory
,
name
);
db_unlock
();
...
...
@@ -598,10 +589,8 @@ update_regular_file(struct directory *directory,
if
(
!
(
song
!=
NULL
&&
st
->
st_mtime
==
song
->
mtime
&&
!
walk_discard
)
&&
plugin
->
container_scan
!=
NULL
)
{
if
(
update_container_file
(
directory
,
name
,
st
,
plugin
))
{
plugin
->
container_scan
!=
NULL
&&
update_container_file
(
directory
,
name
,
st
,
plugin
))
{
if
(
song
!=
NULL
)
{
db_lock
();
delete_song
(
directory
,
song
);
...
...
@@ -610,7 +599,6 @@ update_regular_file(struct directory *directory,
return
;
}
}
if
(
song
==
NULL
)
{
g_debug
(
"reading %s/%s"
,
...
...
@@ -639,6 +627,23 @@ update_regular_file(struct directory *directory,
modified
=
true
;
}
}
static
void
update_regular_file
(
struct
directory
*
directory
,
const
char
*
name
,
const
struct
stat
*
st
)
{
const
char
*
suffix
=
uri_get_suffix
(
name
);
const
struct
decoder_plugin
*
plugin
;
#ifdef ENABLE_ARCHIVE
const
struct
archive_plugin
*
archive
;
#endif
if
(
suffix
==
NULL
)
return
;
if
((
plugin
=
decoder_plugin_from_suffix
(
suffix
,
false
))
!=
NULL
)
{
update_song_file
(
directory
,
name
,
st
,
plugin
);
#ifdef ENABLE_ARCHIVE
}
else
if
((
archive
=
archive_plugin_from_suffix
(
suffix
)))
{
update_archive_file
(
directory
,
name
,
st
,
archive
);
...
...
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