Handle file rescan (#2951)

* Fire handlers when file updated or moved
* Create galleries as needed
* Clean empty galleries
* Handle cleaning zip folders when path changed
* Fix gallery association on duplicate images
* Re-create missing folder-based galleries
This commit is contained in:
WithoutPants
2022-09-28 16:08:00 +10:00
committed by GitHub
parent 00820a8789
commit dce90a3ed9
13 changed files with 439 additions and 106 deletions

View File

@@ -34,6 +34,17 @@ func IsPathInDir(dir, pathToCheck string) bool {
return false
}
// IsPathInDirs returns true if pathToCheck is within anys of the paths in dirs.
func IsPathInDirs(dirs []string, pathToCheck string) bool {
for _, dir := range dirs {
if IsPathInDir(dir, pathToCheck) {
return true
}
}
return false
}
// GetHomeDirectory returns the path of the user's home directory. ~ on Unix and C:\Users\UserName on Windows
func GetHomeDirectory() string {
currentUser, err := user.Current()