1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Add batching + remove temporary RTL

This commit is contained in:
mrjvs 2023-12-16 16:54:30 +01:00
parent 6dea1fb3f6
commit 88446299b6
4 changed files with 14 additions and 1 deletions

View file

@ -46,6 +46,7 @@
"immer": "^10.0.2", "immer": "^10.0.2",
"iso-639-1": "^3.1.0", "iso-639-1": "^3.1.0",
"lodash.isequal": "^4.5.0", "lodash.isequal": "^4.5.0",
"nanoid": "^5.0.4",
"node-forge": "^1.3.1", "node-forge": "^1.3.1",
"ofetch": "^1.0.0", "ofetch": "^1.0.0",
"react": "^17.0.2", "react": "^17.0.2",

View file

@ -71,6 +71,9 @@ dependencies:
lodash.isequal: lodash.isequal:
specifier: ^4.5.0 specifier: ^4.5.0
version: 4.5.0 version: 4.5.0
nanoid:
specifier: ^5.0.4
version: 5.0.4
node-forge: node-forge:
specifier: ^1.3.1 specifier: ^1.3.1
version: 1.3.1 version: 1.3.1
@ -4753,6 +4756,12 @@ packages:
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
hasBin: true hasBin: true
/nanoid@5.0.4:
resolution: {integrity: sha512-vAjmBf13gsmhXSgBrtIclinISzFFy22WwCYoyilZlsrRXNIHSwgFQ1bEdjRwMT3aoadeIF6HMuDRlOxzfXV8ig==}
engines: {node: ^18 || >=20}
hasBin: true
dev: false
/natural-compare-lite@1.4.0: /natural-compare-lite@1.4.0:
resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==}
dev: true dev: true

View file

@ -27,4 +27,4 @@ export const locales = {
}; };
export type Locales = keyof typeof locales; export type Locales = keyof typeof locales;
export const rtlLocales: Locales[] = ["nl"]; export const rtlLocales: Locales[] = [];

View file

@ -1,4 +1,5 @@
import { ScrapeMedia } from "@movie-web/providers"; import { ScrapeMedia } from "@movie-web/providers";
import { nanoid } from "nanoid";
import { ofetch } from "ofetch"; import { ofetch } from "ofetch";
import { useCallback } from "react"; import { useCallback } from "react";
@ -8,6 +9,7 @@ import { PlayerMeta } from "@/stores/player/slices/source";
// for anybody who cares - these are anonymous metrics. // for anybody who cares - these are anonymous metrics.
// They are just used for figuring out if providers are broken or not // They are just used for figuring out if providers are broken or not
const metricsEndpoint = "https://backend.movie-web.app/metrics/providers"; const metricsEndpoint = "https://backend.movie-web.app/metrics/providers";
const batchId = () => nanoid(32);
export type ProviderMetric = { export type ProviderMetric = {
tmdbId: string; tmdbId: string;
@ -34,6 +36,7 @@ export async function reportProviders(items: ProviderMetric[]): Promise<void> {
method: "POST", method: "POST",
body: { body: {
items, items,
batchId: batchId(),
}, },
}); });
} }