ls: removed hasMusicSuffix() and get_archive_by_suffix()

Determine the suffix manually, and use decoder_plugin_from_suffix()
and archive_plugin_from_suffix() instead.

This way, song_file_update_inarchive() can be optimized: it does not
have to translate its path.
This commit is contained in:
Max Kellermann
2009-01-04 17:26:22 +01:00
parent d6b229e35c
commit ff72fff68d
4 changed files with 39 additions and 59 deletions
-35
View File
@@ -19,8 +19,6 @@
#include "ls.h"
#include "client.h"
#include "config.h"
#include "decoder_list.h"
#include "archive_list.h"
#include <string.h>
@@ -66,36 +64,3 @@ const char *getSuffix(const char *utf8file)
return dot != NULL ? dot + 1 : NULL;
}
const struct decoder_plugin *
hasMusicSuffix(const char *utf8file, unsigned int next)
{
const struct decoder_plugin *ret = NULL;
const char *s = getSuffix(utf8file);
if (s) {
ret = decoder_plugin_from_suffix(s, next);
} else {
g_debug("hasMusicSuffix: The file: %s has no valid suffix\n",
utf8file);
}
return ret;
}
#ifdef ENABLE_ARCHIVE
const struct archive_plugin *
get_archive_by_suffix(const char *utf8file)
{
const struct archive_plugin *ret = NULL;
const char *s = getSuffix(utf8file);
if (s) {
ret = archive_plugin_from_suffix(s);
} else {
g_debug("get_archive_by_suffix: The file: %s has no valid suffix\n",
utf8file);
}
return ret;
}
#endif