From f72f07fa5516be5abbb85c7b94bce54d15cea9e8 Mon Sep 17 00:00:00 2001
From: Stefan Cruz <17972991+stefancruz@users.noreply.github.com>
Date: Sat, 22 Jun 2024 15:22:16 +0100
Subject: [PATCH] chore: configuration adjustments

---
 DailymotionConfig.json                        |   2 +-
 .../{dailymotion.png => DailymotionIcon.png}  | Bin
 build/DailymotionConfig.json                  |   2 +-
 .../{dailymotion.png => DailymotionIcon.png}  | Bin
 build/Readme.md                               |  52 ---------------
 deploy.sh                                     |  50 +++++++--------
 rollup.config.js                              |  59 +++++++++---------
 7 files changed, 56 insertions(+), 109 deletions(-)
 rename assets/{dailymotion.png => DailymotionIcon.png} (100%)
 rename build/{dailymotion.png => DailymotionIcon.png} (100%)
 delete mode 100644 build/Readme.md

diff --git a/DailymotionConfig.json b/DailymotionConfig.json
index 47f30d5..c58524e 100644
--- a/DailymotionConfig.json
+++ b/DailymotionConfig.json
@@ -8,7 +8,7 @@
   "scriptUrl": "./DailymotionScript.js",
   "repositoryUrl": "https://github.com/stefancruz/GrayjayDailymotion",
   "version": 14,
-  "iconUrl": "./dailymotion.png",
+  "iconUrl": "./DailymotionIcon.png",
   "id": "9c87e8db-e75d-48f4-afe5-2d203d4b95c5",
   "scriptSignature": "",
   "scriptPublicKey": "",
diff --git a/assets/dailymotion.png b/assets/DailymotionIcon.png
similarity index 100%
rename from assets/dailymotion.png
rename to assets/DailymotionIcon.png
diff --git a/build/DailymotionConfig.json b/build/DailymotionConfig.json
index 47f30d5..c58524e 100644
--- a/build/DailymotionConfig.json
+++ b/build/DailymotionConfig.json
@@ -8,7 +8,7 @@
   "scriptUrl": "./DailymotionScript.js",
   "repositoryUrl": "https://github.com/stefancruz/GrayjayDailymotion",
   "version": 14,
-  "iconUrl": "./dailymotion.png",
+  "iconUrl": "./DailymotionIcon.png",
   "id": "9c87e8db-e75d-48f4-afe5-2d203d4b95c5",
   "scriptSignature": "",
   "scriptPublicKey": "",
