Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' of github.com:mtdvlpr/mmm-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdvlpr committed Oct 17, 2024
2 parents c479a68 + e2058cf commit 2ef065e
Show file tree
Hide file tree
Showing 45 changed files with 315 additions and 213 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@types/fs-extra": "^11.0.4",
"@types/heic-convert": "^2.1.0",
"@types/klaw-sync": "^6.0.5",
"@types/node": "^20.16.11",
"@types/node": "^20.16.12",
"@types/pretty-bytes": "^5.2.0",
"@types/sanitize-html": "^2",
"@typescript-eslint/eslint-plugin": "^7.18.0",
Expand Down
2 changes: 1 addition & 1 deletion src/boot/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const get = async (url: string, params?: AxiosRequestConfig) => {
returnVal = await axios.get(url, { params }).catch((error) => {
if (
!(error instanceof AxiosError) ||
(error.status !== 400 && error.status !== 404)
![400, 404].includes(error.status ?? 0)
)
errorCatcher(error);
return { data: undefined };
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialog/DialogCongregationLookup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
jwLanguages.list?.find(
(l) =>
l.langcode === congregation?.properties?.languageCode,
)?.name
)?.vernacularName
}}</q-item-label>
</q-item-section>
</q-item>
Expand Down
6 changes: 3 additions & 3 deletions src/components/header/HeaderBase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
<HeaderCongregation
v-if="route.fullPath.includes('congregation-selector')"
/>
<HeaderCalendar v-else-if="route.fullPath === '/media-calendar'" />
<HeaderSettings v-else-if="route.fullPath === '/settings'" />
<HeaderWebsite v-else-if="route.fullPath === '/present-website'" />
<HeaderCalendar v-else-if="route.fullPath.includes('/media-calendar')" />
<HeaderSettings v-else-if="route.fullPath.includes('/settings')" />
<HeaderWebsite v-else-if="route.fullPath.includes('/present-website')" />
</div>
</div>
</q-header>
Expand Down
9 changes: 5 additions & 4 deletions src/components/media/MusicButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,11 @@ onMounted(() => {
try {
meetingDay.value = !!newToday && !!newMeeting;
if (
currentSettings.value?.enableMusicButton &&
currentSettings.value?.autoStartMusic &&
meetingDay.value &&
remainingTimeBeforeMeetingStart() > 90
currentSettings.value?.enableMusicButton && // background music feature is enabled
currentSettings.value?.autoStartMusic && // auto-start music is enabled
meetingDay.value && // today is a meeting day
remainingTimeBeforeMeetingStart() > 90 && // meeting is starting in at least 90 seconds
remainingTimeBeforeMeetingStart() < 60 * 60 * 2 // meeting is starting in less than 2 hours
) {
playMusic();
}
Expand Down
12 changes: 2 additions & 10 deletions src/components/media/ObsStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,8 @@ const obsCloseHandler = () => {
const obsErrorHandler = (err: OBSWebSocketError) => {
obsMessage.value = 'obs.error';
if (
!(
err?.code === -1 ||
err?.code === 1001 ||
err?.code === 1006 ||
err?.code === 4009
)
) {
if (err?.code && ![-1, 1001, 1006, 4009].includes(err.code))
errorCatcher(err);
}
};
const obsConnect = async (setup?: boolean) => {
Expand Down Expand Up @@ -202,7 +194,7 @@ const obsConnect = async (setup?: boolean) => {
break;
}
} catch (err) {
errorCatcher(err);
obsErrorHandler(err);
} finally {
attempt++;
if (attempt < maxAttempts) {
Expand Down
2 changes: 1 addition & 1 deletion src/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ a {
}

.media-tag {
min-width: 70px;
min-width: 80px;
border-radius: 6px;
}

Expand Down
25 changes: 22 additions & 3 deletions src/helpers/error-catcher.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
import type { SettingsValues } from 'src/types';

import * as Sentry from '@sentry/vue';
import { extend } from 'quasar';

const errorCatcher = (error: Error | string | unknown) => {
const errorCatcher = async (originalError: Error | string | unknown) => {
if (!originalError) return;
const currentSettingsSnapshot = {} as SettingsValues;
try {
const { useCurrentStateStore } = await import('src/stores/current-state');
const currentState = useCurrentStateStore();
const { currentSettings } = currentState;
extend(true, currentSettingsSnapshot, currentSettings) as SettingsValues;
if (currentSettingsSnapshot.obsPassword?.length)
currentSettingsSnapshot.obsPassword = '*'.repeat(
currentSettingsSnapshot.obsPassword.length,
);
} catch (error) {
console.error(error);
}
if (process.env.NODE_ENV === 'production') {
Sentry.captureException(error);
if (Object.keys(currentSettingsSnapshot).length)
Sentry.setContext('currentSettings', currentSettingsSnapshot);
Sentry.captureException(originalError);
} else {
console.error(error);
console.error(originalError);
}
};

Expand Down
3 changes: 2 additions & 1 deletion src/helpers/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Notify, type QNotifyCreateOptions } from 'quasar';
import { errorCatcher } from './error-catcher';

const createTemporaryNotification = ({
actions,
badgeStyle,
caption,
color,
Expand Down Expand Up @@ -35,7 +36,7 @@ const createTemporaryNotification = ({
...(group && { group }),
...(badgeStyle && { badgeStyle }),
...(!noClose && {
actions: [
actions: actions || [
{
color: 'white',
icon: 'close',
Expand Down
11 changes: 6 additions & 5 deletions src/i18n/af.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"days-long": "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday",
"days-short": "Sun_Mon_Tue_Wed_Thu_Fri_Sat",
"months-long": "January_February_March_April_May_June_July_August_September_October_November_December",
"months-short": "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec",
"days-plural": "days",
"add-a-song": "Add a song from our songbook to the meeting media list.",
"add-a-video-explain": "Add one of the videos from JW.org to the media list. The latest videos are displayed here, but you can also search through all videos if needed.",
"add-an-opening-song": "Add an opening song",
Expand Down Expand Up @@ -75,6 +70,9 @@
"dark": "Donker",
"darkMode": "Theme preference",
"darkMode-explain": "Force the app to use light or dark mode, or use the system default",
"days-long": "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday",
"days-plural": "days",
"days-short": "Sun_Mon_Tue_Wed_Thu_Fri_Sat",
"delete": "Delete",
"delete-media": "Delete media",
"depends-on": "Linked to:",
Expand Down Expand Up @@ -187,6 +185,9 @@
"mediaRetrievalAndPlaybackDescription": "Configure meeting media download and playback settings.",
"meeting-media-manager": "Meeting Media Manager",
"midweek-meeting": "Midweek meeting",
"months-long": "January_February_March_April_May_June_July_August_September_October_November_December",
"months-short": "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec",
"music.starting": "Starting...",
"music.stopping": "Stopping...",
"musicVolume": "Background music playback volume",
"musicVolume-explain": "Choose the volume of the background music playback. This allows you to set a lower volume for background music, while keeping the volume of other media high.",
Expand Down
11 changes: 6 additions & 5 deletions src/i18n/am.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"days-long": "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday",
"days-short": "Sun_Mon_Tue_Wed_Thu_Fri_Sat",
"months-long": "January_February_March_April_May_June_July_August_September_October_November_December",
"months-short": "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec",
"days-plural": "days",
"add-a-song": "Add a song from our songbook to the meeting media list.",
"add-a-video-explain": "Add one of the videos from JW.org to the media list. The latest videos are displayed here, but you can also search through all videos if needed.",
"add-an-opening-song": "Add an opening song",
Expand Down Expand Up @@ -75,6 +70,9 @@
"dark": "Dark",
"darkMode": "Theme preference",
"darkMode-explain": "Force the app to use light or dark mode, or use the system default",
"days-long": "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday",
"days-plural": "days",
"days-short": "Sun_Mon_Tue_Wed_Thu_Fri_Sat",
"delete": "Delete",
"delete-media": "Delete media",
"depends-on": "Linked to:",
Expand Down Expand Up @@ -187,6 +185,9 @@
"mediaRetrievalAndPlaybackDescription": "Configure meeting media download and playback settings.",
"meeting-media-manager": "Meeting Media Manager",
"midweek-meeting": "Midweek meeting",
"months-long": "January_February_March_April_May_June_July_August_September_October_November_December",
"months-short": "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec",
"music.starting": "Starting...",
"music.stopping": "Stopping...",
"musicVolume": "Background music playback volume",
"musicVolume-explain": "Choose the volume of the background music playback. This allows you to set a lower volume for background music, while keeping the volume of other media high.",
Expand Down
11 changes: 6 additions & 5 deletions src/i18n/cmn-hans.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"days-long": "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday",
"days-short": "Sun_Mon_Tue_Wed_Thu_Fri_Sat",
"months-long": "January_February_March_April_May_June_July_August_September_October_November_December",
"months-short": "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec",
"days-plural": "days",
"add-a-song": "从我们的歌曲添加一首歌曲到会议媒体列表。",
"add-a-video-explain": "从 JW.org 添加一个视频到媒体列表。 最新视频显示在这里,但您也可以在需要时通过所有视频进行搜索。",
"add-an-opening-song": "添加开始歌曲",
Expand Down Expand Up @@ -75,6 +70,9 @@
"dark": "",
"darkMode": "主题设置",
"darkMode-explain": "强制应用程序使用亮色或暗色模式,或使用系统默认",
"days-long": "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday",
"days-plural": "days",
"days-short": "Sun_Mon_Tue_Wed_Thu_Fri_Sat",
"delete": "删除",
"delete-media": "删除媒体",
"depends-on": "链接到",
Expand Down Expand Up @@ -187,6 +185,9 @@
"mediaRetrievalAndPlaybackDescription": "配置聚会媒体下载和播放设置。",
"meeting-media-manager": "聚会媒体管理器",
"midweek-meeting": "中周聚会",
"months-long": "January_February_March_April_May_June_July_August_September_October_November_December",
"months-short": "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec",
"music.starting": "Starting...",
"music.stopping": "停止中...",
"musicVolume": "背景音乐播放音量",
"musicVolume-explain": "选择背景音乐播放的音量。 这样可以设置背景音乐的较低音量,同时保持其他媒体的高音量。",
Expand Down
11 changes: 6 additions & 5 deletions src/i18n/de.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"days-long": "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag",
"days-short": "So_Mo_Di_Mi_Do_Fr_Sa",
"months-long": "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember",
"months-short": "Jan_Feb_Mar_Apr_Mai_Jun_Jul_Aug_Sep_Okt_Nov_Dec",
"days-plural": "tage",
"add-a-song": "Ein Lied aus unserem Liederbuch zur Medienliste hinzufügen.",
"add-a-video-explain": "Fügen ein JW.org Video zur Medienliste hinzu. Hier werden die neuesten Videos angezeigt, eine Suche aller Videos ist ebenfalls möglich.",
"add-an-opening-song": "Add an opening song",
Expand Down Expand Up @@ -75,6 +70,9 @@
"dark": "Dunkel",
"darkMode": "Design",
"darkMode-explain": "Erzwinge die App den hellen oder dunklen Modus zu verwenden oder verwende den Systemstandard",
"days-long": "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag",
"days-plural": "tage",
"days-short": "So_Mo_Di_Mi_Do_Fr_Sa",
"delete": "Löschen",
"delete-media": "Medien löschen",
"depends-on": "Verknüpft mit:",
Expand Down Expand Up @@ -187,6 +185,9 @@
"mediaRetrievalAndPlaybackDescription": "Einstellungen für Download und Wiedergabe von Zusammenkünften konfigurieren.",
"meeting-media-manager": "Meeting Media Manager",
"midweek-meeting": "Zusammenkunft unter der Woche",
"months-long": "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember",
"months-short": "Jan_Feb_Mar_Apr_Mai_Jun_Jul_Aug_Sep_Okt_Nov_Dec",
"music.starting": "Startet...",
"music.stopping": "Stoppen...",
"musicVolume": "Lautstärke der Hintergrundmusik",
"musicVolume-explain": "Choose the volume of the background music playback. This allows you to set a lower volume for background music, while keeping the volume of other media high.",
Expand Down
11 changes: 6 additions & 5 deletions src/i18n/el.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"days-long": "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday",
"days-short": "Sun_Mon_Tue_Wed_Thu_Fri_Sat",
"months-long": "January_February_March_April_May_June_July_August_September_October_November_December",
"months-short": "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec",
"days-plural": "days",
"add-a-song": "Add a song from our songbook to the meeting media list.",
"add-a-video-explain": "Add one of the videos from JW.org to the media list. The latest videos are displayed here, but you can also search through all videos if needed.",
"add-an-opening-song": "Add an opening song",
Expand Down Expand Up @@ -75,6 +70,9 @@
"dark": "Σκοτεινό",
"darkMode": "Προτίμηση θέματος",
"darkMode-explain": "Force the app to use light or dark mode, or use the system default",
"days-long": "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday",
"days-plural": "days",
"days-short": "Sun_Mon_Tue_Wed_Thu_Fri_Sat",
"delete": "Διαγραφή",
"delete-media": "Delete media",
"depends-on": "Linked to:",
Expand Down Expand Up @@ -187,6 +185,9 @@
"mediaRetrievalAndPlaybackDescription": "Configure meeting media download and playback settings.",
"meeting-media-manager": "Meeting Media Manager",
"midweek-meeting": "Μεσοβδόμαδη συνάθροιση",
"months-long": "January_February_March_April_May_June_July_August_September_October_November_December",
"months-short": "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec",
"music.starting": "Starting...",
"music.stopping": "Stopping...",
"musicVolume": "Ένταση ήχου αναπαραγωγής μουσικής παρασκηνίου",
"musicVolume-explain": "Choose the volume of the background music playback. This allows you to set a lower volume for background music, while keeping the volume of other media high.",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"full-screen": "Full screen",
"github-repo": "GitHub repo",
"go-home": "Go Home",
"go-to-settings": "Go to Settings",
"got-it": "Got it",
"hide-image-for-zoom-participants": "Hide image for Zoom participants",
"hide-media-display": "Hide media display",
Expand Down Expand Up @@ -261,6 +262,7 @@
"question-mark": "?",
"refresh": "Refresh",
"regular": "Regular",
"remind-me-later": "Remind me later",
"remove-all-cache": "Remove all files from cache",
"remove-unused-cache": "Remove unused items from cache",
"replace": "Replace",
Expand Down
11 changes: 6 additions & 5 deletions src/i18n/es.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"days-long": "Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado",
"days-short": "Dom_Lun_Mar_Mié_Jue_Vie_Sáb_Dom",
"months-long": "Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre",
"months-short": "Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic",
"days-plural": "días",
"add-a-song": "Añada una canción de nuestro cancionero a la lista de multimedia de la reunión.",
"add-a-video-explain": "Añada uno de los vídeos de JW.org a la lista de multimedia. Aquí se muestran los vídeos más recientes, pero también puede buscar entre todos los vídeos si lo necesita.",
"add-an-opening-song": "Añadir canción inicial",
Expand Down Expand Up @@ -75,6 +70,9 @@
"dark": "Oscuro",
"darkMode": "Seleccionar tema",
"darkMode-explain": "Forzar a la aplicación a utilizar el modo claro u oscuro, o usar el modo predeterminado del sistema",
"days-long": "Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado",
"days-plural": "días",
"days-short": "Dom_Lun_Mar_Mié_Jue_Vie_Sáb_Dom",
"delete": "Borrar",
"delete-media": "Borrar multimedia",
"depends-on": "Vinculado a:",
Expand Down Expand Up @@ -187,6 +185,9 @@
"mediaRetrievalAndPlaybackDescription": "Configurar las opciones de descarga y reproducción de medios para las reuniones.",
"meeting-media-manager": "Meeting Media Manager",
"midweek-meeting": "Reunión entre semana",
"months-long": "Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre",
"months-short": "Ene_Feb_Mar_Abr_May_Jun_Jul_Ago_Sep_Oct_Nov_Dic",
"music.starting": "Iniciando...",
"music.stopping": "Deteniendo...",
"musicVolume": "Volumen de reproducción de música de fondo",
"musicVolume-explain": "Elija el volumen de la reproducción de música de fondo. Esto le permite establecer un volumen más bajo para la música de fondo, mientras mantiene el volumen de otros medios alto.",
Expand Down
11 changes: 6 additions & 5 deletions src/i18n/et.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"days-long": "Pühapäev_Esmaspäev_Teisipäev_Kolmapäev_Neljapäev_Reede_Laupäev",
"days-short": "Pü_Es_Te_Ko_Ne_Re_La",
"months-long": "Jaanuar_Veebruar_Märts_Aprill_Mai_Juuni_Juuli_August_September_Oktoober_November_Detsember",
"months-short": "Jaa_Vee_Mär_Apr_Mai_Juun_Juul_Aug_Sept_Okt_Nov_Dets",
"days-plural": "päeva",
"add-a-song": "Lisa lauliku laul koosoleku meedialisti.",
"add-a-video-explain": "Add one of the videos from JW.org to the media list. The latest videos are displayed here, but you can also search through all videos if needed.",
"add-an-opening-song": "Lisa avalaul",
Expand Down Expand Up @@ -75,6 +70,9 @@
"dark": "Tume",
"darkMode": "Teema eelistus",
"darkMode-explain": "Sunni rakendust kasutama kas tumedat või heledat teemat, või kasuta arvuti süsteemiseadeid",
"days-long": "Pühapäev_Esmaspäev_Teisipäev_Kolmapäev_Neljapäev_Reede_Laupäev",
"days-plural": "päeva",
"days-short": "Pü_Es_Te_Ko_Ne_Re_La",
"delete": "Kustuta",
"delete-media": "Kustuta meedia",
"depends-on": "Seotud:",
Expand Down Expand Up @@ -187,6 +185,9 @@
"mediaRetrievalAndPlaybackDescription": "Konfigureeri koosoleku meedia allalaadimise ja taasesituse seaded.",
"meeting-media-manager": "Meeting Media Manager",
"midweek-meeting": "Nädalasisene koosolek",
"months-long": "Jaanuar_Veebruar_Märts_Aprill_Mai_Juuni_Juuli_August_September_Oktoober_November_Detsember",
"months-short": "Jaa_Vee_Mär_Apr_Mai_Juun_Juul_Aug_Sept_Okt_Nov_Dets",
"music.starting": "Käivitamine...",
"music.stopping": "Peatamine...",
"musicVolume": "Taustamuusika helivaljusus",
"musicVolume-explain": "Choose the volume of the background music playback. This allows you to set a lower volume for background music, while keeping the volume of other media high.",
Expand Down
11 changes: 6 additions & 5 deletions src/i18n/fi.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"days-long": "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday",
"days-short": "Sun_Mon_Tue_Wed_Thu_Fri_Sat",
"months-long": "January_February_March_April_May_June_July_August_September_October_November_December",
"months-short": "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec",
"days-plural": "days",
"add-a-song": "Add a song from our songbook to the meeting media list.",
"add-a-video-explain": "Add one of the videos from JW.org to the media list. The latest videos are displayed here, but you can also search through all videos if needed.",
"add-an-opening-song": "Add an opening song",
Expand Down Expand Up @@ -75,6 +70,9 @@
"dark": "Tumma",
"darkMode": "Teeman asetukset",
"darkMode-explain": "Force the app to use light or dark mode, or use the system default",
"days-long": "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday",
"days-plural": "days",
"days-short": "Sun_Mon_Tue_Wed_Thu_Fri_Sat",
"delete": "Poista",
"delete-media": "Delete media",
"depends-on": "Linked to:",
Expand Down Expand Up @@ -187,6 +185,9 @@
"mediaRetrievalAndPlaybackDescription": "Configure meeting media download and playback settings.",
"meeting-media-manager": "Meeting Media Manager",
"midweek-meeting": "Viikkokokous",
"months-long": "January_February_March_April_May_June_July_August_September_October_November_December",
"months-short": "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec",
"music.starting": "Starting...",
"music.stopping": "Stopping...",
"musicVolume": "Taustamusiikin voimakkuus",
"musicVolume-explain": "Choose the volume of the background music playback. This allows you to set a lower volume for background music, while keeping the volume of other media high.",
Expand Down
Loading

0 comments on commit 2ef065e

Please sign in to comment.