~mdw
/
disorder
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Shorter confirmation URLs. 'confirm=' becomes 'c=' and the
[disorder]
/
server
/
rescan.c
diff --git
a/server/rescan.c
b/server/rescan.c
index
890e3fe
..
dab56df
100644
(file)
--- a/
server/rescan.c
+++ b/
server/rescan.c
@@
-47,9
+47,11
@@
#include "wstat.h"
#include "kvp.h"
#include "printf.h"
#include "wstat.h"
#include "kvp.h"
#include "printf.h"
+#include "rights.h"
#include "trackdb.h"
#include "trackdb-int.h"
#include "trackname.h"
#include "trackdb.h"
#include "trackdb-int.h"
#include "trackname.h"
+#include "unicode.h"
static DB_TXN *global_tid;
static DB_TXN *global_tid;
@@
-83,7
+85,7
@@
static void help(void) {
/* display version number and terminate */
static void version(void) {
/* display version number and terminate */
static void version(void) {
- xprintf("
disorder-rescan version %s\n
", disorder_version_string);
+ xprintf("
%s
", disorder_version_string);
xfclose(stdout);
exit(0);
}
xfclose(stdout);
exit(0);
}
@@
-151,6
+153,13
@@
static void rescan_collection(const struct collection *c) {
error(0, "cannot convert track path to UTF-8: %s", path);
continue;
}
error(0, "cannot convert track path to UTF-8: %s", path);
continue;
}
+ if(config->dbversion > 1) {
+ /* We use NFC track names */
+ if(!(track = utf8_compose_canon(track, strlen(track), 0))) {
+ error(0, "cannot convert track path to NFC: %s", path);
+ continue;
+ }
+ }
D(("track %s", track));
/* only tracks with a known player are admitted */
for(n = 0; (n < config->player.n
D(("track %s", track));
/* only tracks with a known player are admitted */
for(n = 0; (n < config->player.n
@@
-353,8
+362,8
@@
int main(int argc, char **argv) {
xsigaction(SIGTERM, &sa, 0);
xsigaction(SIGINT, &sa, 0);
info("started");
xsigaction(SIGTERM, &sa, 0);
xsigaction(SIGINT, &sa, 0);
info("started");
- trackdb_init(
0
);
- trackdb_open();
+ trackdb_init(
TRACKDB_NO_RECOVER
);
+ trackdb_open(
TRACKDB_NO_UPGRADE
);
if(optind == argc) {
/* Rescan all collections */
do_all(rescan_collection);
if(optind == argc) {
/* Rescan all collections */
do_all(rescan_collection);