0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-26 05:05:23 +00:00

feat: Plugin stuff

update how plugins are handled & disabled plugin button for release
This commit is contained in:
Front 2022-04-06 20:23:01 -04:00
parent 19ca328a90
commit fd673172a6
5 changed files with 65 additions and 15 deletions

View file

@ -50,13 +50,6 @@ export default {
await this.$youtube.getAPI();
this.progressMsg = "Launching";
//--- April First Joke ---//
if (Math.floor(Math.random() * 9 == 0)) {
this.$router.push("/watch?v=dQw4w9WgXcQ");
return;
}
//----------------------------//
this.$router.push(`/${localStorage.getItem("startPage") || "home"}`);
},
};

View file

@ -51,7 +51,7 @@ export default {
to: "/mods/tweaks",
},
{ name: "Startup Options", icon: "mdi-restart", to: "/mods/startup" },
{ name: "Plugins", icon: "mdi-puzzle", to: "", to: "/mods/plugins" },
{ name: "Plugins", icon: "mdi-puzzle", to: "", to: "/mods/plugins", disabled: true },
{
name: "Updates",
icon: "mdi-cloud-download-outline",

View file

@ -16,9 +16,15 @@ const ytApiVal = {
CLIENT_WEB: 2,
};
const filesystem = {
plugins: "vuetube/plugins",
temp: "vuetube/temp",
}
module.exports = {
URLS: url,
YT_API_VALUES: ytApiVal,
fs: filesystem,
LOGGER_NAMES: {
search: "Search",
autoComplete: "AutoComplete",

View file

@ -1,21 +1,71 @@
//--- Modules/Imports ---//
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
import { fs } from './constants';
//--- Set Up App Directory ---//
const APP_DIRECTORY = Directory.Documents;
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,
path: fs.plugins,
});
} 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)
})
const module = {
//--- Get Plugins ---//
list: new Promise((resolve, reject) => {
list: new Promise(async (resolve, reject) => {
let plugins = new Array();
if (await !ensureStructure) reject("Invalid Structure");
// Temp Plugin List
plugins.push(require("~/plugins/tempPlugins/demoPlugin"))
// End Temp Plugin List
resolve(plugins);
plugins = Filesystem.readdir({
directory: APP_DIRECTORY,
path: fs.plugins
})
// End Temp Plugin List
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,
});
*/
}
};

View file

@ -8,7 +8,8 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:requestLegacyExternalStorage="true">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"