diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-04-06 14:32:31 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-04-06 14:32:31 +0200 |
commit | e41f4453e2c5311a0534643c4eeddfc4bb56dfe9 (patch) | |
tree | 273d6f7b7cd98d131e6f1a19de8967fc5dd46499 /plugins/artwork/artwork.c | |
parent | bdc72d79ac75d88aedff946c778153492dadf471 (diff) |
added is_local_file routine to plugin API
Diffstat (limited to 'plugins/artwork/artwork.c')
-rw-r--r-- | plugins/artwork/artwork.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index ef0c9113..aa4fc64e 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -211,20 +211,6 @@ filter_jpg (const struct dirent *f) return 0; } -static int -is_local_file (const char *fname) { - if (!strncasecmp (fname, "file://", 7)) { - return 1; - } - for (; *fname; fname++) { - if (!strncmp (fname, "://", 3)) { - return 0; - } - } - - return 1; -} - static uint8_t * id3v2_skip_str (int enc, uint8_t *ptr, uint8_t *end) { if (enc == 0 || enc == 3) { @@ -276,7 +262,7 @@ fetcher_thread (void *none) trace ("fetching cover for %s %s\n", param->album, param->artist); // try to load embedded from id3v2 - if (is_local_file (param->fname)) { + if (deadbeef->is_local_file (param->fname)) { if (deadbeef->conf_get_int ("artwork.enable_embedded", 1)) { trace ("trying to load artwork from id3v2 tag for %s\n", param->fname); DB_id3v2_tag_t tag; @@ -461,7 +447,7 @@ get_album_art (const char *fname, const char *artist, const char *album, artwork return strdup (DEFAULT_COVER_PATH); } - if (!is_local_file (fname)) { + if (!deadbeef->is_local_file (fname)) { return strdup (DEFAULT_COVER_PATH); } |