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
b8d2ef87
Commit
b8d2ef87
authored
Jun 23, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update now ignores/recognizes recursive directories
git-svn-id:
https://svn.musicpd.org/mpd/trunk@1623
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
0083b073
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
4 deletions
+41
-4
directory.c
src/directory.c
+41
-4
No files found.
src/directory.c
View file @
b8d2ef87
...
...
@@ -126,6 +126,8 @@ void sortDirectory(Directory * directory);
int
inodeFoundInParent
(
Directory
*
parent
,
ino_t
inode
,
dev_t
device
);
int
statDirectory
(
Directory
*
dir
);
void
clearUpdatePid
()
{
directory_updatePid
=
0
;
}
...
...
@@ -345,7 +347,9 @@ int updateInDirectory(Directory * directory, char * shortname, char * name) {
}
else
if
(
S_ISDIR
(
st
.
st_mode
))
{
if
(
findInList
(
directory
->
subDirectories
,
shortname
,(
void
**
)
&
subDir
))
{
if
(
updateDirectory
((
Directory
*
)
subDir
)
>
0
)
return
1
;
freeDirectoryStatFromDirectory
(
subDir
);
((
Directory
*
)
subDir
)
->
stat
=
newDirectoryStat
(
&
st
);
return
updateDirectory
((
Directory
*
)
subDir
);
}
else
{
return
addSubDirectoryToDirectory
(
directory
,
shortname
,
...
...
@@ -523,8 +527,18 @@ int updatePath(char * utf8path) {
}
}
else
if
((
song
=
getSongDetails
(
path
,
&
shortname
,
&
parentDirectory
)))
{
if
(
!
parentDirectory
->
stat
&&
statDirectory
(
parentDirectory
)
<
0
)
{
free
(
path
);
return
0
;
}
/* if this song update is successfull, we are done */
if
(
song
&&
isMusic
(
song
->
utf8url
,
&
mtime
))
{
else
if
(
0
==
inodeFoundInParent
(
parentDirectory
->
parent
,
parentDirectory
->
stat
->
inode
,
parentDirectory
->
stat
->
device
)
&&
song
&&
isMusic
(
song
->
utf8url
,
&
mtime
))
{
free
(
path
);
if
(
song
->
mtime
==
mtime
)
return
0
;
else
if
(
updateSongInfo
(
song
)
==
0
)
return
1
;
...
...
@@ -548,7 +562,17 @@ int updatePath(char * utf8path) {
*/
if
(
isDir
(
path
)
||
isMusic
(
path
,
NULL
))
{
parentDirectory
=
addParentPathToDB
(
path
,
&
shortname
);
if
(
addToDirectory
(
parentDirectory
,
shortname
,
path
)
>
0
)
ret
=
1
;
if
(
!
parentDirectory
->
stat
&&
statDirectory
(
parentDirectory
)
<
0
)
{
}
else
if
(
inodeFoundInParent
(
parentDirectory
->
parent
,
parentDirectory
->
stat
->
inode
,
parentDirectory
->
stat
->
device
))
{
}
else
if
(
addToDirectory
(
parentDirectory
,
shortname
,
path
)
>
0
)
{
ret
=
1
;
}
}
free
(
path
);
...
...
@@ -570,6 +594,18 @@ int updateDirectory(Directory * directory) {
char
*
dirname
=
directory
->
utf8name
;
int
ret
=
0
;
{
if
(
!
directory
->
stat
&&
statDirectory
(
directory
)
<
0
)
{
return
-
1
;
}
else
if
(
inodeFoundInParent
(
directory
->
parent
,
directory
->
stat
->
inode
,
directory
->
stat
->
device
))
{
return
-
1
;
}
}
cwd
[
0
]
=
'.'
;
cwd
[
1
]
=
'\0'
;
if
(
dirname
==
NULL
)
dirname
=
cwd
;
...
...
@@ -672,6 +708,7 @@ int inodeFoundInParent(Directory * parent, ino_t inode, dev_t device) {
if
(
parent
->
stat
->
inode
==
inode
&&
parent
->
stat
->
device
==
device
)
{
DEBUG
(
"recursive directory found
\n
"
);
return
1
;
}
parent
=
parent
->
parent
;
...
...
@@ -1265,7 +1302,7 @@ void freeAllDirectoryStats(Directory * directory) {
ListNode
*
node
=
directory
->
subDirectories
->
firstNode
;
while
(
node
!=
NULL
)
{
freeAllDirectoryStats
(
directory
);
freeAllDirectoryStats
(
(
Directory
*
)
node
->
data
);
node
=
node
->
nextNode
;
}
...
...
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