From 809bfc49cdb80dc1cabd45dfc662cf55bf054b38 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 21 Aug 2024 22:46:42 +0200 Subject: [PATCH 1/4] Fix android app not starting due to icon --- front/packages/ui/src/navbar/icon.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/packages/ui/src/navbar/icon.tsx b/front/packages/ui/src/navbar/icon.tsx index cb14ff5d..e0382322 100644 --- a/front/packages/ui/src/navbar/icon.tsx +++ b/front/packages/ui/src/navbar/icon.tsx @@ -19,7 +19,7 @@ */ import Svg, { type SvgProps, Path } from "react-native-svg"; -import { useYoshiki } from "yoshiki"; +import { useYoshiki } from "yoshiki/native"; /* export const KyooLogo = (props: SvgProps) => ( */ /* */ From 22dd3c65d22b4b918e690913594928ec646107f2 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 21 Aug 2024 22:46:59 +0200 Subject: [PATCH 2/4] Fix snackbar key warning --- front/packages/primitives/src/snackbar.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/front/packages/primitives/src/snackbar.tsx b/front/packages/primitives/src/snackbar.tsx index b8680895..ad3075f1 100644 --- a/front/packages/primitives/src/snackbar.tsx +++ b/front/packages/primitives/src/snackbar.tsx @@ -61,7 +61,8 @@ export const SnackbarProvider = ({ children }: { children: ReactElement | ReactE return; } - addPortal("snackbar", ); + const { key, ...props } = top; + addPortal("snackbar", ); timeout.current = setTimeout(() => { removePortal("snackbar"); updatePortal(); From b49eb3bffa85907d7693efcc00e4f5366cbb58df Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 21 Aug 2024 22:48:44 +0200 Subject: [PATCH 3/4] Add N/A note on packets_nbr > frames_nbr files --- transcoder/src/keyframes.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/transcoder/src/keyframes.go b/transcoder/src/keyframes.go index 2b3ade5a..6e16d6a6 100644 --- a/transcoder/src/keyframes.go +++ b/transcoder/src/keyframes.go @@ -191,6 +191,8 @@ func getVideoKeyframes(path string, video_idx uint32, kf *Keyframe) error { pts, flags := x[0], x[1] // true if there is no keyframes (e.g. in a file w/o video track) + // can also happen if a video has more packets than frames (so the last packet + // is emtpy and has a N/A pts) if pts == "N/A" { break } From e7c9eca524f0cb8b9467281f292acd235e74c30a Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 21 Aug 2024 23:28:06 +0200 Subject: [PATCH 4/4] Add schema handling via env var --- transcoder/.env.example | 5 ++++- transcoder/src/metadata.go | 15 +++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/transcoder/.env.example b/transcoder/.env.example index cfe34e02..b8772e54 100644 --- a/transcoder/.env.example +++ b/transcoder/.env.example @@ -26,4 +26,7 @@ POSTGRES_PASSWORD= POSTGRES_DB= POSTGRES_SERVER= POSTGRES_PORT=5432 -# (the schema "gocoder" will be used) +# Default is gocoder, you can specify "disabled" to use the default search_path of the user. +# If this is not "disabled", the schema will be created (if it does not exists) and +# the search_path of the user will be ignored (only the schema specified will be used). +POSTGRES_SCHEMA=gocoder diff --git a/transcoder/src/metadata.go b/transcoder/src/metadata.go index c1fd2edf..a382d8d3 100644 --- a/transcoder/src/metadata.go +++ b/transcoder/src/metadata.go @@ -24,21 +24,28 @@ type MetadataService struct { func NewMetadataService() (*MetadataService, error) { con := fmt.Sprintf( - "postgresql://%v:%v@%v:%v/%v?application_name=gocoder&search_path=gocoder&sslmode=disable", + "postgresql://%v:%v@%v:%v/%v?application_name=gocoder&sslmode=disable", url.QueryEscape(os.Getenv("POSTGRES_USER")), url.QueryEscape(os.Getenv("POSTGRES_PASSWORD")), url.QueryEscape(os.Getenv("POSTGRES_SERVER")), url.QueryEscape(os.Getenv("POSTGRES_PORT")), url.QueryEscape(os.Getenv("POSTGRES_DB")), ) + schema := GetEnvOr("POSTGRES_SCHEMA", "gocoder") + if schema != "disabled" { + con = fmt.Sprintf("%s&search_path=%s", con, url.QueryEscape(schema)) + } db, err := sql.Open("postgres", con) if err != nil { + fmt.Printf("Could not connect to database, check your env variables!") return nil, err } - _, err = db.Exec("create schema if not exists gocoder") - if err != nil { - return nil, err + if schema != "disabled" { + _, err = db.Exec(fmt.Sprintf("create schema if not exists %s", schema)) + if err != nil { + return nil, err + } } driver, err := postgres.WithInstance(db, &postgres.Config{})