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
c4d2b8dc
Commit
c4d2b8dc
authored
Apr 16, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
only write db in initMp3Directory() when stuff is updated
git-svn-id:
https://svn.musicpd.org/mpd/trunk@781
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
2e420db1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
directory.c
src/directory.c
+13
-7
No files found.
src/directory.c
View file @
c4d2b8dc
...
...
@@ -63,6 +63,10 @@
#define DIRECTORY_UPDATE_EXIT_UPDATE 1
#define DIRECTORY_UPDATE_EXIT_ERROR 2
#define DIRECTORY_RETURN_NOUPDATE 0
#define DIRECTORY_RETURN_UPDATE 1
#define DIRECTORY_RETURN_ERROR -1
typedef
List
DirectoryList
;
typedef
struct
_Directory
{
...
...
@@ -309,7 +313,7 @@ int updateInDirectory(Directory * directory, char * shortname, char * name) {
if
(
isMusic
(
name
,
&
mtime
))
{
if
(
0
==
findInList
(
directory
->
songs
,
shortname
,
&
song
))
{
addToDirectory
(
directory
,
shortname
,
name
);
return
1
;
return
DIRECTORY_RETURN_UPDATE
;
}
else
if
(
mtime
!=
((
Song
*
)
song
)
->
mtime
)
{
LOG
(
"updating %s
\n
"
,
name
);
...
...
@@ -960,13 +964,15 @@ int readDirectoryDB() {
return
0
;
}
/* return values:
-1 -> error
0 -> no error, but nothing updated
1 -> no error, and stuff updated
*/
int
updateMp3Directory
(
FILE
*
fp
)
{
if
(
updateDirectory
(
mp3rootDirectory
)
<
0
)
{
switch
(
updateDirectory
(
mp3rootDirectory
))
{
case
0
:
/* nothing updated */
return
0
;
case
1
:
/* something was updated and db should be written */
break
;
default:
ERROR
(
"problems updating music db
\n
"
);
myfprintf
(
fp
,
"%s problems updating music db
\n
"
,
COMMAND_RESPOND_ERROR
);
return
-
1
;
...
...
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