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:
parent
19ca328a90
commit
fd673172a6
5 changed files with 65 additions and 15 deletions
|
@ -49,14 +49,7 @@ export default {
|
||||||
await theming;
|
await theming;
|
||||||
await this.$youtube.getAPI();
|
await this.$youtube.getAPI();
|
||||||
this.progressMsg = "Launching";
|
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"}`);
|
this.$router.push(`/${localStorage.getItem("startPage") || "home"}`);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -51,7 +51,7 @@ export default {
|
||||||
to: "/mods/tweaks",
|
to: "/mods/tweaks",
|
||||||
},
|
},
|
||||||
{ name: "Startup Options", icon: "mdi-restart", to: "/mods/startup" },
|
{ 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",
|
name: "Updates",
|
||||||
icon: "mdi-cloud-download-outline",
|
icon: "mdi-cloud-download-outline",
|
||||||
|
|
|
@ -16,9 +16,15 @@ const ytApiVal = {
|
||||||
CLIENT_WEB: 2,
|
CLIENT_WEB: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const filesystem = {
|
||||||
|
plugins: "vuetube/plugins",
|
||||||
|
temp: "vuetube/temp",
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
URLS: url,
|
URLS: url,
|
||||||
YT_API_VALUES: ytApiVal,
|
YT_API_VALUES: ytApiVal,
|
||||||
|
fs: filesystem,
|
||||||
LOGGER_NAMES: {
|
LOGGER_NAMES: {
|
||||||
search: "Search",
|
search: "Search",
|
||||||
autoComplete: "AutoComplete",
|
autoComplete: "AutoComplete",
|
||||||
|
|
|
@ -1,21 +1,71 @@
|
||||||
//--- Modules/Imports ---//
|
//--- 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 = {
|
const module = {
|
||||||
|
|
||||||
|
|
||||||
//--- Get Plugins ---//
|
//--- Get Plugins ---//
|
||||||
list: new Promise((resolve, reject) => {
|
list: new Promise(async (resolve, reject) => {
|
||||||
let plugins = new Array();
|
let plugins = new Array();
|
||||||
|
|
||||||
|
if (await !ensureStructure) reject("Invalid Structure");
|
||||||
|
|
||||||
// Temp Plugin List
|
// Temp Plugin List
|
||||||
plugins.push(require("~/plugins/tempPlugins/demoPlugin"))
|
plugins = Filesystem.readdir({
|
||||||
|
directory: APP_DIRECTORY,
|
||||||
|
path: fs.plugins
|
||||||
|
})
|
||||||
// End Temp Plugin List
|
// End Temp Plugin List
|
||||||
|
|
||||||
resolve(plugins);
|
resolve(plugins);
|
||||||
|
}),
|
||||||
})
|
|
||||||
//--- End Get 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,
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,7 +8,8 @@
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme"
|
||||||
|
android:requestLegacyExternalStorage="true">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
||||||
|
|
Loading…
Reference in a new issue