0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-22 03:05:15 +00:00

build: 🔇 Remove logs

This commit is contained in:
Kenny 2022-08-07 23:49:43 -04:00
parent e9a91aba81
commit a50abeb8a3
9 changed files with 2 additions and 121 deletions

View file

@ -113,7 +113,7 @@ export default {
console.log(result);
if (result) this.$store.commit("updateRecommendedVideos", [result]);
})
.catch((error) => this.$logger("Home Page (Nav Refresh)", error, true));
.catch(error => {});
},
},

View file

@ -135,7 +135,6 @@ export default {
// --- External URL Handling --- //
CapacitorApp.addListener("appUrlOpen", (event) => {
this.$logger("ExternalURL", event.url);
// We only push to the route if there is a url present
const result = linkParser(event.url);
if (result) this.$router.push(result.pathname + result.search);
@ -192,11 +191,6 @@ export default {
searchBtn(text) {
const query = text;
this.$logger(
constants.LOGGER_NAMES.search,
"Query: " + query + " this.search: " + this.search
);
if (this.search === true) {
if (query) {
this.$store.commit("search/setLoading", true);

View file

@ -68,7 +68,7 @@ export default {
.then((result) => {
if (result) this.recommends = [result];
})
.catch((error) => this.$logger("Home Page", error, true));
.catch(error => {});
}
},
};

View file

@ -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>

View file

@ -112,11 +112,6 @@ export default {
icon: "mdi-cloud-download-outline",
to: "/mods/updates",
},
{
name: "Logs",
icon: "mdi-text-box-outline",
to: "/mods/logs",
},
{
name: "About",
icon: "mdi-information-outline",

View file

@ -355,7 +355,6 @@ export default {
this.interactions[0].value = result.metadata.likes.toLocaleString();
this.loaded = true;
this.recommends = result.renderedData.recommendations;
// .catch((error) => this.$logger("Watch", error, true));
console.log("recommendations:", this.recommends);
//--- API WatchTime call ---//

View file

@ -25,15 +25,6 @@ module.exports = {
URLS: url,
YT_API_VALUES: ytApiVal,
fs: filesystem,
LOGGER_NAMES: {
search: "Search",
autoComplete: "AutoComplete",
watch: "Watch",
recommendations: "Recommendations",
init: "Initialize",
innertube: "Innertube",
channel: "Channel",
},
INNERTUBE_HEADER: (info) => {
let headers = {

View file

@ -7,16 +7,6 @@ import { Buffer } from "buffer";
import iconv from "iconv-lite";
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) {
const re = /charset=([^()<>@,;:\"/[\]?.=\s]*)/i;
const content = re.exec(contentType);
@ -40,11 +30,9 @@ const searchModule = {
const buffer = Buffer.from(res.data, "base64");
// convert res.data from iso-8859-1 to utf-8
const data = iconv.decode(buffer, getEncoding(contentType));
logger(constants.LOGGER_NAMES.autoComplete, data);
callback(data);
})
.catch((err) => {
logger(constants.LOGGER_NAMES.autoComplete, err, true);
callback(err);
});
},
@ -56,11 +44,9 @@ const searchModule = {
params: { videoId: id },
})
.then((res) => {
logger("rydData", res.data);
callback(res.data);
})
.catch((err) => {
logger("codeRun", err, true);
callback(err);
});
},
@ -71,11 +57,9 @@ const searchModule = {
params: { videoID: id },
})
.then((res) => {
logger("sponsorBlock", res.data);
callback(res.data);
})
.catch((err) => {
logger("codeRun", err, true);
callback(err);
});
},
@ -95,7 +79,6 @@ const innertubeModule = {
if (!InnertubeAPI) {
InnertubeAPI = await Innertube.createAsync(
(message, isError, shortMessage) => {
logger(constants.LOGGER_NAMES.innertube, message, isError);
if (shortMessage) {
Toast.show({ text: shortMessage });
}
@ -109,7 +92,6 @@ const innertubeModule = {
try {
return await InnertubeAPI.VidInfoAsync(id);
} catch (error) {
logger(constants.LOGGER_NAMES.watch, error, true);
}
},
@ -132,7 +114,6 @@ const innertubeModule = {
const response = await InnertubeAPI.getChannelAsync(url);
return response.data;
} catch (error) {
logger(constants.LOGGER_NAMES.channel, error, true);
}
},
@ -197,7 +178,6 @@ const innertubeModule = {
const response = await InnertubeAPI.getSearchAsync(query);
return response.contents.sectionListRenderer;
} catch (err) {
logger(constants.LOGGER_NAMES.search, err, true);
}
},
@ -209,7 +189,5 @@ const innertubeModule = {
//--- Start ---//
export default ({ app }, inject) => {
inject("youtube", { ...searchModule, ...innertubeModule });
inject("logger", logger);
inject("rendererUtils", rendererUtils);
};
logger(constants.LOGGER_NAMES.init, "Program Started");

Binary file not shown.