Compare commits

...

2 Commits

Author SHA1 Message Date
simon987
80528857e9 Duplicate media_comment field, fixes #440 2023-11-18 10:53:42 -05:00
ffa7f2ae84 Add button for full reindex, fixes #403 2023-11-18 10:53:42 -05:00
11 changed files with 39 additions and 12 deletions

View File

@ -89,9 +89,12 @@ class Sist2AdminApi {
/**
* @param {string} name
* @param {bool} full
*/
runJob(name) {
return axios.get(`${this.baseUrl}/api/job/${name}/run`);
runJob(name, full) {
return axios.get(`${this.baseUrl}/api/job/${name}/run`, {
params: {full}
});
}
/**

View File

@ -8,6 +8,7 @@ export default {
view: "View",
delete: "Delete",
runNow: "Index now",
runNowFull: "Full re-index",
create: "Create",
cancel: "Cancel",
test: "Test",

View File

@ -6,7 +6,19 @@
</b-card-title>
<div class="mb-3">
<b-button class="mr-1" variant="primary" @click="runJob()" :disabled="!valid">{{ $t("runNow") }}</b-button>
<b-dropdown
split
split-variant="primary"
variant="primary"
:text="$t('runNow')"
class="mr-1"
:disabled="!valid"
@click="runJob()"
>
<b-dropdown-item href="#" @click="runJob(true)">{{ $t("runNowFull") }}</b-dropdown-item>
</b-dropdown>
<b-button variant="danger" @click="deleteJob()">{{ $t("delete") }}</b-button>
</div>
@ -69,6 +81,7 @@ export default {
return {
loading: true,
job: null,
console: console
}
},
methods: {
@ -78,8 +91,8 @@ export default {
update() {
Sist2AdminApi.updateJob(this.getName(), this.job);
},
runJob() {
Sist2AdminApi.runJob(this.getName()).then(() => {
runJob(full = false) {
Sist2AdminApi.runJob(this.getName(), full).then(() => {
this.$bvToast.toast(this.$t("runJobConfirmation"), {
title: this.$t("runJobConfirmationTitle"),
variant: "success",

View File

@ -169,11 +169,14 @@ def _run_job(job: Sist2Job):
@app.get("/api/job/{name:str}/run")
async def run_job(name: str):
job = db["jobs"][name]
async def run_job(name: str, full: bool = False):
job: Sist2Job = db["jobs"][name]
if not job:
raise HTTPException(status_code=404)
if full:
job.do_full_scan = True
_run_job(job)
return "ok"

View File

@ -59,7 +59,7 @@ export default {
const fields = [
"title", "duration", "audioc", "videoc",
"bitrate", "artist", "album", "album_artist", "genre", "font_name", "author",
"bitrate", "artist", "album", "album_artist", "genre", "font_name", "author", "media_comment",
"modified_by", "pages", "tag",
"exif_make", "exif_software", "exif_exposure_time", "exif_fnumber", "exif_focal_length",
"exif_user_comment", "exif_iso_speed_ratings", "exif_model", "exif_datetime",

View File

@ -81,6 +81,7 @@
<li><code>doc.artist</code></li>
<li><code>doc.title</code></li>
<li><code>doc.genre</code></li>
<li><code>doc.media_comment</code></li>
<li><code>doc.album_artist</code></li>
<li><code>doc.exif_make</code></li>
<li><code>doc.exif_model</code></li>

View File

@ -30,6 +30,8 @@ char *get_meta_key_text(enum metakey meta_key) {
return "genre";
case MetaTitle:
return "title";
case MetaMediaComment:
return "media_comment";
case MetaFontName:
return "font_name";
case MetaExifMake:
@ -159,6 +161,7 @@ void write_document(document_t *doc) {
case MetaExifGpsLatitudeDec:
case MetaExifGpsLatitudeRef:
case MetaChecksum:
case MetaMediaComment:
case MetaTitle: {
cJSON_AddStringToObject(json, get_meta_key_text(meta->key), meta->str_val);
buffer_size_guess += (int) strlen(meta->str_val);

View File

@ -11,7 +11,6 @@
#include "web/serve.h"
#include "parsing/mime.h"
#include "parsing/parse.h"
#include "auth0/auth0_c_api.h"
#include <signal.h>
#include <pthread.h>
@ -425,6 +424,8 @@ int set_to_negative_if_value_is_zero(UNUSED(struct argparse *self), const struct
fprintf(stderr, "error: option `--%s` Value must be >= 0\n", option->long_name);
exit(1);
}
return 0;
}
int main(int argc, const char *argv[]) {
@ -544,7 +545,7 @@ int main(int argc, const char *argv[]) {
OPT_END(),
};
struct argparse argparse;
struct argparse argparse = {};
argparse_init(&argparse, options, usage, 0);
argparse_describe(
&argparse,

View File

@ -51,11 +51,11 @@
#include <ctype.h>
#include "git_hash.h"
#define VERSION "3.4.0"
#define VERSION "3.4.1"
static const char *const Version = VERSION;
static const int VersionMajor = 3;
static const int VersionMinor = 4;
static const int VersionPatch = 0;
static const int VersionPatch = 1;
#ifndef SIST_PLATFORM
#define SIST_PLATFORM unknown

View File

@ -272,6 +272,7 @@ static void append_audio_meta(scan_media_ctx_t *ctx, AVFormatContext *pFormatCtx
APPEND_TAG_META(MetaAlbum);
} else if (strcmp(key, "comment") == 0) {
append_tag_meta_if_not_exists(ctx, doc, tag, MetaContent);
APPEND_TAG_META(MetaMediaComment);
}
}
}

View File

@ -63,6 +63,7 @@ enum metakey {
MetaAlbumArtist,
MetaGenre,
MetaTitle,
MetaMediaComment,
MetaFontName,
MetaExifMake,
MetaExifDescription,