diff --git a/README.md b/README.md index 5cc67aa..98f78ab 100644 --- a/README.md +++ b/README.md @@ -5,25 +5,22 @@ - Both photo and video support - Deals with any file formats (including HEIC and HEVC) - Only updates changed files, runs incrementally +- If aborted, can continue from where it stopped and clean-up unfinished files - Uses relative paths (safe for using in subdirectory or S3) -- Minimal bloat (no third party frontend libraries, minimal CSS) +- Minimal bloat (vanilla JS frontend, minimal CSS) *Please note that fastgallery is still beta, I am actively working on it* ## Examples - Please see [https://www.melisma.fi/fastgallery-examples/](https://www.melisma.fi/fastgallery-examples/) ## Dependencies - ### MacOS - For dependencies, use Homebrew to install: `brew install vips ffmpeg` ### Ubuntu Linux - For Ubuntu 18.04 bionic or 20.04 focal, first add my PPA for latest libvips with HEIF support: `sudo add-apt-repository ppa:tonimelisma/ppa` @@ -33,17 +30,15 @@ Then install libvips42 for images and optionally ffmpeg (if you need video suppo `apt-get install libvips42 ffmpeg` ## Install - 1. Download the latest release and unpack -2. Run ```make build``` -3. Copy ```bin/fastgallery``` to ```/usr/local/bin``` -4. Copy contents of ```assets/``` to ```/usr/local/share/fastgallery``` -## Usage +2. Move into the unpacked directory +3. Run ```make build``` +4. Copy ```bin/fastgallery``` to ```/usr/local/bin``` +## Usage `fastgallery -o /var/www/html/gallery ~/Dropbox/Pictures` ## Roadmap - For the prioritised roadmap, please see https://github.com/tonimelisma/fastgallery/projects/1 ## Third party libraries diff --git a/cmd/fastgallery/main.go b/cmd/fastgallery/main.go index 3657521..0e274c4 100644 --- a/cmd/fastgallery/main.go +++ b/cmd/fastgallery/main.go @@ -449,7 +449,6 @@ func copy(sourceDir string, destDir string, filename string, dryRun bool) { // copyRootAssets copies all the embedded assets to the root directory of the gallery func copyRootAssets(gallery directory, dryRun bool, fileMode os.FileMode) { - // TODO add dry-run assetDirectoryListing, err := assets.ReadDir("assets") if err != nil { log.Fatal("couldn't open embedded assets:", err.Error()) @@ -495,10 +494,24 @@ func copyRootAssets(gallery directory, dryRun bool, fileMode os.FileMode) { } } -func createGallery(depth int, source directory, gallery directory, dryRun bool, config configuration) { - // TODO +func createHTML(depth int, subdirectories []directory, files []file) { + fmt.Println("creating HTML:", depth) +} + +func createGallery(depth int, source directory, gallery directory, dryRun bool, config configuration, progressBar *pb.ProgressBar) { + // replace println:s with actual functionality, add concurrence + for _, file := range source.files { + if !file.exists { + fmt.Println("converting:", file.name, file.relPath, file.absPath) + } + } - // createHTML(depth, source.subdirectories, source.files) + createHTML(depth, source.subdirectories, source.files) + + for _, subdir := range source.subdirectories { + fmt.Println("recursing to:", subdir.name, subdir.relPath, subdir.absPath) + createGallery(depth+1, subdir, gallery, dryRun, config, progressBar) + } } func main() { @@ -556,8 +569,8 @@ func main() { defer vips.Shutdown() } - createGallery(0, source, gallery, args.DryRun, config) copyRootAssets(gallery, args.DryRun, config.files.fileMode) + createGallery(0, source, gallery, args.DryRun, config, progressBar) if !args.DryRun { progressBar.Finish()