diff --git a/Makefile b/Makefile index a536b4111..4e9dea55c 100644 --- a/Makefile +++ b/Makefile @@ -175,7 +175,7 @@ ui-start: pre-build $(SET) VITE_APP_DATE="$(BUILD_DATE)" $(SEPARATOR) \ $(SET) VITE_APP_GITHASH=$(GITHASH) $(SEPARATOR) \ $(SET) VITE_APP_STASH_VERSION=$(STASH_VERSION) $(SEPARATOR) \ - cd ui/v2.5 && yarn start + cd ui/v2.5 && yarn start --host .PHONY: fmt-ui fmt-ui: diff --git a/pkg/ffmpeg/downloader.go b/pkg/ffmpeg/downloader.go index 0a8599d97..10cd96949 100644 --- a/pkg/ffmpeg/downloader.go +++ b/pkg/ffmpeg/downloader.go @@ -44,6 +44,15 @@ func Download(ctx context.Context, configDirectory string) error { return err } } + + // validate that the urls contained what we needed + executables := []string{"ffmpeg", "ffprobe"} + for _, executable := range executables { + _, err := os.Stat(filepath.Join(configDirectory, executable)) + if err != nil { + return err + } + } return nil } @@ -76,7 +85,6 @@ func DownloadSingle(ctx context.Context, configDirectory, url string) error { } // Configure where we want to download the archive - urlExt := path.Ext(url) urlBase := path.Base(url) archivePath := filepath.Join(configDirectory, urlBase) _ = os.Remove(archivePath) // remove archive if it already exists @@ -118,7 +126,7 @@ func DownloadSingle(ctx context.Context, configDirectory, url string) error { logger.Info("Downloading complete") - if urlExt == ".zip" { + if resp.Header.Get("Content-Type") == "application/zip" { logger.Infof("Unzipping %s...", archivePath) if err := unzip(archivePath, configDirectory); err != nil { return err @@ -126,12 +134,18 @@ func DownloadSingle(ctx context.Context, configDirectory, url string) error { // On OSX or Linux set downloaded files permissions if runtime.GOOS == "darwin" || runtime.GOOS == "linux" { - if err := os.Chmod(filepath.Join(configDirectory, "ffmpeg"), 0755); err != nil { - return err + _, err = os.Stat(filepath.Join(configDirectory, "ffmpeg")) + if !os.IsNotExist(err) { + if err = os.Chmod(filepath.Join(configDirectory, "ffmpeg"), 0755); err != nil { + return err + } } - if err := os.Chmod(filepath.Join(configDirectory, "ffprobe"), 0755); err != nil { - return err + _, err = os.Stat(filepath.Join(configDirectory, "ffprobe")) + if !os.IsNotExist(err) { + if err := os.Chmod(filepath.Join(configDirectory, "ffprobe"), 0755); err != nil { + return err + } } // TODO: In future possible clear xattr to allow running on osx without user intervention @@ -139,8 +153,6 @@ func DownloadSingle(ctx context.Context, configDirectory, url string) error { // xattr -c /path/to/binary -- xattr.Remove(path, "com.apple.quarantine") } - logger.Infof("ffmpeg and ffprobe successfully installed in %s", configDirectory) - } else { return fmt.Errorf("ffmpeg was downloaded to %s", archivePath) } @@ -152,7 +164,7 @@ func getFFMPEGURL() []string { var urls []string switch runtime.GOOS { case "darwin": - urls = []string{"https://evermeet.cx/ffmpeg/ffmpeg-4.3.1.zip", "https://evermeet.cx/ffmpeg/ffprobe-4.3.1.zip"} + urls = []string{"https://evermeet.cx/ffmpeg/getrelease/zip", "https://evermeet.cx/ffmpeg/getrelease/ffprobe/zip"} case "linux": switch runtime.GOARCH { case "amd64": diff --git a/ui/v2.5/src/core/createClient.ts b/ui/v2.5/src/core/createClient.ts index 0d8aa48cb..c212be46f 100644 --- a/ui/v2.5/src/core/createClient.ts +++ b/ui/v2.5/src/core/createClient.ts @@ -83,7 +83,7 @@ const typePolicies: TypePolicies = { export const getBaseURL = () => { const baseURL = window.STASH_BASE_URL; - if (baseURL === "%BASE_URL%") return "/"; + if (baseURL === "/%BASE_URL%/") return "/"; return baseURL; }; diff --git a/ui/v2.5/src/index.scss b/ui/v2.5/src/index.scss index 345614f41..bf30ef36a 100755 --- a/ui/v2.5/src/index.scss +++ b/ui/v2.5/src/index.scss @@ -743,3 +743,11 @@ dl.details-list { grid-column-gap: 10px; grid-template-columns: minmax(16.67%, auto) 1fr; } + +// Fix Safari styling on dropdowns +select { + -webkit-appearance: none; + appearance: none; + background: url("data:image/svg+xml;utf8,") + no-repeat right 2px center; +}