From 95085b4c7d2bf808d45a6ec89d8a67ef8df92d85 Mon Sep 17 00:00:00 2001 From: Thegan Govender Date: Tue, 4 Apr 2023 14:50:49 +0200 Subject: [PATCH] stats fix fixed query functions for the reports on the statistics page --- backend/api.js | 15 - backend/init.sql | 86 ++- backend/stats.js | 2 +- package-lock.json | 709 ------------------ package.json | 1 - .../components/statistics/daily-play-count.js | 3 +- .../statistics/play-stats-by-day.js | 4 +- .../statistics/play-stats-by-hour.js | 4 +- src/pages/libraries.js | 2 +- 9 files changed, 63 insertions(+), 763 deletions(-) diff --git a/backend/api.js b/backend/api.js index 7b97b14..ddd9dca 100644 --- a/backend/api.js +++ b/backend/api.js @@ -49,21 +49,6 @@ router.post("/setconfig", async (req, res) => { console.log(`ENDPOINT CALLED: /setconfig: `); }); -// router.get("/getAllFromJellyfin", async (req, res) => { -// const sync = require("./sync"); -// const { rows } = await db.query('SELECT * FROM app_config where "ID"=1'); -// if (rows[0].JF_HOST === null || rows[0].JF_API_KEY === null) { -// res.send({ error: "Config Details Not Found" }); -// return; -// } - -// const _sync = new sync(rows[0].JF_HOST, rows[0].JF_API_KEY); -// const results = await _sync.getAllItems(); - -// res.send(results); - -// // console.log(`ENDPOINT CALLED: /getAllFromJellyfin: `); -// }); router.get("/getLibraries", async (req, res) => { try{ diff --git a/backend/init.sql b/backend/init.sql index 415a6fa..ced30ea 100644 --- a/backend/init.sql +++ b/backend/init.sql @@ -5,7 +5,7 @@ -- Dumped from database version 15.2 (Debian 15.2-1.pgdg110+1) -- Dumped by pg_dump version 15.1 --- Started on 2023-04-02 20:11:41 UTC +-- Started on 2023-04-04 12:49:03 UTC SET statement_timeout = 0; SET lock_timeout = 0; @@ -93,7 +93,7 @@ $$; ALTER FUNCTION public.fs_last_user_activity(userid text) OWNER TO postgres; -- --- TOC entry 248 (class 1255 OID 49411) +-- TOC entry 247 (class 1255 OID 49411) -- Name: fs_library_stats(integer, text); Type: FUNCTION; Schema: public; Owner: postgres -- @@ -325,7 +325,7 @@ $$; ALTER FUNCTION public.fs_user_stats(hours integer, userid text) OWNER TO postgres; -- --- TOC entry 246 (class 1255 OID 49418) +-- TOC entry 248 (class 1255 OID 49418) -- Name: fs_watch_stats_over_time(integer); Type: FUNCTION; Schema: public; Owner: postgres -- @@ -334,16 +334,35 @@ CREATE FUNCTION public.fs_watch_stats_over_time(days integer) RETURNS TABLE("Dat AS $$ BEGIN RETURN QUERY - SELECT - DATE_TRUNC('day', a."ActivityDateInserted")::DATE AS "Date", - COUNT(*) AS "Count", - l."Name" as "Library" - FROM jf_playback_activity a - JOIN jf_library_items i ON i."Id" = a."NowPlayingItemId" - JOIN jf_libraries l ON i."ParentId" = l."Id" - WHERE a."ActivityDateInserted" BETWEEN NOW() - CAST(days || ' days' as INTERVAL) AND NOW() - GROUP BY l."Name", DATE_TRUNC('day', a."ActivityDateInserted") - ORDER BY "Date"; + SELECT + dates."Date", + COALESCE(counts."Count", 0) AS "Count", + l."Name" as "Library" +FROM + (SELECT generate_series( + DATE_TRUNC('day', NOW() - CAST(days || ' days' as INTERVAL)), + DATE_TRUNC('day', NOW()), + '1 day')::DATE AS "Date" + ) dates + CROSS JOIN jf_libraries l + LEFT JOIN + (SELECT + DATE_TRUNC('day', a."ActivityDateInserted")::DATE AS "Date", + COUNT(*) AS "Count", + l."Name" as "Library" + FROM + jf_playback_activity a + JOIN jf_library_items i ON i."Id" = a."NowPlayingItemId" + JOIN jf_libraries l ON i."ParentId" = l."Id" + WHERE + a."ActivityDateInserted" BETWEEN NOW() - CAST(days || ' days' as INTERVAL) AND NOW() + GROUP BY + l."Name", DATE_TRUNC('day', a."ActivityDateInserted") + ) counts + ON counts."Date" = dates."Date" AND counts."Library" = l."Name" +ORDER BY + "Date", "Library"; + END; $$; @@ -351,7 +370,7 @@ $$; ALTER FUNCTION public.fs_watch_stats_over_time(days integer) OWNER TO postgres; -- --- TOC entry 247 (class 1255 OID 57644) +-- TOC entry 246 (class 1255 OID 57644) -- Name: fs_watch_stats_popular_days_of_week(integer); Type: FUNCTION; Schema: public; Owner: postgres -- @@ -398,23 +417,28 @@ CREATE FUNCTION public.fs_watch_stats_popular_hour_of_day(days integer) RETURNS AS $$ BEGIN RETURN QUERY + SELECT + h."Hour", + COUNT(a."Id") ::integer AS "Count", + l."Name" AS "Library" + +FROM ( + SELECT generate_series(0, 23) AS "Hour" +) h +CROSS JOIN jf_libraries l +LEFT JOIN jf_library_items i ON i."ParentId" = l."Id" +LEFT JOIN ( SELECT - DATE_PART('hour', hl."Hour")::INTEGER AS "Hour", - COALESCE(CAST(COUNT(a."NowPlayingItemId") AS INTEGER), 0) AS "Count", - COALESCE(l."Name", hl."Name") AS "Library" - FROM ( - SELECT - DATE_TRUNC('week', NOW()) + INTERVAL '1 hour' * n AS "Hour", - l."Name" - FROM generate_series(0, 167) n - CROSS JOIN jf_libraries l - ) hl - LEFT JOIN jf_playback_activity a ON DATE_TRUNC('hour', a."ActivityDateInserted") = hl."Hour" - LEFT JOIN jf_library_items i ON i."Id" = a."NowPlayingItemId" - LEFT JOIN jf_libraries l ON i."ParentId" = l."Id" - WHERE hl."Hour" BETWEEN NOW() - CAST(days || ' days' as INTERVAL) AND NOW() - GROUP BY DATE_PART('hour', hl."Hour"), COALESCE(l."Name", hl."Name") - ORDER BY DATE_PART('hour', hl."Hour"), COALESCE(l."Name", hl."Name"); + "NowPlayingItemId", + DATE_PART('hour', "ActivityDateInserted") AS "Hour", + "Id" + FROM jf_playback_activity + WHERE "ActivityDateInserted" BETWEEN NOW() - CAST(days || ' days' AS INTERVAL) AND NOW() +) a ON a."NowPlayingItemId" = i."Id" AND a."Hour"::integer = h."Hour" +WHERE l."Id" IN (SELECT "Id" FROM jf_libraries) +GROUP BY h."Hour", l."Name" +ORDER BY l."Name", h."Hour"; + END; $$; @@ -850,7 +874,7 @@ ALTER TABLE ONLY public.jf_library_items COMMENT ON CONSTRAINT jf_library_items_fkey ON public.jf_library_items IS 'jf_library'; --- Completed on 2023-04-02 20:11:41 UTC +-- Completed on 2023-04-04 12:49:04 UTC -- -- PostgreSQL database dump complete diff --git a/backend/stats.js b/backend/stats.js index ad4a094..ca0378b 100644 --- a/backend/stats.js +++ b/backend/stats.js @@ -258,7 +258,7 @@ router.post("/getGlobalLibraryStats", async (req, res) => { }); -router.get("/getLibraryStats", async (req, res) => { +router.get("/getLibraryCardStats", async (req, res) => { try { const { rows } = await db.query("select * from js_library_stats_overview"); res.send(rows); diff --git a/package-lock.json b/package-lock.json index bed7ac7..3949131 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,6 @@ "react-scripts": "5.0.1", "remixicon-react": "^1.0.0", "sequelize": "^6.29.0", - "sqlite3": "^5.1.4", "web-vitals": "^2.1.4", "ws": "^8.13.0" } @@ -2277,11 +2276,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@gar/promisify": { - "version": "1.1.3", - "license": "MIT", - "optional": true - }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.8", "license": "Apache-2.0", @@ -2998,24 +2992,6 @@ "version": "2.0.4", "license": "MIT" }, - "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.10", - "license": "BSD-3-Clause", - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, "node_modules/@mui/base": { "version": "5.0.0-alpha.118", "license": "MIT", @@ -4092,38 +4068,6 @@ "node": ">= 8" } }, - "node_modules/@npmcli/fs": { - "version": "1.1.1", - "license": "ISC", - "optional": true, - "dependencies": { - "@gar/promisify": "^1.0.1", - "semver": "^7.3.5" - } - }, - "node_modules/@npmcli/move-file": { - "version": "1.1.2", - "license": "MIT", - "optional": true, - "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@npmcli/move-file/node_modules/mkdirp": { - "version": "1.0.4", - "license": "MIT", - "optional": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { "version": "0.5.10", "license": "MIT", @@ -5767,10 +5711,6 @@ "version": "2.0.6", "license": "BSD-3-Clause" }, - "node_modules/abbrev": { - "version": "1.1.1", - "license": "ISC" - }, "node_modules/accepts": { "version": "1.3.8", "license": "MIT", @@ -5878,39 +5818,6 @@ "node": ">= 6.0.0" } }, - "node_modules/agentkeepalive": { - "version": "4.2.1", - "license": "MIT", - "optional": true, - "dependencies": { - "debug": "^4.1.0", - "depd": "^1.1.2", - "humanize-ms": "^1.2.1" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/agentkeepalive/node_modules/depd": { - "version": "1.1.2", - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "license": "MIT", - "optional": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/ajv": { "version": "6.12.6", "license": "MIT", @@ -6078,21 +5985,6 @@ "node": ">= 8" } }, - "node_modules/aproba": { - "version": "2.0.0", - "license": "ISC" - }, - "node_modules/are-we-there-yet": { - "version": "2.0.0", - "license": "ISC", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/arg": { "version": "5.0.2", "license": "MIT" @@ -6768,61 +6660,6 @@ "node": ">= 0.8" } }, - "node_modules/cacache": { - "version": "15.3.0", - "license": "ISC", - "optional": true, - "dependencies": { - "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/cacache/node_modules/lru-cache": { - "version": "6.0.0", - "license": "ISC", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cacache/node_modules/mkdirp": { - "version": "1.0.4", - "license": "MIT", - "optional": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/cacache/node_modules/yallist": { - "version": "4.0.0", - "license": "ISC", - "optional": true - }, "node_modules/call-bind": { "version": "1.0.2", "license": "MIT", @@ -6955,13 +6792,6 @@ "node": ">= 6" } }, - "node_modules/chownr": { - "version": "2.0.0", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, "node_modules/chrome-trace-event": { "version": "1.0.3", "license": "MIT", @@ -7007,14 +6837,6 @@ "node": ">=0.10.0" } }, - "node_modules/clean-stack": { - "version": "2.2.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6" - } - }, "node_modules/cliui": { "version": "7.0.4", "license": "ISC", @@ -7066,13 +6888,6 @@ "version": "1.1.3", "license": "MIT" }, - "node_modules/color-support": { - "version": "1.1.3", - "license": "ISC", - "bin": { - "color-support": "bin.js" - } - }, "node_modules/colord": { "version": "2.9.3", "license": "MIT" @@ -7312,10 +7127,6 @@ "node": ">=0.8" } }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "license": "ISC" - }, "node_modules/content-disposition": { "version": "0.5.4", "license": "MIT", @@ -8067,10 +7878,6 @@ "node": ">=0.4.0" } }, - "node_modules/delegates": { - "version": "1.0.0", - "license": "MIT" - }, "node_modules/depd": { "version": "2.0.0", "license": "MIT", @@ -8086,13 +7893,6 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/detect-libc": { - "version": "2.0.1", - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, "node_modules/detect-newline": { "version": "3.1.0", "license": "MIT", @@ -8364,14 +8164,6 @@ "node": ">= 0.8" } }, - "node_modules/encoding": { - "version": "0.1.13", - "license": "MIT", - "optional": true, - "dependencies": { - "iconv-lite": "^0.6.2" - } - }, "node_modules/enhanced-resolve": { "version": "5.12.0", "license": "MIT", @@ -8390,19 +8182,6 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/env-paths": { - "version": "2.2.1", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/err-code": { - "version": "2.0.3", - "license": "MIT", - "optional": true - }, "node_modules/error-ex": { "version": "1.3.2", "license": "MIT", @@ -9835,16 +9614,6 @@ "node": ">=12" } }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "license": "ISC", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/fs-monkey": { "version": "1.0.3", "license": "Unlicense" @@ -9880,24 +9649,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/gauge": { - "version": "3.0.2", - "license": "ISC", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/gensync": { "version": "1.0.0-beta.2", "license": "MIT", @@ -10175,10 +9926,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "license": "ISC" - }, "node_modules/he": { "version": "1.2.0", "license": "MIT", @@ -10323,11 +10070,6 @@ "entities": "^2.0.0" } }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "license": "BSD-2-Clause", - "optional": true - }, "node_modules/http-deceiver": { "version": "1.2.7", "license": "MIT" @@ -10414,14 +10156,6 @@ "node": ">=10.17.0" } }, - "node_modules/humanize-ms": { - "version": "1.2.1", - "license": "MIT", - "optional": true, - "dependencies": { - "ms": "^2.0.0" - } - }, "node_modules/iconv-lite": { "version": "0.6.3", "license": "MIT", @@ -10523,11 +10257,6 @@ "node": ">=8" } }, - "node_modules/infer-owner": { - "version": "1.0.4", - "license": "ISC", - "optional": true - }, "node_modules/inflection": { "version": "1.13.4", "engines": [ @@ -10568,11 +10297,6 @@ "resolved": "https://registry.npmjs.org/internmap/-/internmap-1.0.1.tgz", "integrity": "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==" }, - "node_modules/ip": { - "version": "2.0.0", - "license": "MIT", - "optional": true - }, "node_modules/ipaddr.js": { "version": "2.0.1", "license": "MIT", @@ -10721,11 +10445,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-lambda": { - "version": "1.0.1", - "license": "MIT", - "optional": true - }, "node_modules/is-map": { "version": "2.0.2", "license": "MIT", @@ -13222,48 +12941,6 @@ "semver": "bin/semver.js" } }, - "node_modules/make-fetch-happen": { - "version": "9.1.0", - "license": "ISC", - "optional": true, - "dependencies": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/make-fetch-happen/node_modules/lru-cache": { - "version": "6.0.0", - "license": "ISC", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-fetch-happen/node_modules/yallist": { - "version": "4.0.0", - "license": "ISC", - "optional": true - }, "node_modules/makeerror": { "version": "1.0.12", "license": "BSD-3-Clause", @@ -13449,95 +13126,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minipass": { - "version": "3.3.6", - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-collect": { - "version": "1.0.2", - "license": "ISC", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-fetch": { - "version": "1.4.1", - "license": "MIT", - "optional": true, - "dependencies": { - "minipass": "^3.1.0", - "minipass-sized": "^1.0.3", - "minizlib": "^2.0.0" - }, - "engines": { - "node": ">=8" - }, - "optionalDependencies": { - "encoding": "^0.1.12" - } - }, - "node_modules/minipass-flush": { - "version": "1.0.5", - "license": "ISC", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-pipeline": { - "version": "1.2.4", - "license": "ISC", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-sized": { - "version": "1.0.3", - "license": "ISC", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass/node_modules/yallist": { - "version": "4.0.0", - "license": "ISC" - }, - "node_modules/minizlib": { - "version": "2.1.2", - "license": "MIT", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minizlib/node_modules/yallist": { - "version": "4.0.0", - "license": "ISC" - }, "node_modules/mkdirp": { "version": "0.5.6", "license": "MIT", @@ -13617,44 +13205,6 @@ "tslib": "^2.0.3" } }, - "node_modules/node-addon-api": { - "version": "4.3.0", - "license": "MIT" - }, - "node_modules/node-fetch": { - "version": "2.6.9", - "license": "MIT", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-fetch/node_modules/tr46": { - "version": "0.0.3", - "license": "MIT" - }, - "node_modules/node-fetch/node_modules/webidl-conversions": { - "version": "3.0.1", - "license": "BSD-2-Clause" - }, - "node_modules/node-fetch/node_modules/whatwg-url": { - "version": "5.0.0", - "license": "MIT", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, "node_modules/node-forge": { "version": "1.3.1", "license": "(BSD-3-Clause OR GPL-2.0)", @@ -13662,73 +13212,6 @@ "node": ">= 6.13.0" } }, - "node_modules/node-gyp": { - "version": "8.4.1", - "license": "MIT", - "optional": true, - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^9.1.0", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": ">= 10.12.0" - } - }, - "node_modules/node-gyp/node_modules/are-we-there-yet": { - "version": "3.0.1", - "license": "ISC", - "optional": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/node-gyp/node_modules/gauge": { - "version": "4.0.4", - "license": "ISC", - "optional": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/node-gyp/node_modules/npmlog": { - "version": "6.0.2", - "license": "ISC", - "optional": true, - "dependencies": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/node-int64": { "version": "0.4.0", "license": "MIT" @@ -13737,19 +13220,6 @@ "version": "2.0.10", "license": "MIT" }, - "node_modules/nopt": { - "version": "5.0.0", - "license": "ISC", - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/normalize-path": { "version": "3.0.0", "license": "MIT", @@ -13784,16 +13254,6 @@ "node": ">=8" } }, - "node_modules/npmlog": { - "version": "5.0.1", - "license": "ISC", - "dependencies": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, "node_modules/nth-check": { "version": "2.1.1", "license": "BSD-2-Clause", @@ -14032,20 +13492,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-map": { - "version": "4.0.0", - "license": "MIT", - "optional": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/p-retry": { "version": "4.6.2", "license": "MIT", @@ -15604,31 +15050,6 @@ "asap": "~2.0.6" } }, - "node_modules/promise-inflight": { - "version": "1.0.1", - "license": "ISC", - "optional": true - }, - "node_modules/promise-retry": { - "version": "2.0.1", - "license": "MIT", - "optional": true, - "dependencies": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/promise-retry/node_modules/retry": { - "version": "0.12.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/prompts": { "version": "2.4.2", "license": "MIT", @@ -17392,10 +16813,6 @@ "node": ">= 0.8.0" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "license": "ISC" - }, "node_modules/setprototypeof": { "version": "1.2.0", "license": "ISC" @@ -17451,15 +16868,6 @@ "node": ">=8" } }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - } - }, "node_modules/sockjs": { "version": "0.3.24", "license": "MIT", @@ -17469,32 +16877,6 @@ "websocket-driver": "^0.7.4" } }, - "node_modules/socks": { - "version": "2.7.1", - "license": "MIT", - "optional": true, - "dependencies": { - "ip": "^2.0.0", - "smart-buffer": "^4.2.0" - }, - "engines": { - "node": ">= 10.13.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks-proxy-agent": { - "version": "6.2.1", - "license": "MIT", - "optional": true, - "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/source-list-map": { "version": "2.0.1", "license": "MIT" @@ -17599,38 +16981,6 @@ "version": "1.0.3", "license": "BSD-3-Clause" }, - "node_modules/sqlite3": { - "version": "5.1.4", - "hasInstallScript": true, - "license": "BSD-3-Clause", - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.0", - "node-addon-api": "^4.2.0", - "tar": "^6.1.11" - }, - "optionalDependencies": { - "node-gyp": "8.x" - }, - "peerDependencies": { - "node-gyp": "8.x" - }, - "peerDependenciesMeta": { - "node-gyp": { - "optional": true - } - } - }, - "node_modules/ssri": { - "version": "8.0.1", - "license": "ISC", - "optional": true, - "dependencies": { - "minipass": "^3.1.1" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/stable": { "version": "0.1.8", "license": "MIT" @@ -18037,42 +17387,6 @@ "node": ">=6" } }, - "node_modules/tar": { - "version": "6.1.13", - "license": "ISC", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^4.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/tar/node_modules/minipass": { - "version": "4.2.1", - "license": "ISC", - "engines": { - "node": ">=8" - } - }, - "node_modules/tar/node_modules/mkdirp": { - "version": "1.0.4", - "license": "MIT", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/tar/node_modules/yallist": { - "version": "4.0.0", - "license": "ISC" - }, "node_modules/temp-dir": { "version": "2.0.0", "license": "MIT", @@ -18451,22 +17765,6 @@ "node": ">=4" } }, - "node_modules/unique-filename": { - "version": "1.1.1", - "license": "ISC", - "optional": true, - "dependencies": { - "unique-slug": "^2.0.0" - } - }, - "node_modules/unique-slug": { - "version": "2.0.2", - "license": "ISC", - "optional": true, - "dependencies": { - "imurmurhash": "^0.1.4" - } - }, "node_modules/unique-string": { "version": "2.0.0", "license": "MIT", @@ -19040,13 +18338,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/wide-align": { - "version": "1.1.5", - "license": "ISC", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, "node_modules/winston": { "version": "2.4.7", "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.7.tgz", diff --git a/package.json b/package.json index 7cf3b29..1fe3c21 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "react-scripts": "5.0.1", "remixicon-react": "^1.0.0", "sequelize": "^6.29.0", - "sqlite3": "^5.1.4", "web-vitals": "^2.1.4", "ws": "^8.13.0" }, diff --git a/src/pages/components/statistics/daily-play-count.js b/src/pages/components/statistics/daily-play-count.js index 6d0a8ed..d2e0ca5 100644 --- a/src/pages/components/statistics/daily-play-count.js +++ b/src/pages/components/statistics/daily-play-count.js @@ -77,7 +77,8 @@ function DailyPlayStats(props) { enableGridX={false} enableSlices={"x"} yFormat=" >-.0f" - curve="natural" + curve="cardinal" + enableArea={true} theme={{ axis: { ticks: { diff --git a/src/pages/components/statistics/play-stats-by-day.js b/src/pages/components/statistics/play-stats-by-day.js index c5e86fc..6cb996e 100644 --- a/src/pages/components/statistics/play-stats-by-day.js +++ b/src/pages/components/statistics/play-stats-by-day.js @@ -76,7 +76,7 @@ function PlayStatsByDay(props) { enableGridX={false} enableSlices={"x"} yFormat=" >-.0f" - curve="natural" + curve="cardinal" enableArea={true} theme={{ axis: { @@ -118,7 +118,7 @@ function PlayStatsByDay(props) { theme: "white", }} colors={{ scheme: "category10" }} - pointSize={10} + pointSize={5} pointColor={{ theme: "background" }} pointBorderWidth={2} pointBorderColor={{ from: "serieColor" }} diff --git a/src/pages/components/statistics/play-stats-by-hour.js b/src/pages/components/statistics/play-stats-by-hour.js index a3fcc91..0648efc 100644 --- a/src/pages/components/statistics/play-stats-by-hour.js +++ b/src/pages/components/statistics/play-stats-by-hour.js @@ -78,7 +78,7 @@ function PlayStatsByHour(props) { enableGridX={false} enableSlices={"x"} yFormat=" >-.0f" - curve="linear" + curve="cardinal" enableArea={true} theme={{ axis: { @@ -120,7 +120,7 @@ function PlayStatsByHour(props) { theme: "white", }} colors={{ scheme: "category10" }} - pointSize={10} + pointSize={5} pointColor={{ theme: "background" }} pointBorderWidth={2} pointBorderColor={{ from: "serieColor" }} diff --git a/src/pages/libraries.js b/src/pages/libraries.js index cf635b2..c5bf2dd 100644 --- a/src/pages/libraries.js +++ b/src/pages/libraries.js @@ -29,7 +29,7 @@ function Libraries() { const fetchLibraries = () => { if(config) { - const url = `/stats/getLibraryStats`; + const url = `/stats/getLibraryCardStats`; axios .get(url, { headers: {