* Updated README.md to include information about the thumbnails generation script.

* Added .markdownlint.json to disable 2 rules from markdownlint.
This commit is contained in:
Bobby Wibowo 2018-08-21 06:24:50 +07:00
parent 5c365dc4a8
commit e204187efc
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
5 changed files with 25 additions and 4 deletions

5
.markdownlint.json Normal file
View File

@ -0,0 +1,5 @@
{
"default": true,
"MD013": false,
"MD040": false
}

View File

@ -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 <mode=1|2|3> [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

View File

@ -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",

View File

@ -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 <mode=1|2|3> [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 <mode=1|2|3> [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
}

View File

@ -8,6 +8,7 @@
{% endblock %}
{% block scripts %}
<!-- Scripts -->
<script type="text/javascript" src="../libs/lazyload/lazyload.min.js?v={{ globals.v3 }}"></script>
<script type="text/javascript" src="../js/album.js?v={{ globals.v1 }}"></script>
{% endblock %}