diff --git a/build/dailymotion.png b/build/DailymotionIcon.png
similarity index 100%
rename from build/dailymotion.png
rename to build/DailymotionIcon.png
diff --git a/build/Readme.md b/build/Readme.md
deleted file mode 100644
index 640b29f..0000000
--- a/build/Readme.md
+++ /dev/null
@@ -1,52 +0,0 @@
-# Dailymotion plugin for Grayjay - work in progress
-
-Click [here](https://stefancruz.github.io/GrayjayDailymotion/index.html) to install into Grayjay
-
-## Features
-- [x] - Home
-- [x] - Home search
-- [x] - Live videos from home search
-- [x] - Search autocomplete
-- [x] - Video details (likes, dislikes, views, publish date)
-- [x] - Subscriptions
-- [x] - Channel search
-- [x] - Channel details
-- [x] - Channel playlist tab
-- [x] - Downloads
-- [x] - Playlists search
-- [x] - Settings / Thumbnail resolution
-- [x] - Settings / Creator avatar resolution
-- [x] - Settings / Hide sensitive content
-- [x] - Settings / Prefered Country
-- [x] - Sign in (import subscriptions and playlists (and Likes, Favorites, Recently Watched))
-- [x] - Policentric Comments
-- [x] - Subtitles
-
-## Todo 
-- [ ] - State management
-- [ ] - Platform comments (not generally available)
-
-## Known bugs
-- [ ] - Live filter in Subscriptions tab
-
-
-
-## Install
-npm install
-
-## Update graphql types (optional)
-
-npm run get-token
-
-npm run codegen
-
-## Build
-
-npm run build
-
-npm start - will build and watch for changes
-
-# notes:
-- Content of the 'build' folder should not be manually changed since it's recreated for each build. 
-- Used [rollup](https://rollupjs.org/) to bundle all the scripts into one.
-- Used npm shrinkwrap to lock the dependency versions of the project. This should avoid new bugs, vulnerabilities and breaking changes (in minor and patches), introduced when the dependencies are automatically updated by npm.
\ No newline at end of file
diff --git a/deploy.sh b/deploy.sh
index 9131478..1ee27af 100644
--- a/deploy.sh
+++ b/deploy.sh
@@ -1,25 +1,25 @@
-#!/bin/sh
-DOCUMENT_ROOT=/var/www/sources
-
-# Take site offline
-echo "Taking site offline..."
-touch $DOCUMENT_ROOT/maintenance.file
-
-# Swap over the content
-echo "Deploying content..."
-mkdir -p $DOCUMENT_ROOT/Dailymotion
-cp build/dailymotion.png $DOCUMENT_ROOT/Dailymotion
-cp build/DailymotionConfig.json $DOCUMENT_ROOT/Dailymotion
-cp build/DailymotionScript.js $DOCUMENT_ROOT/Dailymotion
-sh sign.sh $DOCUMENT_ROOT/Dailymotion/DailymotionScript.js $DOCUMENT_ROOT/Dailymotion/DailymotionConfig.json
-
-# Notify Cloudflare to wipe the CDN cache
-echo "Purging Cloudflare cache for zone $CLOUDFLARE_ZONE_ID..."
-curl -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/purge_cache" \
-     -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-     -H "Content-Type: application/json" \
-     --data '{"files":["https://plugins.grayjay.app/Dailymotion/Dailymotion.png", "https://plugins.grayjay.app/Dailymotion/DailymotionConfig.json", "https://plugins.grayjay.app/Dailymotion/DailymotionScript.js"]}'
-
-# Take site back online
-echo "Bringing site back online..."
-rm $DOCUMENT_ROOT/maintenance.file
+#!/bin/sh
+DOCUMENT_ROOT=/var/www/sources
+
+# Take site offline
+echo "Taking site offline..."
+touch $DOCUMENT_ROOT/maintenance.file
+
+# Swap over the content
+echo "Deploying content..."
+mkdir -p $DOCUMENT_ROOT/Dailymotion
+cp build/DailymotionIcon.png $DOCUMENT_ROOT/Dailymotion
+cp build/DailymotionConfig.json $DOCUMENT_ROOT/Dailymotion
+cp build/DailymotionScript.js $DOCUMENT_ROOT/Dailymotion
+sh sign.sh $DOCUMENT_ROOT/Dailymotion/DailymotionScript.js $DOCUMENT_ROOT/Dailymotion/DailymotionConfig.json
+
+# Notify Cloudflare to wipe the CDN cache
+echo "Purging Cloudflare cache for zone $CLOUDFLARE_ZONE_ID..."
+curl -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/purge_cache" \
+     -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
+     -H "Content-Type: application/json" \
+     --data '{"files":["https://plugins.grayjay.app/Dailymotion/DailymotionIcon.png", "https://plugins.grayjay.app/Dailymotion/DailymotionConfig.json", "https://plugins.grayjay.app/Dailymotion/DailymotionScript.js"]}'
+
+# Take site back online
+echo "Bringing site back online..."
+rm $DOCUMENT_ROOT/maintenance.file
diff --git a/rollup.config.js b/rollup.config.js
index 918d261..f8e67b4 100644
--- a/rollup.config.js
+++ b/rollup.config.js
@@ -1,30 +1,29 @@
-const resolve = require('@rollup/plugin-node-resolve').default;
-const commonjs = require('@rollup/plugin-commonjs');
-const typescript = require('@rollup/plugin-typescript');
-const copy = require('rollup-plugin-copy');
-const del = require('rollup-plugin-delete');
-
-const dest = './build'; // Output folder
-
-module.exports = {
-  input: 'src/DailymotionScript.ts', // Entry file
-  output: {
-    file: `${dest}/DailymotionScript.js`,
-    format: 'cjs', // Use IIFE format for browser compatibility
-    sourcemap: false
-  },
-  plugins: [
-    del({ targets: `${dest}/*` }), // Clean up the dist folder before building
-    resolve(),
-    commonjs(),
-    typescript({ tsconfig: './tsconfig.json' }),
-    copy({
-      targets: [
-        { src: 'DailymotionConfig.json', dest },
-        { src: 'assets/dailymotion.png', dest },
-        { src: 'assets/index.html', dest },
-        { src: 'Readme.md', dest },
-      ]
-    })
-  ]
-};
+const resolve = require('@rollup/plugin-node-resolve').default;
+const commonjs = require('@rollup/plugin-commonjs');
+const typescript = require('@rollup/plugin-typescript');
+const copy = require('rollup-plugin-copy');
+const del = require('rollup-plugin-delete');
+
+const dest = './build'; // Output folder
+
+module.exports = {
+  input: 'src/DailymotionScript.ts', // Entry file
+  output: {
+    file: `${dest}/DailymotionScript.js`,
+    format: 'cjs', // Use IIFE format for browser compatibility
+    sourcemap: false
+  },
+  plugins: [
+    del({ targets: `${dest}/*` }), // Clean up the dist folder before building
+    resolve(),
+    commonjs(),
+    typescript({ tsconfig: './tsconfig.json' }),
+    copy({
+      targets: [
+        { src: 'DailymotionConfig.json', dest },
+        { src: 'assets/DailymotionIcon.png', dest },
+        { src: 'assets/index.html', dest }
+      ]
+    })
+  ]
+};
-- 
GitLab