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
d6b229e3
Commit
d6b229e3
authored
Jan 04, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: moved code to update_regular_file()
parent
8a562c9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
26 deletions
+35
-26
update.c
src/update.c
+35
-26
No files found.
src/update.c
View file @
d6b229e3
...
...
@@ -347,20 +347,11 @@ update_archive_tree(struct directory *directory, char *name)
}
#endif
static
bool
updateDirectory
(
struct
directory
*
directory
,
const
struct
stat
*
st
);
static
void
update
InDirectory
(
struct
directory
*
directory
,
const
char
*
name
,
const
struct
stat
*
st
)
update
_regular_file
(
struct
directory
*
directory
,
const
char
*
name
,
const
struct
stat
*
st
)
{
#ifdef ENABLE_ARCHIVE
const
struct
archive_plugin
*
archive
;
#endif
assert
(
strchr
(
name
,
'/'
)
==
NULL
);
if
(
S_ISREG
(
st
->
st_mode
)
&&
hasMusicSuffix
(
name
,
0
))
{
if
(
hasMusicSuffix
(
name
,
0
))
{
struct
song
*
song
=
songvec_find
(
&
directory
->
songs
,
name
);
if
(
song
==
NULL
)
{
...
...
@@ -379,21 +370,8 @@ updateInDirectory(struct directory *directory,
delete_song
(
directory
,
song
);
modified
=
true
;
}
}
else
if
(
S_ISDIR
(
st
->
st_mode
))
{
struct
directory
*
subdir
;
bool
ret
;
if
(
inodeFoundInParent
(
directory
,
st
->
st_ino
,
st
->
st_dev
))
return
;
subdir
=
make_subdir
(
directory
,
name
);
assert
(
directory
==
subdir
->
parent
);
ret
=
updateDirectory
(
subdir
,
st
);
if
(
!
ret
)
delete_directory
(
subdir
);
#ifdef ENABLE_ARCHIVE
}
else
if
(
S_ISREG
(
st
->
st_mode
)
&&
(
archive
=
get_archive_by_suffix
(
name
)))
{
}
else
if
((
archive
=
get_archive_by_suffix
(
name
)))
{
struct
archive_file
*
archfile
;
char
pathname
[
MPD_PATH_MAX
];
...
...
@@ -424,6 +402,37 @@ updateInDirectory(struct directory *directory,
g_warning
(
"unable to open archive %s"
,
pathname
);
}
#endif
}
}
static
bool
updateDirectory
(
struct
directory
*
directory
,
const
struct
stat
*
st
);
static
void
updateInDirectory
(
struct
directory
*
directory
,
const
char
*
name
,
const
struct
stat
*
st
)
{
#ifdef ENABLE_ARCHIVE
const
struct
archive_plugin
*
archive
;
#endif
assert
(
strchr
(
name
,
'/'
)
==
NULL
);
if
(
S_ISREG
(
st
->
st_mode
))
{
update_regular_file
(
directory
,
name
,
st
);
}
else
if
(
S_ISDIR
(
st
->
st_mode
))
{
struct
directory
*
subdir
;
bool
ret
;
if
(
inodeFoundInParent
(
directory
,
st
->
st_ino
,
st
->
st_dev
))
return
;
subdir
=
make_subdir
(
directory
,
name
);
assert
(
directory
==
subdir
->
parent
);
ret
=
updateDirectory
(
subdir
,
st
);
if
(
!
ret
)
delete_directory
(
subdir
);
}
else
{
g_debug
(
"update: %s is not a directory, archive or music"
,
name
);
}
...
...
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