mirror of
https://github.com/simon987/sist2.git
synced 2025-12-12 15:08:53 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 152d2ddf8a | |||
| bc5f22b759 | |||
| 534b397876 |
13
README.md
13
README.md
@@ -9,7 +9,7 @@ sist2 (Simple incremental search tool)
|
||||
|
||||
## Features
|
||||
|
||||
* Fast, low memory usage
|
||||
* Fast, low memory usage, multi-threaded
|
||||
* Portable (all its features are packaged in a single executable)
|
||||
* Extracts text from common file types\*
|
||||
* 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
|
||||
:---|:---|:---|:---|:---
|
||||
pdf,xps,cbz,cbr,fb2,epub | MuPDF | yes | yes, `png` | title |
|
||||
`audio/*` | libav | - | yes, `jpeg` | ID3 tags |
|
||||
`video/*` | libav | - | yes, `jpeg` | title, comment |
|
||||
`image/*` | libav | - | yes, `jpeg` | *planned* |
|
||||
`audio/*` | ffmpeg | - | yes, `jpeg` | ID3 tags |
|
||||
`video/*` | ffmpeg | - | yes, `jpeg` | title, comment |
|
||||
`image/*` | ffmpeg | - | yes, `jpeg` | *planned* |
|
||||
ttf,ttc,cff,woff,fnt,otf | Freetype2 | - | yes, `bmp` | Name & style |
|
||||
`text/plain` | *(none)* | yes | no | - |
|
||||
docx, xlsx, pptx | | *planned* | no | *planned* |
|
||||
@@ -79,11 +79,12 @@ binaries.
|
||||
apt install git cmake pkg-config libglib2.0-dev\
|
||||
libssl-dev uuid-dev libavformat-dev libswscale-dev \
|
||||
python3 libmagic-dev libfreetype6-dev libcurl-dev \
|
||||
libbz2-dev yasm
|
||||
libbz2-dev yasm libharfbuzz-dev
|
||||
```
|
||||
*(FreeBSD)*
|
||||
```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
|
||||
|
||||
@@ -66,7 +66,7 @@ index_descriptor_t read_index_descriptor(char *path) {
|
||||
strcpy(descriptor.root, cJSON_GetObjectItem(json, "root")->valuestring);
|
||||
strcpy(descriptor.name, cJSON_GetObjectItem(json, "name")->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.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);
|
||||
|
||||
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);
|
||||
|
||||
int c;
|
||||
@@ -208,14 +208,19 @@ void read_index(const char *path, const char index_id[UUID_STR_LEN], index_func
|
||||
while (key != '\n') {
|
||||
switch (key) {
|
||||
case MetaWidth:
|
||||
case MetaHeight:
|
||||
case MetaMediaDuration:
|
||||
case MetaMediaBitrate: {
|
||||
case MetaHeight: {
|
||||
int value;
|
||||
fread(&value, sizeof(int), 1, file);
|
||||
cJSON_AddNumberToObject(document, get_meta_key_text(key), value);
|
||||
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 MetaMediaVideoCodec: {
|
||||
int value;
|
||||
@@ -245,7 +250,7 @@ void read_index(const char *path, const char index_id[UUID_STR_LEN], index_func
|
||||
break;
|
||||
}
|
||||
default:
|
||||
fprintf(stderr, "Invalid meta key (corrupt index): %x", key);
|
||||
fprintf(stderr, "Invalid meta key (corrupt index): %x\n", key);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#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[] = {
|
||||
"sist2 scan [OPTION]... PATH",
|
||||
"sist2 index [OPTION]... INDEX",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -136,6 +136,9 @@ function createDocCard(hit) {
|
||||
thumbnail = document.createElement("img");
|
||||
thumbnail.setAttribute("class", "card-img-top fit");
|
||||
thumbnail.setAttribute("src", `t/${hit["_source"]["index"]}/${hit["_id"]}`);
|
||||
thumbnail.addEventListener("error", () => {
|
||||
imgWrapper.remove();
|
||||
});
|
||||
}
|
||||
|
||||
//Thumbnail overlay
|
||||
|
||||
Reference in New Issue
Block a user