From: Richard Kettlewell Date: Sat, 18 Oct 2008 13:01:38 +0000 (+0100) Subject: Assume initial digits in a track name are a sort key even without the X-Git-Tag: 4.3~70 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/bcf50f5c54870759e531a239400a47b64d22e554 Assume initial digits in a track name are a sort key even without the punctuation hints we've previously relied on. This plays better with the default filenames iTunes chooses. --- diff --git a/lib/configuration.c b/lib/configuration.c index 540084c..28bf8e9 100644 --- a/lib/configuration.c +++ b/lib/configuration.c @@ -1248,7 +1248,7 @@ static void config_postdefaults(struct config *c, int n; static const char *namepart[][4] = { - { "title", "/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$", "$2", "display" }, + { "title", "/([0-9]+ *[-:]? *)?([^/]+)\\.[a-zA-Z0-9]+$", "$2", "display" }, { "title", "/([^/]+)\\.[a-zA-Z0-9]+$", "$1", "sort" }, { "album", "/([^/]+)/[^/]+$", "$1", "*" }, { "artist", "/([^/]+)/[^/]+/[^/]+$", "$1", "*" }, @@ -1257,7 +1257,7 @@ static void config_postdefaults(struct config *c, #define NNAMEPART (int)(sizeof namepart / sizeof *namepart) static const char *transform[][5] = { - { "track", "^.*/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$", "$2", "display", "" }, + { "track", "^.*/([0-9]+ *[-:]? *)?([^/]+)\\.[a-zA-Z0-9]+$", "$2", "display", "" }, { "track", "^.*/([^/]+)\\.[a-zA-Z0-9]+$", "$1", "sort", "" }, { "dir", "^.*/([^/]+)$", "$1", "*", "" }, { "dir", "^(the) ([^/]*)", "$2, $1", "sort", "i", },