From c14fd64f5fb10d2daafd0bc04d6e14e90abbc989 Mon Sep 17 00:00:00 2001 From: Jamie Date: Mon, 2 Apr 2018 21:25:16 +0100 Subject: [PATCH] Added random versioning prefix to the translations so the users don't have to clear the cache --- src/Ombi/ClientApp/app/app.module.ts | 5 +++-- src/Ombi/build.sh | 21 --------------------- 2 files changed, 3 insertions(+), 23 deletions(-) delete mode 100644 src/Ombi/build.sh diff --git a/src/Ombi/ClientApp/app/app.module.ts b/src/Ombi/ClientApp/app/app.module.ts index 731fa383b..0936b13cd 100644 --- a/src/Ombi/ClientApp/app/app.module.ts +++ b/src/Ombi/ClientApp/app/app.module.ts @@ -58,10 +58,11 @@ const routes: Routes = [ // AoT requires an exported function for factories export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLocation) { const base = platformLocation.getBaseHrefFromDOM(); + const version = Math.floor(Math.random() * 999999999); if (base.length > 1) { - return new TranslateHttpLoader(http, `${base}/translations/`, ".json"); + return new TranslateHttpLoader(http, `${base}/translations/`, `.json?v=${version}`); } - return new TranslateHttpLoader(http, "/translations/", ".json"); + return new TranslateHttpLoader(http, "/translations/", `.json?v=${version}`); } @NgModule({ diff --git a/src/Ombi/build.sh b/src/Ombi/build.sh deleted file mode 100644 index c15b1cb28..000000000 --- a/src/Ombi/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -SERVICE="Ombi" -# change directory to location of project.json -pushd ./ -# run dotnet publish, specify release build -dotnet publish -c Release -# equivalent to cd .. (go back to previous directory) -#popd -# Create a docker image tagged with the name of the project:latest -docker build -t "$SERVICE":latest . -# Check to see if this container exists. -CONTAINER=`docker ps --all | grep "$SERVICE"` -# if it doesn't, then just run this. -if [ -z "$CONTAINER" ]; then - docker run -i -p 8000:5000 --name $SERVICE -t $SERVICE:latest -# if it does exist; nuke it and then run the new one -else - docker rm $SERVICE - docker run -i -p 8000:5000 --name $SERVICE -t $SERVICE:latest -fi - -read -p "Press enter to continue" \ No newline at end of file