diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml deleted file mode 100644 index ae28077..0000000 --- a/.github/workflows/nightly-release.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: nightly-release - -# Controls when the workflow will run -on: - # Triggers the workflow on on a schedule - schedule: - # Runs "at 0:00 UTC every day" (see https://crontab.guru) - - cron: '0 0 * * *' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -env: - NODE_VERSION: 16 - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - name: Build web assets - runs-on: ubuntu-latest - needs: check_date - if: ${{ needs.check_date.outputs.should_run != 'false' }} - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: main - - name: Set up Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Install dependencies - run: npm i; cd NUXT; npm i - - name: Set App Version - working-directory: NUXT - run: sed -i 's/dev-local/${{ github.sha }}/' nuxt.config.js - - name: Build web assets - working-directory: NUXT - run: npm run generate - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: dist - path: dist - android: - name: Build Android platform - runs-on: ubuntu-latest - needs: [build] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: dist - path: dist - - name: Set up Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Install dependencies - run: npm i - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Copy web assets to native platform - run: npx cap copy android - - name: Update native platform - run: npx cap update android - - name: Build with Gradle - working-directory: android - run: chmod +x gradlew; ./gradlew clean assembleRelease -x test -Pandroid.injected.signing.store.file=/home/runner/work/VueTube/VueTube/android/key.jks -Pandroid.injected.signing.store.password=${{ secrets.ANDROID_STORE_PASSWORD }} -Pandroid.injected.signing.key.alias=${{ secrets.ANDROID_KEY_ALIAS }} -Pandroid.injected.signing.key.password=${{ secrets.ANDROID_KEY_PASSWORD }} - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: android - path: android/app/build/outputs/apk/release/app-release.apk - - ios: - name: Build iOS platform - runs-on: macos-latest - needs: [build] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: dist - path: dist - - name: Set up Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v2 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Install dependencies - run: npm i - - name: Copy web assets to native platform - run: npx cap copy ios - - name: Update native platform - run: npx cap update ios - - name: Add empty `GoogleService-Info.plist` - run: echo "$GOOGLE_SERVICE_INFO_PLIST" > ios/App/App/GoogleService-Info.plist - env: - GOOGLE_SERVICE_INFO_PLIST: ${{secrets.GOOGLE_SERVICE_INFO_PLIST}} - - name: Build and archive with xcodebuild - working-directory: ios - run: xcodebuild - -workspace App/App.xcworkspace - -scheme App - -archivePath App/build/App.xarchive - clean build archive - CODE_SIGN_IDENTITY="" - CODE_SIGNING_REQUIRED=NO - CODE_SIGNING_ALLOWED="NO" - CODE_SIGN_ENTITLEMENTS="" - - name: Make IPA - run: mkdir Payload && mv ~/Library/Developer/Xcode/DerivedData/App-*/Build/Products/Debug-iphoneos/App.app Payload && zip -r Payload.zip Payload && mv Payload.zip VueTube.ipa - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: iOS - path: VueTube.ipa - - check_date: - runs-on: ubuntu-latest - name: Check latest commit - outputs: - should_run: ${{ steps.should_run.outputs.should_run }} - steps: - - uses: actions/checkout@v2 - - name: print latest_commit - run: echo ${{ github.sha }} - - - id: should_run - continue-on-error: true - name: check latest commit is less than a day - if: ${{ github.event_name == 'schedule' }} - run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false" diff --git a/NUXT/pages/mods/plugins.vue b/NUXT/pages/mods/plugins.vue index f4ed81f..ffac184 100644 --- a/NUXT/pages/mods/plugins.vue +++ b/NUXT/pages/mods/plugins.vue @@ -1,5 +1,16 @@ + + diff --git a/NUXT/pages/settings.vue b/NUXT/pages/settings.vue index 92ff07a..7d89296 100644 --- a/NUXT/pages/settings.vue +++ b/NUXT/pages/settings.vue @@ -105,9 +105,7 @@ export default { { name: "Plugins", icon: "mdi-puzzle", - to: "", - to: "/mods/plugins", - disabled: true, + to: "/mods/plugins" }, { name: "Updates", diff --git a/NUXT/plugins/constants.js b/NUXT/plugins/constants.js index 3ad81f0..e44fb99 100644 --- a/NUXT/plugins/constants.js +++ b/NUXT/plugins/constants.js @@ -18,8 +18,7 @@ const ytApiVal = { }; const filesystem = { - plugins: "vuetube/plugins", - temp: "vuetube/temp", + plugins: "plugins" }; module.exports = { diff --git a/NUXT/plugins/tempPlugins/demoPlugin.js b/NUXT/plugins/tempPlugins/demoPlugin.js index 94f5d66..d305317 100644 --- a/NUXT/plugins/tempPlugins/demoPlugin.js +++ b/NUXT/plugins/tempPlugins/demoPlugin.js @@ -13,7 +13,7 @@ module.exports = { * Execute code on ALL VueTube pages ************************/ global: function() { - + console.log("This code is now executed when ALL vuetube pages (including settings) are loaded.") }, /************************* diff --git a/NUXT/plugins/thirdPartyPluginLoader.js b/NUXT/plugins/thirdPartyPluginLoader.js index 648efee..ee1435b 100644 --- a/NUXT/plugins/thirdPartyPluginLoader.js +++ b/NUXT/plugins/thirdPartyPluginLoader.js @@ -3,16 +3,10 @@ import { Filesystem, Directory, Encoding } from '@capacitor/filesystem'; import { fs } from './constants'; //--- Set Up App Directory ---// -const APP_DIRECTORY = Directory.Documents; - +const APP_DIRECTORY = Directory.Data; +//--- Ensure Plugins Folder ---// const ensureStructure = new Promise(async (resolve, reject) => { - const perms = await Filesystem.checkPermissions(); - if (perms.publicStorage !== "granted") { - perms = await Filesystem.requestPermissions(); - } - - //--- Ensure Plugins Folder ---// try { await Filesystem.mkdir({ directory: APP_DIRECTORY, recursive: true, @@ -20,52 +14,37 @@ const ensureStructure = new Promise(async (resolve, reject) => { }); } catch (e) { /* Exists */ } - //--- Ensure Temp Folder ---// - try { - await Filesystem.mkdir({ - directory: APP_DIRECTORY, recursive: true, - path: fs.temp, - }); - } catch (e) { /* Exists */ } - - perms - ? resolve(true) - : reject(false) - + resolve(); }) - const module = { - - //--- Get Plugins ---// + //--- List Plugins ---// list: new Promise(async (resolve, reject) => { - let plugins = new Array(); - if (await !ensureStructure) reject("Invalid Structure"); + await ensureStructure(); - // Temp Plugin List - plugins = Filesystem.readdir({ - directory: APP_DIRECTORY, - path: fs.plugins - }) - // End Temp Plugin List + const plugins = await Filesystem.readdir({ + path: fs.plugins, + directory: APP_DIRECTORY + }).catch(err => { reject(err) }) resolve(plugins); + }), - //--- End Get Plugins ---// - //--- Delete Plugin ---// - list: async (pluginName) => { - - console.log(fs.plugins); - /* - const contents = await Filesystem.readFile({ - path: 'secrets/text.txt', - directory: Directory.Documents, - encoding: Encoding.UTF8, - }); - */ + async addPlugin(content) { + await ensureStructure(); + new Promise(async (resolve, reject) => { + const fileName = require("./utils").getCpn(); // Im not sure what this is actually meant for but im using it as a random string generator + console.log("Saving Plugin As"+ fileName) + await Filesystem.writeFile({ + path: fs.plugins+"/"+fileName+".js", + directory: APP_DIRECTORY, + data: content, + encoding: Encoding.UTF8, + }); + }) } diff --git a/NUXT/plugins/vuetube.js b/NUXT/plugins/vuetube.js index fc2d008..018ef5b 100644 --- a/NUXT/plugins/vuetube.js +++ b/NUXT/plugins/vuetube.js @@ -134,28 +134,22 @@ const module = { humanTime(seconds = 0) { seconds = Math.floor(seconds); // Not doing this seems to break the calculation let levels = [ - Math.floor(seconds / 31536000), //Years - Math.floor((seconds % 31536000) / 86400), //Days - Math.floor(((seconds % 31536000) % 86400) / 3600), //Hours + Math.floor(seconds / 31536000) || null, //Years + Math.floor((seconds % 31536000) / 86400) || null, //Days + Math.floor(((seconds % 31536000) % 86400) / 3600) || null, //Hours Math.floor((((seconds % 31536000) % 86400) % 3600) / 60), //Minutes - (((seconds % 31536000) % 86400) % 3600) % 60, //Seconds + Math.floor((((seconds % 31536000) % 86400) % 3600) % 60), //Seconds ]; + levels = levels.filter((level) => level !== null); - let returntext = new String(); - for (const i in levels) { - const num = - levels[i].toString().length == 1 ? "0" + levels[i] : levels[i]; // If Number Is Single Digit, Add 0 In Front - returntext += ":" + num; + for (let i = 1; i < levels.length; i++) { + levels[i] = levels[i].toString().padStart(2, "0"); } - while (returntext.startsWith(":00")) { - returntext = returntext.substring(3); - } // Remove Prepending 0s (eg. 00:00:00:01:00) - if (returntext.startsWith(":0")) { - returntext = returntext.substring(2); - } else { - returntext = returntext.substring(1); - } // Prevent Time Starting With 0 (eg. 01:00) - // console.log("Human Time:", returntext); + + // join the array into a string with : as a separator + const returntext = levels.join(":"); + + console.log("Human Time:", returntext); return returntext; }, //--- End Convert Time To Human Readable String ---// diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 2bc26f5..c84576a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -8,8 +8,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/AppTheme" - android:requestLegacyExternalStorage="true"> + android:theme="@style/AppTheme"> - - diff --git a/android/app/src/main/res/xml/config.xml b/android/app/src/main/res/xml/config.xml index 0886a47..1b1b0e0 100644 --- a/android/app/src/main/res/xml/config.xml +++ b/android/app/src/main/res/xml/config.xml @@ -2,9 +2,5 @@ - - - - \ No newline at end of file diff --git a/android/capacitor-cordova-android-plugins/src/main/java/cordova/plugins/screenorientation/CDVOrientation.java b/android/capacitor-cordova-android-plugins/src/main/java/cordova/plugins/screenorientation/CDVOrientation.java deleted file mode 100644 index 5dc845e..0000000 --- a/android/capacitor-cordova-android-plugins/src/main/java/cordova/plugins/screenorientation/CDVOrientation.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -package cordova.plugins.screenorientation; - -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; - -import org.json.JSONArray; -import org.json.JSONException; - -import android.app.Activity; -import android.content.pm.ActivityInfo; -import android.util.Log; - -public class CDVOrientation extends CordovaPlugin { - - private static final String TAG = "YoikScreenOrientation"; - - /** - * Screen Orientation Constants - */ - - private static final String ANY = "any"; - private static final String PORTRAIT_PRIMARY = "portrait-primary"; - private static final String PORTRAIT_SECONDARY = "portrait-secondary"; - private static final String LANDSCAPE_PRIMARY = "landscape-primary"; - private static final String LANDSCAPE_SECONDARY = "landscape-secondary"; - private static final String PORTRAIT = "portrait"; - private static final String LANDSCAPE = "landscape"; - - @Override - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) { - - Log.d(TAG, "execute action: " + action); - - // Route the Action - if (action.equals("screenOrientation")) { - return routeScreenOrientation(args, callbackContext); - } - - // Action not found - callbackContext.error("action not recognised"); - return false; - } - - private boolean routeScreenOrientation(JSONArray args, CallbackContext callbackContext) { - - String action = args.optString(0); - - - - String orientation = args.optString(1); - - Log.d(TAG, "Requested ScreenOrientation: " + orientation); - - Activity activity = cordova.getActivity(); - - if (orientation.equals(ANY)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); - } else if (orientation.equals(LANDSCAPE_PRIMARY)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - } else if (orientation.equals(PORTRAIT_PRIMARY)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - } else if (orientation.equals(LANDSCAPE)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); - } else if (orientation.equals(PORTRAIT)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); - } else if (orientation.equals(LANDSCAPE_SECONDARY)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); - } else if (orientation.equals(PORTRAIT_SECONDARY)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); - } - - callbackContext.success(); - return true; - - - } -} \ No newline at end of file diff --git a/ios/App/App/config.xml b/ios/App/App/config.xml index b43c248..1b1b0e0 100644 --- a/ios/App/App/config.xml +++ b/ios/App/App/config.xml @@ -2,9 +2,5 @@ - - - - \ No newline at end of file diff --git a/ios/App/Podfile b/ios/App/Podfile index 323ce86..d3fc14a 100644 --- a/ios/App/Podfile +++ b/ios/App/Podfile @@ -9,18 +9,17 @@ install! 'cocoapods', :disable_input_output_paths => true def capacitor_pods pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' - pod 'CapacitorCommunityHttp', :path => '../../node_modules/@capacitor-community/http' - pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app' - pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser' - pod 'CapacitorDevice', :path => '../../node_modules/@capacitor/device' - pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem' - pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics' - pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share' - pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen' - pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar' - pod 'CapacitorToast', :path => '../../node_modules/@capacitor/toast' - pod 'HugotomaziCapacitorNavigationBar', :path => '../../node_modules/@hugotomazi/capacitor-navigation-bar' - pod 'CordovaPlugins', :path => '../capacitor-cordova-ios-plugins' + pod 'CapacitorCommunityHttp', :path => '..\..\node_modules\@capacitor-community\http' + pod 'CapacitorApp', :path => '..\..\node_modules\@capacitor\app' + pod 'CapacitorBrowser', :path => '..\..\node_modules\@capacitor\browser' + pod 'CapacitorDevice', :path => '..\..\node_modules\@capacitor\device' + pod 'CapacitorFilesystem', :path => '..\..\node_modules\@capacitor\filesystem' + pod 'CapacitorHaptics', :path => '..\..\node_modules\@capacitor\haptics' + pod 'CapacitorShare', :path => '..\..\node_modules\@capacitor\share' + pod 'CapacitorSplashScreen', :path => '..\..\node_modules\@capacitor\splash-screen' + pod 'CapacitorStatusBar', :path => '..\..\node_modules\@capacitor\status-bar' + pod 'CapacitorToast', :path => '..\..\node_modules\@capacitor\toast' + pod 'HugotomaziCapacitorNavigationBar', :path => '..\..\node_modules\@hugotomazi\capacitor-navigation-bar' end target 'App' do diff --git a/readme.md b/readme.md index 83feddb..f29afb6 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@

- VueTube icon + VueTube icon
Logo by @afnzmn