mirror of
https://github.com/simon987/sist2.git
synced 2025-04-19 10:16:42 +00:00
Fix for unknown mime inside archives
This commit is contained in:
parent
3058c55510
commit
449aa77c8f
@ -429,4 +429,4 @@ video/x-qtc, qtc
|
|||||||
video/x-sgi-movie, movie|mv
|
video/x-sgi-movie, movie|mv
|
||||||
x-epoc/x-sisx-app,
|
x-epoc/x-sisx-app,
|
||||||
application/x-zstd-dictionary,
|
application/x-zstd-dictionary,
|
||||||
application/vnd.ms-outlook,
|
application/vnd.ms-outlook, msg
|
||||||
|
|
@ -1388,6 +1388,7 @@ g_hash_table_insert(ext_table, "divx", (gpointer)video_x_msvideo);
|
|||||||
g_hash_table_insert(ext_table, "qtc", (gpointer)video_x_qtc);
|
g_hash_table_insert(ext_table, "qtc", (gpointer)video_x_qtc);
|
||||||
g_hash_table_insert(ext_table, "movie", (gpointer)video_x_sgi_movie);
|
g_hash_table_insert(ext_table, "movie", (gpointer)video_x_sgi_movie);
|
||||||
g_hash_table_insert(ext_table, "mv", (gpointer)video_x_sgi_movie);
|
g_hash_table_insert(ext_table, "mv", (gpointer)video_x_sgi_movie);
|
||||||
|
g_hash_table_insert(ext_table, "msg", (gpointer)application_vnd_ms_outlook);
|
||||||
return ext_table;}
|
return ext_table;}
|
||||||
GHashTable *mime_get_mime_table() {GHashTable *mime_table = g_hash_table_new(g_str_hash, g_str_equal);
|
GHashTable *mime_get_mime_table() {GHashTable *mime_table = g_hash_table_new(g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert(mime_table, "application/arj", (gpointer)application_arj);
|
g_hash_table_insert(mime_table, "application/arj", (gpointer)application_arj);
|
||||||
|
@ -79,9 +79,8 @@ void parse(void *arg) {
|
|||||||
if (doc.mime == 0 && !ScanCtx.fast) {
|
if (doc.mime == 0 && !ScanCtx.fast) {
|
||||||
// Get mime type with libmagic
|
// Get mime type with libmagic
|
||||||
if (!job->vfile.is_fs_file) {
|
if (!job->vfile.is_fs_file) {
|
||||||
LOG_WARNING(job->filepath,
|
LOG_WARNING(job->filepath, "Guessing mime type with libmagic inside archive files is not currently supported");
|
||||||
"Guessing mime type with libmagic inside archive files is not currently supported");
|
goto abort;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes_read = job->vfile.read(&job->vfile, buf, MAGIC_BUF_SIZE);
|
bytes_read = job->vfile.read(&job->vfile, buf, MAGIC_BUF_SIZE);
|
||||||
@ -153,14 +152,13 @@ void parse(void *arg) {
|
|||||||
parse_mobi(&ScanCtx.mobi_ctx, &job->vfile, &doc);
|
parse_mobi(&ScanCtx.mobi_ctx, &job->vfile, &doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abort:
|
||||||
|
|
||||||
//Parent meta
|
//Parent meta
|
||||||
if (!uuid_is_null(job->parent)) {
|
if (!uuid_is_null(job->parent)) {
|
||||||
char tmp[UUID_STR_LEN];
|
|
||||||
uuid_unparse(job->parent, tmp);
|
|
||||||
|
|
||||||
meta_line_t *meta_parent = malloc(sizeof(meta_line_t) + UUID_STR_LEN + 1);
|
meta_line_t *meta_parent = malloc(sizeof(meta_line_t) + UUID_STR_LEN + 1);
|
||||||
meta_parent->key = MetaParent;
|
meta_parent->key = MetaParent;
|
||||||
strcpy(meta_parent->str_val, tmp);
|
uuid_unparse(job->parent, meta_parent->str_val);
|
||||||
APPEND_META((&doc), meta_parent)
|
APPEND_META((&doc), meta_parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user