diff options
author | 2009-07-21 19:53:59 +0200 | |
---|---|---|
committer | 2009-07-21 19:53:59 +0200 | |
commit | 7c15ded62c8b04ef39dd0dedb3d30b3bc6634114 (patch) | |
tree | dd43e044e8afd7483bf4a592ee01a9536f84e58a /playlist.c | |
parent | f64ea0fb7c04cf55b223bd7ae96f19b4aaf3f553 (diff) |
added handling of non-tagged files
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -537,8 +537,19 @@ ps_format_item_display_name (playItem_t *it) { snprintf (it->displayname, MAX_DISPLAY_NAME, "%s", title); } else { - //snprintf (it->displayname, MAX_DISPLAY_NAME, "%s", title); - strncpy (it->displayname, it->fname, MAX_DISPLAY_NAME); + // cut filename without path and extension + char *pext = it->fname + strlen (it->fname) - 1; + while (pext >= it->fname && *pext != '.') { + pext--; + } + char *pname = pext; + while (pname >= it->fname && *pname != '/') { + pname--; + } + if (*pname == '/') { + pname++; + } + strncpy (it->displayname, pname, pext-pname); } } |