summaryrefslogtreecommitdiff
path: root/apps/recorder/albumart.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/recorder/albumart.c')
-rw-r--r--apps/recorder/albumart.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c
index d99280ce85..6aaf3885d7 100644
--- a/apps/recorder/albumart.c
+++ b/apps/recorder/albumart.c
@@ -26,6 +26,7 @@
26#include "buffering.h" 26#include "buffering.h"
27#include "dircache.h" 27#include "dircache.h"
28#include "debug.h" 28#include "debug.h"
29#include "misc.h"
29 30
30 31
31/* Strip filename from a full path 32/* Strip filename from a full path
@@ -89,26 +90,6 @@ static char* strip_extension(char* buf, int buf_size, const char* file)
89 return buf; 90 return buf;
90} 91}
91 92
92/* Test file existence, using dircache of possible */
93static bool file_exists(const char *file)
94{
95 int fd;
96
97 if (!file || strlen(file) <= 0)
98 return false;
99
100#ifdef HAVE_DIRCACHE
101 if (dircache_is_enabled())
102 return (dircache_get_entry_ptr(file) != NULL);
103#endif
104
105 fd = open(file, O_RDONLY);
106 if (fd < 0)
107 return false;
108 close(fd);
109 return true;
110}
111
112/* Make sure part of path only contain chars valid for a FAT32 long name. 93/* Make sure part of path only contain chars valid for a FAT32 long name.
113 * Double quotes are replaced with single quotes, other unsupported chars 94 * Double quotes are replaced with single quotes, other unsupported chars
114 * are replaced with an underscore. 95 * are replaced with an underscore.