Successive requires value of true, instead of any non-null value

This commit is contained in:
Seednode 2022-09-25 11:30:52 -05:00
parent 5f9dd5f607
commit 8e1ab46302
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var Version = "0.12.1" var Version = "0.12.2"
func init() { func init() {
rootCmd.AddCommand(versionCmd) rootCmd.AddCommand(versionCmd)

View File

@ -142,7 +142,7 @@ func serveHtmlHandler(paths []string) http.HandlerFunc {
successive := r.URL.Query().Get("s") successive := r.URL.Query().Get("s")
switch { switch {
case r.URL.Path == "/" && successive != "" && refererUri != "": case r.URL.Path == "/" && successive == "true" && refererUri != "":
query, err := url.QueryUnescape(refererUri) query, err := url.QueryUnescape(refererUri)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
@ -171,7 +171,7 @@ func serveHtmlHandler(paths []string) http.HandlerFunc {
newUrl := fmt.Sprintf("%v%v?f=%v&s=%v", r.URL.Host, filePath, filter, successive) newUrl := fmt.Sprintf("%v%v?f=%v&s=%v", r.URL.Host, filePath, filter, successive)
http.Redirect(w, r, newUrl, http.StatusSeeOther) http.Redirect(w, r, newUrl, http.StatusSeeOther)
case r.URL.Path == "/" && successive != "" && refererUri == "": case r.URL.Path == "/" && successive == "true" && refererUri == "":
filePath, err := pickFile(paths, filter, successive) filePath, err := pickFile(paths, filter, successive)
switch { switch {
case err != nil && err == ErrNoImagesFound: case err != nil && err == ErrNoImagesFound: