Translate labels and log messages
This commit is contained in:
parent
9597cddc80
commit
8f8f0c3cb0
22
src/main.ts
22
src/main.ts
|
@ -25,11 +25,11 @@ async function register({
|
||||||
|
|
||||||
registerSetting({
|
registerSetting({
|
||||||
name: "ytb-urls",
|
name: "ytb-urls",
|
||||||
label: "liste des urls youtube a auto-importer",
|
label: 'URL list of Youtube channel to synchronize',
|
||||||
type: "input-textarea",
|
type: "input-textarea",
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.warn("setting register");
|
logger.debug("setting register");
|
||||||
fs.appendFileSync(path.join(basePath, "/storage.bd"), "");
|
fs.appendFileSync(path.join(basePath, "/storage.bd"), "");
|
||||||
|
|
||||||
const configAggregator = await ListenerRssAggregator.instantiateAggregator(
|
const configAggregator = await ListenerRssAggregator.instantiateAggregator(
|
||||||
|
@ -43,12 +43,12 @@ async function register({
|
||||||
password: "test",
|
password: "test",
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.warn("Aggregator created");
|
logger.debug("Aggregator created");
|
||||||
|
|
||||||
const inputs = await settingsManager.getSetting("ytb-urls");
|
const inputs = await settingsManager.getSetting("ytb-urls");
|
||||||
if (inputs) await addListeners(inputs);
|
if (inputs) await addListeners(inputs);
|
||||||
|
|
||||||
logger.warn("Config loaded");
|
logger.debug("Config loaded");
|
||||||
|
|
||||||
settingsManager.onSettingsChange(async (settings: any) => {
|
settingsManager.onSettingsChange(async (settings: any) => {
|
||||||
await addListeners(settings["ytb-urls"]);
|
await addListeners(settings["ytb-urls"]);
|
||||||
|
@ -58,11 +58,10 @@ async function register({
|
||||||
const datas = listenersDataBinding.get(entries.addressListener);
|
const datas = listenersDataBinding.get(entries.addressListener);
|
||||||
if (!datas) return;
|
if (!datas) return;
|
||||||
|
|
||||||
logger.warn(
|
logger.debug(
|
||||||
"Nouvelles entrées détéctées: " +
|
"New entries detected from channel #%i: %s",
|
||||||
JSON.stringify(entries) +
|
datas.channelId,
|
||||||
" de " +
|
JSON.stringify(entries)
|
||||||
datas.channelId
|
|
||||||
);
|
);
|
||||||
for (const item of entries.items)
|
for (const item of entries.items)
|
||||||
peertube.apiRequest({
|
peertube.apiRequest({
|
||||||
|
@ -77,7 +76,7 @@ async function addListeners(listenerInput: string) {
|
||||||
try {
|
try {
|
||||||
listeners = JSON.parse(listenerInput);
|
listeners = JSON.parse(listenerInput);
|
||||||
} catch {
|
} catch {
|
||||||
logger.warn("Erreur: malformé");
|
logger.error("Malformed URL");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let newListeners = listeners.filter(
|
let newListeners = listeners.filter(
|
||||||
|
@ -97,14 +96,13 @@ async function addListeners(listenerInput: string) {
|
||||||
myManager.stopAll();
|
myManager.stopAll();
|
||||||
await myManager.saveOverride(listeners);
|
await myManager.saveOverride(listeners);
|
||||||
|
|
||||||
if (logger) logger.warn("Configuration modifiée: " + listenerInput);
|
if (logger) logger.warn("Configuration changed: " + listenerInput);
|
||||||
|
|
||||||
myManager.startAll();
|
myManager.startAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function unregister() {
|
async function unregister() {
|
||||||
myManager.stopAll();
|
myManager.stopAll();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user