mirror of https://github.com/VueTubeApp/VueTube
build: 🔇 Remove logs
This commit is contained in:
parent
e9a91aba81
commit
a50abeb8a3
|
@ -113,7 +113,7 @@ export default {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
if (result) this.$store.commit("updateRecommendedVideos", [result]);
|
if (result) this.$store.commit("updateRecommendedVideos", [result]);
|
||||||
})
|
})
|
||||||
.catch((error) => this.$logger("Home Page (Nav Refresh)", error, true));
|
.catch(error => {});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,6 @@ export default {
|
||||||
|
|
||||||
// --- External URL Handling --- //
|
// --- External URL Handling --- //
|
||||||
CapacitorApp.addListener("appUrlOpen", (event) => {
|
CapacitorApp.addListener("appUrlOpen", (event) => {
|
||||||
this.$logger("ExternalURL", event.url);
|
|
||||||
// We only push to the route if there is a url present
|
// We only push to the route if there is a url present
|
||||||
const result = linkParser(event.url);
|
const result = linkParser(event.url);
|
||||||
if (result) this.$router.push(result.pathname + result.search);
|
if (result) this.$router.push(result.pathname + result.search);
|
||||||
|
@ -192,11 +191,6 @@ export default {
|
||||||
searchBtn(text) {
|
searchBtn(text) {
|
||||||
const query = text;
|
const query = text;
|
||||||
|
|
||||||
this.$logger(
|
|
||||||
constants.LOGGER_NAMES.search,
|
|
||||||
"Query: " + query + " this.search: " + this.search
|
|
||||||
);
|
|
||||||
|
|
||||||
if (this.search === true) {
|
if (this.search === true) {
|
||||||
if (query) {
|
if (query) {
|
||||||
this.$store.commit("search/setLoading", true);
|
this.$store.commit("search/setLoading", true);
|
||||||
|
|
|
@ -68,7 +68,7 @@ export default {
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result) this.recommends = [result];
|
if (result) this.recommends = [result];
|
||||||
})
|
})
|
||||||
.catch((error) => this.$logger("Home Page", error, true));
|
.catch(error => {});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,76 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<v-list-item v-for="(item, index) in logs" :key="index">
|
|
||||||
<v-card
|
|
||||||
class="card background"
|
|
||||||
:class="$vuetify.theme.dark ? 'lighten-1' : 'darken-1'"
|
|
||||||
flat
|
|
||||||
:style="{ borderRadius: `${roundTweak / 2}rem` }"
|
|
||||||
>
|
|
||||||
<v-card-title>
|
|
||||||
<v-chip v-if="item.error" outlined class="errorChip" color="error"
|
|
||||||
>Error</v-chip
|
|
||||||
>
|
|
||||||
{{ item.name }}
|
|
||||||
<span
|
|
||||||
class="date background--text"
|
|
||||||
:class="$vuetify.theme.dark ? 'text--lighten-4' : 'text--darken-4'"
|
|
||||||
v-text="`• ${new Date(item.time).toLocaleString()}`"
|
|
||||||
/>
|
|
||||||
</v-card-title>
|
|
||||||
|
|
||||||
<v-expansion-panels>
|
|
||||||
<v-expansion-panel
|
|
||||||
class="background"
|
|
||||||
:class="$vuetify.theme.dark ? 'lighten-1' : 'darken-1'"
|
|
||||||
:style="{ borderRadius: `${roundTweak / 2}rem` }"
|
|
||||||
>
|
|
||||||
<v-expansion-panel-header>{{ lang.more }}</v-expansion-panel-header>
|
|
||||||
<v-expansion-panel-content class="logContent" v-text="item.data" />
|
|
||||||
</v-expansion-panel>
|
|
||||||
</v-expansion-panels>
|
|
||||||
</v-card>
|
|
||||||
</v-list-item>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.card {
|
|
||||||
width: 100%;
|
|
||||||
margin: 1em 0 1em 0;
|
|
||||||
}
|
|
||||||
.date {
|
|
||||||
margin: 0.4em;
|
|
||||||
font-size: 0.75em;
|
|
||||||
transform: translateY(5%);
|
|
||||||
}
|
|
||||||
.errorChip {
|
|
||||||
margin-right: 0.5em;
|
|
||||||
}
|
|
||||||
.logContent {
|
|
||||||
padding: 1em;
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
computed: {
|
|
||||||
roundTweak() {
|
|
||||||
return this.$store.state.tweaks.roundTweak;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
logs: new Array(),
|
|
||||||
lang: {},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
const logs = this.$youtube.logs;
|
|
||||||
this.logs = logs;
|
|
||||||
|
|
||||||
this.lang = this.$lang("mods").logs;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
|
@ -112,11 +112,6 @@ export default {
|
||||||
icon: "mdi-cloud-download-outline",
|
icon: "mdi-cloud-download-outline",
|
||||||
to: "/mods/updates",
|
to: "/mods/updates",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "Logs",
|
|
||||||
icon: "mdi-text-box-outline",
|
|
||||||
to: "/mods/logs",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "About",
|
name: "About",
|
||||||
icon: "mdi-information-outline",
|
icon: "mdi-information-outline",
|
||||||
|
|
|
@ -355,7 +355,6 @@ export default {
|
||||||
this.interactions[0].value = result.metadata.likes.toLocaleString();
|
this.interactions[0].value = result.metadata.likes.toLocaleString();
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
this.recommends = result.renderedData.recommendations;
|
this.recommends = result.renderedData.recommendations;
|
||||||
// .catch((error) => this.$logger("Watch", error, true));
|
|
||||||
console.log("recommendations:", this.recommends);
|
console.log("recommendations:", this.recommends);
|
||||||
|
|
||||||
//--- API WatchTime call ---//
|
//--- API WatchTime call ---//
|
||||||
|
|
|
@ -25,15 +25,6 @@ module.exports = {
|
||||||
URLS: url,
|
URLS: url,
|
||||||
YT_API_VALUES: ytApiVal,
|
YT_API_VALUES: ytApiVal,
|
||||||
fs: filesystem,
|
fs: filesystem,
|
||||||
LOGGER_NAMES: {
|
|
||||||
search: "Search",
|
|
||||||
autoComplete: "AutoComplete",
|
|
||||||
watch: "Watch",
|
|
||||||
recommendations: "Recommendations",
|
|
||||||
init: "Initialize",
|
|
||||||
innertube: "Innertube",
|
|
||||||
channel: "Channel",
|
|
||||||
},
|
|
||||||
|
|
||||||
INNERTUBE_HEADER: (info) => {
|
INNERTUBE_HEADER: (info) => {
|
||||||
let headers = {
|
let headers = {
|
||||||
|
|
|
@ -7,16 +7,6 @@ import { Buffer } from "buffer";
|
||||||
import iconv from "iconv-lite";
|
import iconv from "iconv-lite";
|
||||||
import { Toast } from "@capacitor/toast";
|
import { Toast } from "@capacitor/toast";
|
||||||
|
|
||||||
//--- Logger Function ---//
|
|
||||||
function logger(func, data, isError = false) {
|
|
||||||
searchModule.logs.unshift({
|
|
||||||
name: func,
|
|
||||||
time: Date.now(),
|
|
||||||
data: data,
|
|
||||||
error: isError,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getEncoding(contentType) {
|
function getEncoding(contentType) {
|
||||||
const re = /charset=([^()<>@,;:\"/[\]?.=\s]*)/i;
|
const re = /charset=([^()<>@,;:\"/[\]?.=\s]*)/i;
|
||||||
const content = re.exec(contentType);
|
const content = re.exec(contentType);
|
||||||
|
@ -40,11 +30,9 @@ const searchModule = {
|
||||||
const buffer = Buffer.from(res.data, "base64");
|
const buffer = Buffer.from(res.data, "base64");
|
||||||
// convert res.data from iso-8859-1 to utf-8
|
// convert res.data from iso-8859-1 to utf-8
|
||||||
const data = iconv.decode(buffer, getEncoding(contentType));
|
const data = iconv.decode(buffer, getEncoding(contentType));
|
||||||
logger(constants.LOGGER_NAMES.autoComplete, data);
|
|
||||||
callback(data);
|
callback(data);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
logger(constants.LOGGER_NAMES.autoComplete, err, true);
|
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -56,11 +44,9 @@ const searchModule = {
|
||||||
params: { videoId: id },
|
params: { videoId: id },
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
logger("rydData", res.data);
|
|
||||||
callback(res.data);
|
callback(res.data);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
logger("codeRun", err, true);
|
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -71,11 +57,9 @@ const searchModule = {
|
||||||
params: { videoID: id },
|
params: { videoID: id },
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
logger("sponsorBlock", res.data);
|
|
||||||
callback(res.data);
|
callback(res.data);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
logger("codeRun", err, true);
|
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -95,7 +79,6 @@ const innertubeModule = {
|
||||||
if (!InnertubeAPI) {
|
if (!InnertubeAPI) {
|
||||||
InnertubeAPI = await Innertube.createAsync(
|
InnertubeAPI = await Innertube.createAsync(
|
||||||
(message, isError, shortMessage) => {
|
(message, isError, shortMessage) => {
|
||||||
logger(constants.LOGGER_NAMES.innertube, message, isError);
|
|
||||||
if (shortMessage) {
|
if (shortMessage) {
|
||||||
Toast.show({ text: shortMessage });
|
Toast.show({ text: shortMessage });
|
||||||
}
|
}
|
||||||
|
@ -109,7 +92,6 @@ const innertubeModule = {
|
||||||
try {
|
try {
|
||||||
return await InnertubeAPI.VidInfoAsync(id);
|
return await InnertubeAPI.VidInfoAsync(id);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger(constants.LOGGER_NAMES.watch, error, true);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -132,7 +114,6 @@ const innertubeModule = {
|
||||||
const response = await InnertubeAPI.getChannelAsync(url);
|
const response = await InnertubeAPI.getChannelAsync(url);
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger(constants.LOGGER_NAMES.channel, error, true);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -197,7 +178,6 @@ const innertubeModule = {
|
||||||
const response = await InnertubeAPI.getSearchAsync(query);
|
const response = await InnertubeAPI.getSearchAsync(query);
|
||||||
return response.contents.sectionListRenderer;
|
return response.contents.sectionListRenderer;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger(constants.LOGGER_NAMES.search, err, true);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -209,7 +189,5 @@ const innertubeModule = {
|
||||||
//--- Start ---//
|
//--- Start ---//
|
||||||
export default ({ app }, inject) => {
|
export default ({ app }, inject) => {
|
||||||
inject("youtube", { ...searchModule, ...innertubeModule });
|
inject("youtube", { ...searchModule, ...innertubeModule });
|
||||||
inject("logger", logger);
|
|
||||||
inject("rendererUtils", rendererUtils);
|
inject("rendererUtils", rendererUtils);
|
||||||
};
|
};
|
||||||
logger(constants.LOGGER_NAMES.init, "Program Started");
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue