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
628866a0
Commit
628866a0
authored
Jan 08, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: save the database even if it is empty
Save an empty database, even if the music directory is empty.
parent
bb08679a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
database.h
src/database.h
+11
-0
update.c
src/update.c
+2
-1
No files found.
src/database.h
View file @
628866a0
...
@@ -69,4 +69,15 @@ db_load(void);
...
@@ -69,4 +69,15 @@ db_load(void);
time_t
time_t
db_get_mtime
(
void
);
db_get_mtime
(
void
);
/**
* Returns true if there is a valid database file on the disk.
*/
static
inline
bool
db_exists
(
void
)
{
/* mtime is set only if the database file was loaded or saved
successfully */
return
db_get_mtime
()
>
0
;
}
#endif
#endif
src/update.c
View file @
628866a0
...
@@ -647,8 +647,9 @@ static void * update_task(void *_path)
...
@@ -647,8 +647,9 @@ static void * update_task(void *_path)
updateDirectory
(
directory
,
&
st
);
updateDirectory
(
directory
,
&
st
);
}
}
if
(
modified
)
if
(
modified
||
!
db_exists
()
)
db_save
();
db_save
();
progress
=
UPDATE_PROGRESS_DONE
;
progress
=
UPDATE_PROGRESS_DONE
;
event_pipe_emit
(
PIPE_EVENT_UPDATE
);
event_pipe_emit
(
PIPE_EVENT_UPDATE
);
return
NULL
;
return
NULL
;
...
...
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