Skip to content

Commit

Permalink
Merge pull request #3773 from advplyr/fix-heatmap-caption
Browse files Browse the repository at this point in the history
Fix user stats heatmap caption text to be accurate
  • Loading branch information
advplyr authored Jan 1, 2025
2 parents eb505a0 + ed17dd9 commit f9130a1
Show file tree
Hide file tree
Showing 26 changed files with 6 additions and 27 deletions.
7 changes: 5 additions & 2 deletions client/components/stats/Heatmap.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div id="heatmap" class="w-full">
<div class="mx-auto" :style="{ height: innerHeight + 160 + 'px', width: innerWidth + 52 + 'px' }" style="background-color: rgba(13, 17, 23, 0)">
<p class="mb-2 px-1 text-sm text-gray-200">{{ $getString('MessageListeningSessionsInTheLastYear', [Object.values(daysListening).length]) }}</p>
<p class="mb-2 px-1 text-sm text-gray-200">{{ $getString('MessageDaysListenedInTheLastYear', [daysListenedInTheLastYear]) }}</p>
<div class="border border-white border-opacity-25 rounded py-2 w-full" style="background-color: #232323" :style="{ height: innerHeight + 80 + 'px' }">
<div :style="{ width: innerWidth + 'px', height: innerHeight + 'px' }" class="ml-10 mt-5 absolute" @mouseover="mouseover" @mouseout="mouseout">
<div v-for="dayLabel in dayLabels" :key="dayLabel.label" :style="dayLabel.style" class="absolute top-0 left-0 text-gray-300">{{ dayLabel.label }}</div>
Expand Down Expand Up @@ -37,6 +37,7 @@ export default {
innerHeight: 13 * 7,
blockWidth: 13,
data: [],
daysListenedInTheLastYear: 0,
monthLabels: [],
tooltipEl: null,
tooltipTextEl: null,
Expand Down Expand Up @@ -213,7 +214,8 @@ export default {
}
dates.push(dateObj)
if (dateObj.value) {
if (dateObj.value > 0) {
this.daysListenedInTheLastYear++
if (dateObj.value > maxValue) maxValue = dateObj.value
if (!minValue || dateObj.value < minValue) minValue = dateObj.value
}
Expand Down Expand Up @@ -260,6 +262,7 @@ export default {
const heatmapEl = document.getElementById('heatmap')
this.contentWidth = heatmapEl.clientWidth
this.maxInnerWidth = this.contentWidth - 52
this.daysListenedInTheLastYear = 0
this.buildData()
}
},
Expand Down
1 change: 0 additions & 1 deletion client/strings/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,6 @@
"MessageItemsSelected": "{0} избрани",
"MessageItemsUpdated": "{0} елемента обновени",
"MessageJoinUsOn": "Присъединете се към нас",
"MessageListeningSessionsInTheLastYear": "{0} слушателски сесии през последната година",
"MessageLoading": "Зареждане...",
"MessageLoadingFolders": "Зареждане на Папки...",
"MessageM4BFailed": "M4B Провалено!",
Expand Down
1 change: 0 additions & 1 deletion client/strings/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,6 @@
"MessageItemsSelected": "{0}টি আইটেম নির্বাচিত",
"MessageItemsUpdated": "{0}টি আইটেম আপডেট করা হয়েছে",
"MessageJoinUsOn": "আমাদের সাথে যোগ দিন",
"MessageListeningSessionsInTheLastYear": "গত বছরে {0}টি শোনার সেশন",
"MessageLoading": "লোড হচ্ছে.।",
"MessageLoadingFolders": "ফোল্ডার লোড হচ্ছে...",
"MessageLogsDescription": "লগগুলি JSON ফাইল হিসাবে <code>/metadata/logs</code>-এ সংরক্ষণ করা হয়। ক্র্যাশ লগগুলি <code>/metadata/logs/crash_logs.txt</code>-এ সংরক্ষণ করা হয়।",
Expand Down
1 change: 0 additions & 1 deletion client/strings/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@
"MessageItemsSelected": "{0} vybraných položek",
"MessageItemsUpdated": "{0} položky byly aktualizovány",
"MessageJoinUsOn": "Přidejte se k nám",
"MessageListeningSessionsInTheLastYear": "{0} poslechových relací za poslední rok",
"MessageLoading": "Načítá se...",
"MessageLoadingFolders": "Načítám složky...",
"MessageLogsDescription": "Protokoly se ukládají do souborů JSON v <code>/metadata/logs</code>. Protokoly o pádech jsou uloženy v <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@
"MessageItemsSelected": "{0} elementer valgt",
"MessageItemsUpdated": "{0} elementer opdateret",
"MessageJoinUsOn": "Deltag i os på",
"MessageListeningSessionsInTheLastYear": "{0} lyttesessioner i det sidste år",
"MessageLoading": "Indlæser...",
"MessageLoadingFolders": "Indlæser mapper...",
"MessageM4BFailed": "M4B mislykkedes!",
Expand Down
1 change: 0 additions & 1 deletion client/strings/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@
"MessageItemsSelected": "{0} ausgewählte Medien",
"MessageItemsUpdated": "{0} Medien aktualisiert",
"MessageJoinUsOn": "Besuche uns auf",
"MessageListeningSessionsInTheLastYear": "{0} Ereignisse im letzten Jahr",
"MessageLoading": "Wird geladen …",
"MessageLoadingFolders": "Lade Ordner...",
"MessageLogsDescription": "Die Logs werdern in <code>/metadata/logs</code> als JSON Dateien gespeichert. Crash logs werden in <code>/metadata/logs/crash_logs.txt</code> gespeichert.",
Expand Down
2 changes: 1 addition & 1 deletion client/strings/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@
"MessageConfirmResetProgress": "Are you sure you want to reset your progress?",
"MessageConfirmSendEbookToDevice": "Are you sure you want to send {0} ebook \"{1}\" to device \"{2}\"?",
"MessageConfirmUnlinkOpenId": "Are you sure you want to unlink this user from OpenID?",
"MessageDaysListenedInTheLastYear": "{0} days listened in the last year",
"MessageDownloadingEpisode": "Downloading episode",
"MessageDragFilesIntoTrackOrder": "Drag files into correct track order",
"MessageEmbedFailed": "Embed Failed!",
Expand All @@ -773,7 +774,6 @@
"MessageItemsSelected": "{0} Items Selected",
"MessageItemsUpdated": "{0} Items Updated",
"MessageJoinUsOn": "Join us on",
"MessageListeningSessionsInTheLastYear": "{0} listening sessions in the last year",
"MessageLoading": "Loading...",
"MessageLoadingFolders": "Loading folders...",
"MessageLogsDescription": "Logs are stored in <code>/metadata/logs</code> as JSON files. Crash logs are stored in <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@
"MessageItemsSelected": "{0} Elementos Seleccionados",
"MessageItemsUpdated": "{0} Elementos Actualizados",
"MessageJoinUsOn": "Únetenos en",
"MessageListeningSessionsInTheLastYear": "{0} sesiones de escucha en el último año",
"MessageLoading": "Cargando...",
"MessageLoadingFolders": "Cargando archivos...",
"MessageLogsDescription": "Logs son almacenados en <code>/metadata/logs</code> en archivos bajo formato JSON. Logs de fallos son almacenados en <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@
"MessageItemsSelected": "{0} Valitud üksust",
"MessageItemsUpdated": "{0} Üksust on uuendatud",
"MessageJoinUsOn": "Liitu meiega",
"MessageListeningSessionsInTheLastYear": "Kuulamissessioone viimase aasta jooksul: {0}",
"MessageLoading": "Laadimine...",
"MessageLoadingFolders": "Kaustade laadimine...",
"MessageM4BFailed": "M4B ebaõnnestus!",
Expand Down
1 change: 0 additions & 1 deletion client/strings/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,6 @@
"MessageItemsSelected": "{0} éléments sélectionnés",
"MessageItemsUpdated": "{0} éléments mis à jour",
"MessageJoinUsOn": "Rejoignez-nous sur",
"MessageListeningSessionsInTheLastYear": "{0} sessions d’écoute l’an dernier",
"MessageLoading": "Chargement…",
"MessageLoadingFolders": "Chargement des dossiers…",
"MessageLogsDescription": "Les journaux sont stockés dans <code>/metadata/logs</code> sous forme de fichiers JSON. Les journaux d’incidents sont stockés dans <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,6 @@
"MessageItemsSelected": "{0} פריטים נבחרו",
"MessageItemsUpdated": "{0} פריטים עודכנו",
"MessageJoinUsOn": "הצטרף אלינו ב-",
"MessageListeningSessionsInTheLastYear": "{0} מפגשי האזנה בשנה האחרונה",
"MessageLoading": "טוען...",
"MessageLoadingFolders": "טוען תיקיות...",
"MessageM4BFailed": "M4B נכשל!",
Expand Down
1 change: 0 additions & 1 deletion client/strings/hr.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@
"MessageItemsSelected": "{0} odabranih stavki",
"MessageItemsUpdated": "{0} stavki ažurirano",
"MessageJoinUsOn": "Pridruži nam se na",
"MessageListeningSessionsInTheLastYear": "{0} slušanja u prošloj godini",
"MessageLoading": "Učitavam...",
"MessageLoadingFolders": "Učitavam mape...",
"MessageLogsDescription": "Zapisnici se čuvaju u <code>/metadata/logs</code> u obliku JSON datoteka. Zapisnici pada sustava čuvaju se u datoteci <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@
"MessageItemsSelected": "{0} kiválasztott elem",
"MessageItemsUpdated": "{0} frissített elem",
"MessageJoinUsOn": "Csatlakozzon hozzánk a",
"MessageListeningSessionsInTheLastYear": "{0} hallgatási munkamenet az elmúlt évben",
"MessageLoading": "Betöltés...",
"MessageLoadingFolders": "Mappák betöltése...",
"MessageLogsDescription": "A naplók a <code>/metadata/logs</code> mappában JSON-fájlokként tárolódnak. Az összeomlási naplók a <code>/metadata/logs/crash_logs.txt</code> fájlban tárolódnak.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,6 @@
"MessageItemsSelected": "{0} oggetti Selezionati",
"MessageItemsUpdated": "{0} Oggetti aggiornati",
"MessageJoinUsOn": "Unisciti a noi su",
"MessageListeningSessionsInTheLastYear": "{0} sessioni di ascolto nell'ultimo anno",
"MessageLoading": "Caricamento…",
"MessageLoadingFolders": "Caricamento Cartelle...",
"MessageLogsDescription": "I log vengono archiviati nel percorso <code>/metadata/logs</code> as JSON files. I registri degli arresti anomali vengono archiviati nel percorso <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@
"MessageItemsSelected": "Pasirinkti {0} elementai (-ų)",
"MessageItemsUpdated": "Atnaujinti {0} elementai (-ų)",
"MessageJoinUsOn": "Prisijunkite prie mūsų",
"MessageListeningSessionsInTheLastYear": "{0} klausymo sesijų per paskutinius metus",
"MessageLoading": "Kraunama...",
"MessageLoadingFolders": "Kraunami aplankai...",
"MessageM4BFailed": "M4B Nepavyko!",
Expand Down
1 change: 0 additions & 1 deletion client/strings/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,6 @@
"MessageItemsSelected": "{0} onderdelen geselecteerd",
"MessageItemsUpdated": "{0} onderdelen bijgewerkt",
"MessageJoinUsOn": "Doe mee op",
"MessageListeningSessionsInTheLastYear": "{0} luistersessies in het laatste jaar",
"MessageLoading": "Aan het laden...",
"MessageLoadingFolders": "Mappen aan het laden...",
"MessageLogsDescription": "Logs worden opgeslagen in <code>/metadata/logs</code> als JSON-bestanden. Crashlogs worden opgeslagen in <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,6 @@
"MessageItemsSelected": "{0} Gjenstander valgt",
"MessageItemsUpdated": "{0} Gjenstander oppdatert",
"MessageJoinUsOn": "Følg oss nå",
"MessageListeningSessionsInTheLastYear": "{0} Lyttesesjoner iløpet av siste året",
"MessageLoading": "Laster...",
"MessageLoadingFolders": "Laster mapper...",
"MessageM4BFailed": "M4B mislykkes!",
Expand Down
1 change: 0 additions & 1 deletion client/strings/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@
"MessageInsertChapterBelow": "Wstaw rozdział poniżej",
"MessageItemsSelected": "{0} zaznaczone elementy",
"MessageJoinUsOn": "Dołącz do nas na",
"MessageListeningSessionsInTheLastYear": "Sesje słuchania w ostatnim roku: {0}",
"MessageLoading": "Ładowanie...",
"MessageLoadingFolders": "Ładowanie folderów...",
"MessageLogsDescription": "Logi zapisane są w <code>/metadata/logs</code> jako pliki JSON. Logi awaryjne są zapisane w <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@
"MessageItemsSelected": "{0} Itens Selecionados",
"MessageItemsUpdated": "{0} Itens Atualizados",
"MessageJoinUsOn": "Junte-se a nós",
"MessageListeningSessionsInTheLastYear": "{0} sessões de escuta no ano anterior",
"MessageLoading": "Carregando...",
"MessageLoadingFolders": "Carregando pastas...",
"MessageLogsDescription": "Os logs estão armazenados em <code>/metadata/logs</code> como arquivos JSON. Logs de crash estão armazenados em <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@
"MessageItemsSelected": "{0} Элементов выделено",
"MessageItemsUpdated": "{0} Элементов обновлено",
"MessageJoinUsOn": "Присоединяйтесь к нам в",
"MessageListeningSessionsInTheLastYear": "{0} сеансов прослушивания в прошлом году",
"MessageLoading": "Загрузка...",
"MessageLoadingFolders": "Загрузка каталогов...",
"MessageLogsDescription": "Журналы хранятся в <code>/metadata/logs</code> в виде JSON-файлов. Журналы сбоев хранятся в <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@
"MessageItemsSelected": "{0} izbranih elementov",
"MessageItemsUpdated": "Št. posodobljenih elementov: {0}",
"MessageJoinUsOn": "Pridružite se nam",
"MessageListeningSessionsInTheLastYear": "{0} sej poslušanja v zadnjem letu",
"MessageLoading": "Nalagam...",
"MessageLoadingFolders": "Nalagam mape...",
"MessageLogsDescription": "Dnevniki so shranjeni v <code>/metadata/logs</code> kot datoteke JSON. Dnevniki zrušitev so shranjeni v <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@
"MessageItemsSelected": "{0} Objekt markerade",
"MessageItemsUpdated": "{0} Objekt uppdaterade",
"MessageJoinUsOn": "Anslut dig till oss på",
"MessageListeningSessionsInTheLastYear": "{0} lyssningssessioner det senaste året",
"MessageLoading": "Laddar...",
"MessageLoadingFolders": "Laddar mappar...",
"MessageM4BFailed": "M4B misslyckades!",
Expand Down
1 change: 0 additions & 1 deletion client/strings/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@
"MessageItemsSelected": "Обрано елементів: {0}",
"MessageItemsUpdated": "Оновлено елементів: {0}",
"MessageJoinUsOn": "Приєднуйтесь до",
"MessageListeningSessionsInTheLastYear": "Сесій прослуховування минулого року: {0}",
"MessageLoading": "Завантаження...",
"MessageLoadingFolders": "Завантаження тек...",
"MessageLogsDescription": "Журнали зберігаються у <code>/metadata/logs</code> як JSON-файли. Журнали збоїв зберігаються у <code>/metadata/logs/crash_logs.txt</code>.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/vi-vn.json
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,6 @@
"MessageItemsSelected": "{0} Mục Đã Chọn",
"MessageItemsUpdated": "{0} Mục Đã Cập Nhật",
"MessageJoinUsOn": "Tham gia cùng chúng tôi trên",
"MessageListeningSessionsInTheLastYear": "{0} phiên nghe trong năm qua",
"MessageLoading": "Đang tải...",
"MessageLoadingFolders": "Đang tải các thư mục...",
"MessageM4BFailed": "M4B thất bại!",
Expand Down
1 change: 0 additions & 1 deletion client/strings/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@
"MessageItemsSelected": "已选定 {0} 个项目",
"MessageItemsUpdated": "已更新 {0} 个项目",
"MessageJoinUsOn": "加入我们",
"MessageListeningSessionsInTheLastYear": "去年收听 {0} 个会话",
"MessageLoading": "正在加载...",
"MessageLoadingFolders": "加载文件夹...",
"MessageLogsDescription": "日志以 JSON 文件形式存储在 <code>/metadata/logs</code> 目录中. 崩溃日志存储在 <code>/metadata/logs/crash_logs.txt</code> 目录中.",
Expand Down
1 change: 0 additions & 1 deletion client/strings/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,6 @@
"MessageItemsSelected": "已選定 {0} 個項目",
"MessageItemsUpdated": "已更新 {0} 個項目",
"MessageJoinUsOn": "加入我們",
"MessageListeningSessionsInTheLastYear": "去年收聽 {0} 個會話",
"MessageLoading": "讀取...",
"MessageLoadingFolders": "讀取資料夾...",
"MessageM4BFailed": "M4B 失敗!",
Expand Down

0 comments on commit f9130a1

Please sign in to comment.