Compare commits

...

3 Commits

Author SHA1 Message Date
152d2ddf8a bug fix in deserialize 2019-11-08 09:03:44 -05:00
bc5f22b759 update readme 2019-11-05 18:59:00 -05:00
534b397876 update readme, UI tweak: don't show broken images 2019-11-03 10:39:02 -05:00
5 changed files with 23 additions and 14 deletions

View File

@@ -9,7 +9,7 @@ sist2 (Simple incremental search tool)
## Features ## Features
* Fast, low memory usage * Fast, low memory usage, multi-threaded
* Portable (all its features are packaged in a single executable) * Portable (all its features are packaged in a single executable)
* Extracts text from common file types\* * Extracts text from common file types\*
* Generates thumbnails\* * Generates thumbnails\*
@@ -57,9 +57,9 @@ sist2 web --bind 0.0.0.0 --port 4321 ./my_idx1 ./my_idx2 ./my_idx3
File type | Library | Content | Thumbnail | Metadata File type | Library | Content | Thumbnail | Metadata
:---|:---|:---|:---|:--- :---|:---|:---|:---|:---
pdf,xps,cbz,cbr,fb2,epub | MuPDF | yes | yes, `png` | title | pdf,xps,cbz,cbr,fb2,epub | MuPDF | yes | yes, `png` | title |
`audio/*` | libav | - | yes, `jpeg` | ID3 tags | `audio/*` | ffmpeg | - | yes, `jpeg` | ID3 tags |
`video/*` | libav | - | yes, `jpeg` | title, comment | `video/*` | ffmpeg | - | yes, `jpeg` | title, comment |
`image/*` | libav | - | yes, `jpeg` | *planned* | `image/*` | ffmpeg | - | yes, `jpeg` | *planned* |
ttf,ttc,cff,woff,fnt,otf | Freetype2 | - | yes, `bmp` | Name & style | ttf,ttc,cff,woff,fnt,otf | Freetype2 | - | yes, `bmp` | Name & style |
`text/plain` | *(none)* | yes | no | - | `text/plain` | *(none)* | yes | no | - |
docx, xlsx, pptx | | *planned* | no | *planned* | docx, xlsx, pptx | | *planned* | no | *planned* |
@@ -79,11 +79,12 @@ binaries.
apt install git cmake pkg-config libglib2.0-dev\ apt install git cmake pkg-config libglib2.0-dev\
libssl-dev uuid-dev libavformat-dev libswscale-dev \ libssl-dev uuid-dev libavformat-dev libswscale-dev \
python3 libmagic-dev libfreetype6-dev libcurl-dev \ python3 libmagic-dev libfreetype6-dev libcurl-dev \
libbz2-dev yasm libbz2-dev yasm libharfbuzz-dev
``` ```
*(FreeBSD)* *(FreeBSD)*
```bash ```bash
pkg install cmake gcc yasm gmake bash ffmpeg e2fsprogs-uuid pkg install cmake gcc yasm gmake bash ffmpeg e2fsprogs-uuid\
autotools ragel
``` ```
2. Build 2. Build

View File

@@ -66,7 +66,7 @@ index_descriptor_t read_index_descriptor(char *path) {
strcpy(descriptor.root, cJSON_GetObjectItem(json, "root")->valuestring); strcpy(descriptor.root, cJSON_GetObjectItem(json, "root")->valuestring);
strcpy(descriptor.name, cJSON_GetObjectItem(json, "name")->valuestring); strcpy(descriptor.name, cJSON_GetObjectItem(json, "name")->valuestring);
strcpy(descriptor.rewrite_url, cJSON_GetObjectItem(json, "rewrite_url")->valuestring); strcpy(descriptor.rewrite_url, cJSON_GetObjectItem(json, "rewrite_url")->valuestring);
descriptor.root_len = (short)strlen(descriptor.root); descriptor.root_len = (short) strlen(descriptor.root);
strcpy(descriptor.version, cJSON_GetObjectItem(json, "version")->valuestring); strcpy(descriptor.version, cJSON_GetObjectItem(json, "version")->valuestring);
strcpy(descriptor.uuid, cJSON_GetObjectItem(json, "uuid")->valuestring); strcpy(descriptor.uuid, cJSON_GetObjectItem(json, "uuid")->valuestring);
@@ -181,7 +181,7 @@ void read_index(const char *path, const char index_id[UUID_STR_LEN], index_func
uuid_unparse(line.uuid, uuid_str); uuid_unparse(line.uuid, uuid_str);
cJSON_AddStringToObject(document, "mime", mime_get_mime_text(line.mime)); cJSON_AddStringToObject(document, "mime", mime_get_mime_text(line.mime));
cJSON_AddNumberToObject(document, "size", (double)line.size); cJSON_AddNumberToObject(document, "size", (double) line.size);
cJSON_AddNumberToObject(document, "mtime", line.mtime); cJSON_AddNumberToObject(document, "mtime", line.mtime);
int c; int c;
@@ -208,14 +208,19 @@ void read_index(const char *path, const char index_id[UUID_STR_LEN], index_func
while (key != '\n') { while (key != '\n') {
switch (key) { switch (key) {
case MetaWidth: case MetaWidth:
case MetaHeight: case MetaHeight: {
case MetaMediaDuration:
case MetaMediaBitrate: {
int value; int value;
fread(&value, sizeof(int), 1, file); fread(&value, sizeof(int), 1, file);
cJSON_AddNumberToObject(document, get_meta_key_text(key), value); cJSON_AddNumberToObject(document, get_meta_key_text(key), value);
break; break;
} }
case MetaMediaDuration:
case MetaMediaBitrate: {
long value;
fread(&value, sizeof(long), 1, file);
cJSON_AddNumberToObject(document, get_meta_key_text(key), value);
break;
}
case MetaMediaAudioCodec: case MetaMediaAudioCodec:
case MetaMediaVideoCodec: { case MetaMediaVideoCodec: {
int value; int value;
@@ -245,7 +250,7 @@ void read_index(const char *path, const char index_id[UUID_STR_LEN], index_func
break; break;
} }
default: default:
fprintf(stderr, "Invalid meta key (corrupt index): %x", key); fprintf(stderr, "Invalid meta key (corrupt index): %x\n", key);
break; break;
} }

View File

@@ -10,7 +10,7 @@
#define EPILOG "Made by simon987 <me@simon987.net>. Released under GPL-3.0" #define EPILOG "Made by simon987 <me@simon987.net>. Released under GPL-3.0"
static const char *const Version = "1.1.0"; static const char *const Version = "1.1.1";
static const char *const usage[] = { static const char *const usage[] = {
"sist2 scan [OPTION]... PATH", "sist2 scan [OPTION]... PATH",
"sist2 index [OPTION]... INDEX", "sist2 index [OPTION]... INDEX",

File diff suppressed because one or more lines are too long

View File

@@ -136,6 +136,9 @@ function createDocCard(hit) {
thumbnail = document.createElement("img"); thumbnail = document.createElement("img");
thumbnail.setAttribute("class", "card-img-top fit"); thumbnail.setAttribute("class", "card-img-top fit");
thumbnail.setAttribute("src", `t/${hit["_source"]["index"]}/${hit["_id"]}`); thumbnail.setAttribute("src", `t/${hit["_source"]["index"]}/${hit["_id"]}`);
thumbnail.addEventListener("error", () => {
imgWrapper.remove();
});
} }
//Thumbnail overlay //Thumbnail overlay