From e204187efc9b8dc4688261c145a75a33c1e03cf7 Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Tue, 21 Aug 2018 06:24:50 +0700 Subject: [PATCH] Updates * Updated README.md to include information about the thumbnails generation script. * Added .markdownlint.json to disable 2 rules from markdownlint. --- .markdownlint.json | 5 +++++ README.md | 14 ++++++++++++++ package.json | 3 ++- scripts/thumbs.js | 6 +++--- views/album.njk | 1 + 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..ce92a41 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,5 @@ +{ + "default": true, + "MD013": false, + "MD040": false +} diff --git a/README.md b/README.md index 0918cde..681afef 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,20 @@ If you want to use an existing lolisafe database with this branch, make sure to Configuration file of lolisafe, `config.js`, is also not 100% compatible with this branch. There are some options that had been renamed and/or restructured. Please make sure your config matches the sample in `config.sample.js` before starting. +## Missing thumbnails + +Thumbnails will not be automatically generated for files that have been uploaded prior to enabling thumbnails generation in the config file. To generate thumbnails for old files, you can try running `yarn thumbs` (a shortcut to running `node scripts/thumbs.js`). + +``` +Usage: +yarn thumbs [force=0|1] + +mode : 1 = images only, 2 = videos only, 3 = both images and videos +force: 0 = no force (default), 1 = overwrite existing thumbnails +``` + +For example, if you only want to generate thumbnails for image files, you can do `yarn thumbs 1`. + ## Running 1. Ensure you have at least version 8.0.0 of node installed diff --git a/package.json b/package.json index 8e44ecf..0d7a93d 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "license": "MIT", "scripts": { "start": "node ./lolisafe.js", - "pm2": "pm2 start --name lolisafe ./lolisafe.js" + "pm2": "pm2 start --name lolisafe ./lolisafe.js", + "thumbs": "node ./scripts/thumbs.js" }, "dependencies": { "bcrypt": "^2.0.0", diff --git a/scripts/thumbs.js b/scripts/thumbs.js index 2f6ce17..569e490 100644 --- a/scripts/thumbs.js +++ b/scripts/thumbs.js @@ -38,9 +38,9 @@ thumbs.do = async () => { thumbs.force = parseInt(args[1]) if ((isNaN(thumbs.mode) || ![1, 2, 3].includes(thumbs.mode)) || (!isNaN(thumbs.force) && ![0, 1].includes(thumbs.force))) { - console.log('Usage : node THIS_FILE [force=0|1]') - console.log('mode : 1 = images only, 2 = videos only, 3 = both images and videos') - console.log('force : 0 = no force (default), 1 = overwrite existing thumbnails') + console.log('Usage:\nyarn thumbs [force=0|1]\n') + console.log('mode : 1 = images only, 2 = videos only, 3 = both images and videos') + console.log('force: 0 = no force (default), 1 = overwrite existing thumbnails') return } diff --git a/views/album.njk b/views/album.njk index a97451a..37aae49 100644 --- a/views/album.njk +++ b/views/album.njk @@ -8,6 +8,7 @@ {% endblock %} {% block scripts %} + {% endblock %}