+
diff --git a/frontend/src/locales/de_DE/gallery.json b/frontend/src/locales/de_DE/gallery.json
new file mode 100644
index 000000000..384a78a38
--- /dev/null
+++ b/frontend/src/locales/de_DE/gallery.json
@@ -0,0 +1,4 @@
+{
+ "load-more": "Mehr laden",
+ "all-loaded": "Alle Spiele wurden geladen"
+}
diff --git a/frontend/src/locales/de_DE/rom.json b/frontend/src/locales/de_DE/rom.json
index 12e58ea6d..95345ce63 100644
--- a/frontend/src/locales/de_DE/rom.json
+++ b/frontend/src/locales/de_DE/rom.json
@@ -26,7 +26,7 @@
"hidden": "Versteckt",
"info": "Info",
"languages": "Sprachen",
- "manual": "Benutzerhandbuch",
+ "manual": "Handbuch",
"manual-match": "Manuell zuweisen",
"my-notes": "Meine Notizen",
"no-metadata-source": "Keine Quelle für Metadaten aktiv",
diff --git a/frontend/src/locales/de_DE/settings.json b/frontend/src/locales/de_DE/settings.json
index 60ba485a1..d905183bb 100644
--- a/frontend/src/locales/de_DE/settings.json
+++ b/frontend/src/locales/de_DE/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "Weiterspielen als Raster",
"continue-playing-as-grid-desc": "Zeige die Weiterspielen-Karten als Raster auf der Startseite",
+ "email": "E-Mail",
"excluded": "Ausnahmen",
"excluded-multi-rom-files": "Unterverzeichnisse in Plattform-Verzeichnissen",
"excluded-multi-rom-parts-extensions": "Dateiendungen in Unterverzeichnisse in Plattform-Verzeichnissen",
diff --git a/frontend/src/locales/en_GB/gallery.json b/frontend/src/locales/en_GB/gallery.json
new file mode 100644
index 000000000..f92ee34db
--- /dev/null
+++ b/frontend/src/locales/en_GB/gallery.json
@@ -0,0 +1,4 @@
+{
+ "load-more": "Load more",
+ "all-loaded": "All games have been loaded"
+}
diff --git a/frontend/src/locales/en_GB/rom.json b/frontend/src/locales/en_GB/rom.json
index 5d8f5b6e6..e587b3e2d 100644
--- a/frontend/src/locales/en_GB/rom.json
+++ b/frontend/src/locales/en_GB/rom.json
@@ -26,7 +26,7 @@
"hidden": "Hidden",
"info": "Info",
"languages": "Languages",
- "manual": "User manual",
+ "manual": "Manual",
"manual-match": "Manual match",
"my-notes": "My notes",
"no-metadata-source": "No metadata source enabled",
diff --git a/frontend/src/locales/en_GB/settings.json b/frontend/src/locales/en_GB/settings.json
index 8a09a3d35..031c089d7 100644
--- a/frontend/src/locales/en_GB/settings.json
+++ b/frontend/src/locales/en_GB/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "Continue playing as grid",
"continue-playing-as-grid-desc": "View continue playing rom cards as a grid at the home page",
+ "email": "Email",
"excluded": "Excluded",
"excluded-multi-rom-files": "Multi rom files",
"excluded-multi-rom-parts-extensions": "Multi rom parts extensions",
diff --git a/frontend/src/locales/en_US/gallery.json b/frontend/src/locales/en_US/gallery.json
new file mode 100644
index 000000000..f92ee34db
--- /dev/null
+++ b/frontend/src/locales/en_US/gallery.json
@@ -0,0 +1,4 @@
+{
+ "load-more": "Load more",
+ "all-loaded": "All games have been loaded"
+}
diff --git a/frontend/src/locales/en_US/rom.json b/frontend/src/locales/en_US/rom.json
index 5d8f5b6e6..e587b3e2d 100644
--- a/frontend/src/locales/en_US/rom.json
+++ b/frontend/src/locales/en_US/rom.json
@@ -26,7 +26,7 @@
"hidden": "Hidden",
"info": "Info",
"languages": "Languages",
- "manual": "User manual",
+ "manual": "Manual",
"manual-match": "Manual match",
"my-notes": "My notes",
"no-metadata-source": "No metadata source enabled",
diff --git a/frontend/src/locales/en_US/settings.json b/frontend/src/locales/en_US/settings.json
index 8a09a3d35..031c089d7 100644
--- a/frontend/src/locales/en_US/settings.json
+++ b/frontend/src/locales/en_US/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "Continue playing as grid",
"continue-playing-as-grid-desc": "View continue playing rom cards as a grid at the home page",
+ "email": "Email",
"excluded": "Excluded",
"excluded-multi-rom-files": "Multi rom files",
"excluded-multi-rom-parts-extensions": "Multi rom parts extensions",
diff --git a/frontend/src/locales/es_ES/gallery.json b/frontend/src/locales/es_ES/gallery.json
new file mode 100644
index 000000000..2979720e2
--- /dev/null
+++ b/frontend/src/locales/es_ES/gallery.json
@@ -0,0 +1,4 @@
+{
+ "load-more": "Cargar más",
+ "all-loaded": "Todos los juegos han sido cargados"
+}
diff --git a/frontend/src/locales/es_ES/rom.json b/frontend/src/locales/es_ES/rom.json
index db203a557..678fa3572 100644
--- a/frontend/src/locales/es_ES/rom.json
+++ b/frontend/src/locales/es_ES/rom.json
@@ -26,7 +26,7 @@
"hidden": "Oculto",
"info": "Info",
"languages": "Idiomas",
- "manual": "Manual de usuario",
+ "manual": "Manual",
"manual-match": "Identificación manual",
"my-notes": "Mis notas",
"no-metadata-source": "No hay fuente de metadatos habilitada",
diff --git a/frontend/src/locales/es_ES/settings.json b/frontend/src/locales/es_ES/settings.json
index 6ecf1c61b..dd23fd581 100644
--- a/frontend/src/locales/es_ES/settings.json
+++ b/frontend/src/locales/es_ES/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "Continuar jugando como cuadrícula",
"continue-playing-as-grid-desc": "Ver tarjetas de continuar jugando como cuadrícula en la página principal",
+ "email": "Correo electrónico",
"excluded": "Exclusiones",
"excluded-multi-rom-files": "Roms multi fichero",
"excluded-multi-rom-parts-extensions": "Extensiones de partes de roms multi fichero",
diff --git a/frontend/src/locales/fr_FR/gallery.json b/frontend/src/locales/fr_FR/gallery.json
new file mode 100644
index 000000000..4b2638921
--- /dev/null
+++ b/frontend/src/locales/fr_FR/gallery.json
@@ -0,0 +1,4 @@
+{
+ "load-more": "Charger plus",
+ "all-loaded": "Tous les jeux ont été chargés"
+}
diff --git a/frontend/src/locales/fr_FR/rom.json b/frontend/src/locales/fr_FR/rom.json
index e2d891e0a..cbfb7deb3 100644
--- a/frontend/src/locales/fr_FR/rom.json
+++ b/frontend/src/locales/fr_FR/rom.json
@@ -26,7 +26,7 @@
"hidden": "Caché",
"info": "Info",
"languages": "Langues",
- "manual": "Manuel utilisateur",
+ "manual": "Manuel",
"manual-match": "Correspondance manuelle",
"my-notes": "Mes notes",
"no-metadata-source": "Aucune source de métadonnées activée",
diff --git a/frontend/src/locales/fr_FR/settings.json b/frontend/src/locales/fr_FR/settings.json
index f18287118..dfb4e87e9 100644
--- a/frontend/src/locales/fr_FR/settings.json
+++ b/frontend/src/locales/fr_FR/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "Continuer à jouer en grille",
"continue-playing-as-grid-desc": "Voir les cartes de continuer à jouer en grille sur la page d'accueil",
+ "email": "E-mail",
"excluded": "Exclu",
"excluded-multi-rom-files": "Fichiers de rom multiples",
"excluded-multi-rom-parts-extensions": "Extensions de parties de rom multiples",
diff --git a/frontend/src/locales/it_IT/common.json b/frontend/src/locales/it_IT/common.json
index 9155f89f1..c35aff4ed 100644
--- a/frontend/src/locales/it_IT/common.json
+++ b/frontend/src/locales/it_IT/common.json
@@ -17,7 +17,7 @@
"name": "Nome",
"platform": "Piattaforma",
"platforms": "Piattaforme",
- "platforms-n": "{n} Piattafroma | {n} Piattaforme",
+ "platforms-n": "{n} Piattaforma | {n} Piattaforme",
"profile": "Profilo",
"save": "Salvataggio",
"saves": "Salvataggi",
diff --git a/frontend/src/locales/it_IT/rom.json b/frontend/src/locales/it_IT/rom.json
index d8cf532e6..d0c2658e7 100644
--- a/frontend/src/locales/it_IT/rom.json
+++ b/frontend/src/locales/it_IT/rom.json
@@ -26,7 +26,7 @@
"hidden": "Nascosto",
"info": "Info",
"languages": "Lingue",
- "manual": "Manuale utente",
+ "manual": "Manuale",
"manual-match": "Associazione manuale",
"my-notes": "Mie note",
"no-metadata-source": "Nessuna fonte di metadati abilitata",
diff --git a/frontend/src/locales/it_IT/settings.json b/frontend/src/locales/it_IT/settings.json
index b9b305e86..cf6b4c64f 100644
--- a/frontend/src/locales/it_IT/settings.json
+++ b/frontend/src/locales/it_IT/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "\"Continua a giocare\" come griglia",
"continue-playing-as-grid-desc": "Visualizza le rom di \"Continua a giocare\" come una griglia nella home",
+ "email": "Email",
"excluded": "Escluso",
"excluded-multi-rom-files": "File rom multiple",
"excluded-multi-rom-parts-extensions": "Estensioni parti di rom multiple",
diff --git a/frontend/src/locales/ja_JP/gallery.json b/frontend/src/locales/ja_JP/gallery.json
new file mode 100644
index 000000000..79597ad34
--- /dev/null
+++ b/frontend/src/locales/ja_JP/gallery.json
@@ -0,0 +1,4 @@
+{
+ "load-more": "もっと読み込む",
+ "all-loaded": "すべてのゲームが読み込まれました"
+}
diff --git a/frontend/src/locales/ja_JP/rom.json b/frontend/src/locales/ja_JP/rom.json
index 20c006574..91dc1369b 100644
--- a/frontend/src/locales/ja_JP/rom.json
+++ b/frontend/src/locales/ja_JP/rom.json
@@ -26,7 +26,7 @@
"hidden": "非表示",
"info": "詳細",
"languages": "言語",
- "manual": "ユーザーマニュアル",
+ "manual": "マニュアル",
"manual-match": "手動マッチ",
"my-notes": "メモ",
"no-metadata-source": "メタデータ検索が無効です",
diff --git a/frontend/src/locales/ja_JP/settings.json b/frontend/src/locales/ja_JP/settings.json
index b2c32d312..cd15ac1c4 100644
--- a/frontend/src/locales/ja_JP/settings.json
+++ b/frontend/src/locales/ja_JP/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "プレイを継続をグリッドで表示",
"continue-playing-as-grid-desc": "ホームのプレイを継続をグリッドで表示",
+ "email": "メール",
"excluded": "除外",
"excluded-multi-rom-files": "複数ファイル",
"excluded-multi-rom-parts-extensions": "複数ファイルの拡張子",
diff --git a/frontend/src/locales/ko_KR/gallery.json b/frontend/src/locales/ko_KR/gallery.json
new file mode 100644
index 000000000..5912cc1db
--- /dev/null
+++ b/frontend/src/locales/ko_KR/gallery.json
@@ -0,0 +1,4 @@
+{
+ "load-more": "더 불러오기",
+ "all-loaded": "모든 게임이 불러와졌습니다"
+}
diff --git a/frontend/src/locales/ko_KR/rom.json b/frontend/src/locales/ko_KR/rom.json
index 14bbe3f21..b230ee048 100644
--- a/frontend/src/locales/ko_KR/rom.json
+++ b/frontend/src/locales/ko_KR/rom.json
@@ -26,7 +26,7 @@
"hidden": "숨김",
"info": "정보",
"languages": "언어",
- "manual": "사용자 설명서",
+ "manual": "매뉴얼",
"manual-match": "수동으로 DB 대응",
"my-notes": "개인 노트",
"no-metadata-source": "메타데이터 DB 연동 안됨",
diff --git a/frontend/src/locales/ko_KR/settings.json b/frontend/src/locales/ko_KR/settings.json
index b6a828592..5f42331d6 100644
--- a/frontend/src/locales/ko_KR/settings.json
+++ b/frontend/src/locales/ko_KR/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "계속 플레이하기 그리드 뷰",
"continue-playing-as-grid-desc": "홈페이지에 계속 플레이하기를 그리드 뷰로 보여줍니다",
+ "email": "이메일",
"excluded": "제외됨",
"excluded-multi-rom-files": "멀티 롬 파일",
"excluded-multi-rom-parts-extensions": "멀티 롬 부분 확장자",
diff --git a/frontend/src/locales/pt_BR/gallery.json b/frontend/src/locales/pt_BR/gallery.json
new file mode 100644
index 000000000..2e27085d9
--- /dev/null
+++ b/frontend/src/locales/pt_BR/gallery.json
@@ -0,0 +1,4 @@
+{
+ "load-more": "Carregar mais",
+ "all-loaded": "Todos os jogos foram carregados"
+}
diff --git a/frontend/src/locales/pt_BR/rom.json b/frontend/src/locales/pt_BR/rom.json
index 66c7f0ac4..9d8fcb2f3 100644
--- a/frontend/src/locales/pt_BR/rom.json
+++ b/frontend/src/locales/pt_BR/rom.json
@@ -26,7 +26,7 @@
"hidden": "Oculto",
"info": "Informações",
"languages": "Idiomas",
- "manual": "Manual do usuário",
+ "manual": "Manual",
"manual-match": "Correspondência manual",
"my-notes": "Minhas notas",
"no-metadata-source": "Nenhuma fonte de metadados habilitada",
diff --git a/frontend/src/locales/pt_BR/settings.json b/frontend/src/locales/pt_BR/settings.json
index c930f4851..0abfd929c 100644
--- a/frontend/src/locales/pt_BR/settings.json
+++ b/frontend/src/locales/pt_BR/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "Continuar jogando como grade",
"continue-playing-as-grid-desc": "Ver cartões de continuar jogando como uma grade na página inicial",
+ "email": "E-mail",
"excluded": "Excluído",
"excluded-multi-rom-files": "Arquivos de rom múltiplos",
"excluded-multi-rom-parts-extensions": "Extensões de partes de rom múltiplos",
diff --git a/frontend/src/locales/ro_RO/rom.json b/frontend/src/locales/ro_RO/rom.json
index edb97a1c4..be6c1c437 100644
--- a/frontend/src/locales/ro_RO/rom.json
+++ b/frontend/src/locales/ro_RO/rom.json
@@ -26,7 +26,7 @@
"hidden": "Ascuns",
"info": "Informații",
"languages": "Limbi",
- "manual": "Manual utilizator",
+ "manual": "Manual",
"manual-match": "Potrivire manuală",
"my-notes": "Notițele mele",
"no-metadata-source": "Nicio sursă de metadate activată",
diff --git a/frontend/src/locales/ro_RO/settings.json b/frontend/src/locales/ro_RO/settings.json
index abbdd8743..38915ac7e 100644
--- a/frontend/src/locales/ro_RO/settings.json
+++ b/frontend/src/locales/ro_RO/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "Continuă jocul în grilă",
"continue-playing-as-grid-desc": "Vezi cardurile „Continuă jocul” în grilă pe pagina principală",
+ "email": "Email",
"excluded": "Exclus",
"excluded-multi-rom-files": "Fișiere rom multiple",
"excluded-multi-rom-parts-extensions": "Extensii părți rom multiple",
diff --git a/frontend/src/locales/ru_RU/gallery.json b/frontend/src/locales/ru_RU/gallery.json
new file mode 100644
index 000000000..c3591c8d8
--- /dev/null
+++ b/frontend/src/locales/ru_RU/gallery.json
@@ -0,0 +1,4 @@
+{
+ "load-more": "Загрузить еще",
+ "all-loaded": "Все игры загружены"
+}
diff --git a/frontend/src/locales/ru_RU/rom.json b/frontend/src/locales/ru_RU/rom.json
index ea1b585c6..10f8e8032 100644
--- a/frontend/src/locales/ru_RU/rom.json
+++ b/frontend/src/locales/ru_RU/rom.json
@@ -26,7 +26,7 @@
"hidden": "Скрыто",
"info": "Информация",
"languages": "Языки",
- "manual": "Руководство пользователя",
+ "manual": "Руководство",
"manual-match": "Ручное совпадение",
"my-notes": "Мои заметки",
"no-metadata-source": "Источник метаданных не включен",
diff --git a/frontend/src/locales/ru_RU/settings.json b/frontend/src/locales/ru_RU/settings.json
index 2ee5871a0..66deaf372 100644
--- a/frontend/src/locales/ru_RU/settings.json
+++ b/frontend/src/locales/ru_RU/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "Продолжение игры в виде сетки",
"continue-playing-as-grid-desc": "Просмотр карточек продолжения игры в виде сетки на главной странице",
+ "email": "Электронная почта",
"excluded": "Исключено",
"excluded-multi-rom-files": "Многосоставные файлы ромов",
"excluded-multi-rom-parts-extensions": "Расширения частей многосоставных ромов",
diff --git a/frontend/src/locales/zh_CN/gallery.json b/frontend/src/locales/zh_CN/gallery.json
new file mode 100644
index 000000000..9f534263e
--- /dev/null
+++ b/frontend/src/locales/zh_CN/gallery.json
@@ -0,0 +1,4 @@
+{
+ "load-more": "加载更多",
+ "all-loaded": "所有游戏已加载"
+}
diff --git a/frontend/src/locales/zh_CN/rom.json b/frontend/src/locales/zh_CN/rom.json
index c17025f6a..68b1ff71a 100644
--- a/frontend/src/locales/zh_CN/rom.json
+++ b/frontend/src/locales/zh_CN/rom.json
@@ -26,7 +26,7 @@
"hidden": "隐藏",
"info": "信息",
"languages": "语言",
- "manual": "用户手册",
+ "manual": "手册",
"manual-match": "手动匹配",
"my-notes": "我的笔记",
"name": "名称",
diff --git a/frontend/src/locales/zh_CN/settings.json b/frontend/src/locales/zh_CN/settings.json
index bfda4fbaa..1959a032e 100644
--- a/frontend/src/locales/zh_CN/settings.json
+++ b/frontend/src/locales/zh_CN/settings.json
@@ -1,6 +1,7 @@
{
"continue-playing-as-grid": "继续游玩(网格)",
"continue-playing-as-grid-desc": "以网格形式在主页上显示继续游玩(卡片)部分",
+ "email": "电子邮件",
"excluded": "排除",
"excluded-multi-rom-files": "多个 Rom 文件",
"excluded-multi-rom-parts-extensions": "多个 Rom 部分扩展",
diff --git a/frontend/src/plugins/router.ts b/frontend/src/plugins/router.ts
index f291ba9d9..f89645de3 100644
--- a/frontend/src/plugins/router.ts
+++ b/frontend/src/plugins/router.ts
@@ -24,6 +24,7 @@ export const ROUTES = {
EMULATORJS: "emulatorjs",
RUFFLE: "ruffle",
SCAN: "scan",
+ USER_PROFILE: "user-profile",
USER_INTERFACE: "user-interface",
LIBRARY_MANAGEMENT: "library-management",
ADMINISTRATION: "administration",
@@ -116,6 +117,17 @@ const routes = [
name: ROUTES.SCAN,
component: () => import("@/views/Scan.vue"),
},
+ {
+ path: "user/:user",
+ component: () => import("@/layouts/Settings.vue"),
+ children: [
+ {
+ path: "",
+ name: ROUTES.USER_PROFILE,
+ component: () => import("@/views/Settings/UserProfile.vue"),
+ },
+ ],
+ },
{
path: "user-interface",
component: () => import("@/layouts/Settings.vue"),
diff --git a/frontend/src/services/api/collection.ts b/frontend/src/services/api/collection.ts
index 034946f12..93d2e59e8 100644
--- a/frontend/src/services/api/collection.ts
+++ b/frontend/src/services/api/collection.ts
@@ -29,12 +29,11 @@ async function getCollections(): Promise<{ data: Collection[] }> {
async function getVirtualCollections({
type = "collection",
- limit = 100,
}: {
type?: string;
limit?: number;
}): Promise<{ data: VirtualCollection[] }> {
- return api.get("/collections/virtual", { params: { type, limit } });
+ return api.get("/collections/virtual", { params: { type } });
}
async function getCollection(id: number): Promise<{ data: Collection }> {
diff --git a/frontend/src/services/api/rom.ts b/frontend/src/services/api/rom.ts
index a4099e67b..9a388bcd4 100644
--- a/frontend/src/services/api/rom.ts
+++ b/frontend/src/services/api/rom.ts
@@ -2,15 +2,15 @@ import type {
MessageResponse,
SearchRomSchema,
RomUserSchema,
- RomSchema,
} from "@/__generated__";
import api from "@/services/api/index";
import socket from "@/services/socket";
import storeUpload from "@/stores/upload";
import type { DetailedRom, SimpleRom } from "@/stores/roms";
-import { getDownloadPath } from "@/utils";
+import { getDownloadPath, getStatusKeyForText } from "@/utils";
import type { AxiosProgressEvent } from "axios";
import storeHeartbeat from "@/stores/heartbeat";
+import { type CustomLimitOffsetPage_SimpleRomSchema_ as GetRomsResponse } from "@/__generated__/models/CustomLimitOffsetPage_SimpleRomSchema_";
export const romApi = api;
@@ -20,7 +20,7 @@ async function uploadRoms({
}: {
platformId: number;
filesToUpload: File[];
-}): Promise
[]> {
+}): Promise[]> {
const heartbeat = storeHeartbeat();
if (!socket.connected) socket.connect();
@@ -31,7 +31,7 @@ async function uploadRoms({
formData.append(file.name, file);
uploadStore.start(file.name);
- return new Promise((resolve, reject) => {
+ return new Promise((resolve, reject) => {
api
.post("/roms", formData, {
headers: {
@@ -45,8 +45,8 @@ async function uploadRoms({
uploadStore.update(file.name, progressEvent);
},
})
- .then(({ data }) => {
- resolve(data);
+ .then(() => {
+ resolve(null);
})
.catch((error) => {
uploadStore.fail(file.name, error.response?.data?.detail);
@@ -58,41 +58,87 @@ async function uploadRoms({
return Promise.allSettled(promises);
}
+export interface GetRomsParams {
+ platformId?: number | null;
+ collectionId?: number | null;
+ virtualCollectionId?: string | null;
+ searchTerm?: string | null;
+ limit?: number;
+ offset?: number;
+ orderBy?: string | null;
+ orderDir?: string | null;
+ filterUnmatched?: boolean;
+ filterMatched?: boolean;
+ filterFavourites?: boolean;
+ filterDuplicates?: boolean;
+ groupByMetaId?: boolean;
+ selectedGenre?: string | null;
+ selectedFranchise?: string | null;
+ selectedCollection?: string | null;
+ selectedCompany?: string | null;
+ selectedAgeRating?: string | null;
+ selectedStatus?: string | null;
+ selectedRegion?: string | null;
+ selectedLanguage?: string | null;
+}
+
async function getRoms({
platformId = null,
collectionId = null,
virtualCollectionId = null,
searchTerm = null,
+ limit = 72,
+ offset = 0,
orderBy = "name",
orderDir = "asc",
-}: {
- platformId?: number | null;
- collectionId?: number | null;
- virtualCollectionId?: string | null;
- searchTerm?: string | null;
- orderBy?: string | null;
- orderDir?: string | null;
-}): Promise<{ data: SimpleRom[] }> {
+ filterUnmatched = false,
+ filterMatched = false,
+ filterFavourites = false,
+ filterDuplicates = false,
+ groupByMetaId = false,
+ selectedGenre = null,
+ selectedFranchise = null,
+ selectedCollection = null,
+ selectedCompany = null,
+ selectedAgeRating = null,
+ selectedStatus = null,
+ selectedRegion = null,
+ selectedLanguage = null,
+}: GetRomsParams): Promise<{ data: GetRomsResponse }> {
return api.get(`/roms`, {
params: {
platform_id: platformId,
collection_id: collectionId,
virtual_collection_id: virtualCollectionId,
search_term: searchTerm,
+ limit: limit,
+ offset: offset,
order_by: orderBy,
order_dir: orderDir,
- limit: 2500,
+ unmatched_only: filterUnmatched,
+ matched_only: filterMatched,
+ favourites_only: filterFavourites,
+ duplicates_only: filterDuplicates,
+ group_by_meta_id: groupByMetaId,
+ selected_genre: selectedGenre,
+ selected_franchise: selectedFranchise,
+ selected_collection: selectedCollection,
+ selected_company: selectedCompany,
+ selected_age_rating: selectedAgeRating,
+ selected_status: getStatusKeyForText(selectedStatus),
+ selected_region: selectedRegion,
+ selected_language: selectedLanguage,
},
});
}
-async function getRecentRoms(): Promise<{ data: SimpleRom[] }> {
+async function getRecentRoms(): Promise<{ data: GetRomsResponse }> {
return api.get("/roms", {
params: { order_by: "id", order_dir: "desc", limit: 15 },
});
}
-async function getRecentPlayedRoms(): Promise<{ data: SimpleRom[] }> {
+async function getRecentPlayedRoms(): Promise<{ data: GetRomsResponse }> {
return api.get("/roms", {
params: { order_by: "last_played", order_dir: "desc", limit: 15 },
});
@@ -146,12 +192,10 @@ export type UpdateRom = SimpleRom & {
async function updateRom({
rom,
- renameAsSource = false,
removeCover = false,
unmatch = false,
}: {
rom: UpdateRom;
- renameAsSource?: boolean;
removeCover?: boolean;
unmatch?: boolean;
}): Promise<{ data: DetailedRom }> {
@@ -167,7 +211,6 @@ async function updateRom({
return api.put(`/roms/${rom.id}`, formData, {
params: {
- rename_as_source: renameAsSource,
remove_cover: removeCover,
unmatch_metadata: unmatch,
},
diff --git a/frontend/src/stores/collections.ts b/frontend/src/stores/collections.ts
index b57d93d3e..2d3a244aa 100644
--- a/frontend/src/stores/collections.ts
+++ b/frontend/src/stores/collections.ts
@@ -14,24 +14,23 @@ export default defineStore("collections", {
allCollections: [] as Collection[],
virtualCollections: [] as VirtualCollection[],
favCollection: {} as Collection | undefined,
- searchText: "" as string,
+ filterText: "" as string,
}),
getters: {
- filteredCollections: ({ allCollections, searchText }) =>
+ filteredCollections: ({ allCollections, filterText }) =>
allCollections.filter((p) =>
- p.name.toLowerCase().includes(searchText.toLowerCase()),
+ p.name.toLowerCase().includes(filterText.toLowerCase()),
),
- filteredVirtualCollections: ({ virtualCollections, searchText }) =>
+ filteredVirtualCollections: ({ virtualCollections, filterText }) =>
virtualCollections.filter((p) =>
- p.name.toLowerCase().includes(searchText.toLowerCase()),
+ p.name.toLowerCase().includes(filterText.toLowerCase()),
),
},
actions: {
_reorder() {
- this.allCollections = this.allCollections.sort((a, b) => {
+ this.allCollections = uniqBy(this.allCollections, "id").sort((a, b) => {
return a.name.localeCompare(b.name);
});
- this.allCollections = uniqBy(this.allCollections, "id");
},
setFavCollection(favCollection: Collection | undefined) {
this.favCollection = favCollection;
@@ -72,7 +71,7 @@ export default defineStore("collections", {
this.allCollections = [];
this.virtualCollections = [];
this.favCollection = undefined;
- this.searchText = "";
+ this.filterText = "";
},
},
});
diff --git a/frontend/src/stores/config.ts b/frontend/src/stores/config.ts
index f215e59c9..bf7863672 100644
--- a/frontend/src/stores/config.ts
+++ b/frontend/src/stores/config.ts
@@ -23,7 +23,7 @@ const defaultConfig = {
export default defineStore("config", {
state: () => ({
- config: defaultConfig,
+ config: { ...defaultConfig },
}),
actions: {
diff --git a/frontend/src/stores/galleryFilter.ts b/frontend/src/stores/galleryFilter.ts
index 5391c3843..c07294b68 100644
--- a/frontend/src/stores/galleryFilter.ts
+++ b/frontend/src/stores/galleryFilter.ts
@@ -4,26 +4,19 @@ import { defineStore } from "pinia";
export type Platform = PlatformSchema;
-const filters = [
- "genres",
- "franchises",
- "meta_collections",
- "companies",
- "age_ratings",
- "status",
- "regions",
- "languages",
-] as const;
-
-const statusFilters = Object.values(romStatusMap).map((status) => status.text);
-
-export type FilterType = (typeof filters)[number];
+export type FilterType =
+ | "genres"
+ | "franchises"
+ | "collections"
+ | "companies"
+ | "age_ratings"
+ | "status"
+ | "regions"
+ | "languages";
const defaultFilterState = {
activeFilterDrawer: false,
- searchText: null as string | null,
- filterText: null as string | null,
- filters: filters,
+ searchTerm: null as string | null,
filterPlatforms: [] as Platform[],
filterGenres: [] as string[],
filterFranchises: [] as string[],
@@ -32,7 +25,7 @@ const defaultFilterState = {
filterAgeRatings: [] as string[],
filterRegions: [] as string[],
filterLanguages: [] as string[],
- filterStatuses: statusFilters,
+ filterStatuses: Object.values(romStatusMap).map((status) => status.text),
filterUnmatched: false,
filterMatched: false,
filterFavourites: false,
@@ -49,7 +42,7 @@ const defaultFilterState = {
};
export default defineStore("galleryFilter", {
- state: () => defaultFilterState,
+ state: () => ({ ...defaultFilterState }),
actions: {
switchActiveFilterDrawer() {
@@ -152,7 +145,20 @@ export default defineStore("galleryFilter", {
);
},
reset() {
- Object.assign(this, defaultFilterState);
+ Object.assign(this, { ...defaultFilterState });
+ },
+ resetFilters() {
+ this.selectedPlatform = null;
+ this.selectedGenre = null;
+ this.selectedFranchise = null;
+ this.selectedCollection = null;
+ this.selectedCompany = null;
+ this.selectedAgeRating = null;
+ this.selectedStatus = null;
+ this.disableFilterUnmatched();
+ this.disableFilterMatched();
+ this.disableFilterFavourites();
+ this.disableFilterDuplicates();
},
},
});
diff --git a/frontend/src/stores/galleryView.ts b/frontend/src/stores/galleryView.ts
index d13417538..14d6a0d22 100644
--- a/frontend/src/stores/galleryView.ts
+++ b/frontend/src/stores/galleryView.ts
@@ -7,11 +7,11 @@ const defaultGalleryState = {
defaultAspectRatioScreenshot: 16 / 9,
activeFirmwareDrawer: false,
scrolledToTop: false,
- scroll: 0,
+ showFabOverlay: false,
};
export default defineStore("galleryView", {
- state: () => defaultGalleryState,
+ state: () => ({ ...defaultGalleryState }),
actions: {
setView(view: number) {
@@ -29,7 +29,7 @@ export default defineStore("galleryView", {
}
},
reset() {
- Object.assign(this, defaultGalleryState);
+ Object.assign(this, { ...defaultGalleryState });
},
},
});
diff --git a/frontend/src/stores/heartbeat.ts b/frontend/src/stores/heartbeat.ts
index 9df64a8cf..273a491ea 100644
--- a/frontend/src/stores/heartbeat.ts
+++ b/frontend/src/stores/heartbeat.ts
@@ -54,7 +54,7 @@ const defaultHeartbeat: Heartbeat = {
export default defineStore("heartbeat", {
state: () => ({
- value: defaultHeartbeat,
+ value: { ...defaultHeartbeat },
}),
actions: {
diff --git a/frontend/src/stores/language.ts b/frontend/src/stores/language.ts
index f0de9f6a1..1bfd558d7 100644
--- a/frontend/src/stores/language.ts
+++ b/frontend/src/stores/language.ts
@@ -20,14 +20,14 @@ const defaultLanguageState = {
};
export default defineStore("language", {
- state: () => defaultLanguageState,
+ state: () => ({ ...defaultLanguageState }),
actions: {
setLanguage(lang: { value: string; name: string }) {
this.selectedLanguage = lang;
},
reset() {
- Object.assign(this, defaultLanguageState);
+ Object.assign(this, { ...defaultLanguageState });
},
},
});
diff --git a/frontend/src/stores/navigation.ts b/frontend/src/stores/navigation.ts
index d20c6e277..6bf538840 100644
--- a/frontend/src/stores/navigation.ts
+++ b/frontend/src/stores/navigation.ts
@@ -1,5 +1,6 @@
import { defineStore } from "pinia";
import { ROUTES } from "@/plugins/router";
+import { isNull } from "lodash";
const defaultNavigationState = {
activePlatformsDrawer: false,
@@ -7,10 +8,13 @@ const defaultNavigationState = {
activeSettingsDrawer: false,
activePlatformInfoDrawer: false,
activeCollectionInfoDrawer: false,
+ mainBarCollapsed: isNull(localStorage.getItem("settings.mainBarCollapsed"))
+ ? false
+ : localStorage.getItem("settings.mainBarCollapsed") === "true",
};
export default defineStore("navigation", {
- state: () => defaultNavigationState,
+ state: () => ({ ...defaultNavigationState }),
actions: {
switchActivePlatformsDrawer() {
@@ -46,7 +50,7 @@ export default defineStore("navigation", {
this.$router.push({ name: ROUTES.SEARCH });
},
reset() {
- Object.assign(this, defaultNavigationState);
+ Object.assign(this, { ...defaultNavigationState });
},
resetDrawersExcept(drawer: string) {
this.activePlatformsDrawer =
diff --git a/frontend/src/stores/platforms.ts b/frontend/src/stores/platforms.ts
index d939c5aa7..1b022e460 100644
--- a/frontend/src/stores/platforms.ts
+++ b/frontend/src/stores/platforms.ts
@@ -7,7 +7,7 @@ export type Platform = PlatformSchema;
export default defineStore("platforms", {
state: () => ({
allPlatforms: [] as Platform[],
- searchText: "" as string,
+ filterText: "" as string,
}),
getters: {
@@ -17,12 +17,12 @@ export default defineStore("platforms", {
all
.filter((p) => p.rom_count > 0)
.sort((a, b) => a.display_name.localeCompare(b.display_name)),
- filteredPlatforms: ({ allPlatforms: all, searchText }) =>
+ filteredPlatforms: ({ allPlatforms: all, filterText }) =>
all
.filter(
(p) =>
p.rom_count > 0 &&
- p.display_name.toLowerCase().includes(searchText.toLowerCase()),
+ p.display_name.toLowerCase().includes(filterText.toLowerCase()),
)
.sort((a, b) => a.display_name.localeCompare(b.display_name)),
},
@@ -34,7 +34,6 @@ export default defineStore("platforms", {
},
set(platforms: Platform[]) {
this.allPlatforms = platforms;
- this._reorder();
},
add(platform: Platform) {
this.allPlatforms.push(platform);
@@ -64,7 +63,7 @@ export default defineStore("platforms", {
},
reset() {
this.allPlatforms = [] as Platform[];
- this.searchText = "";
+ this.filterText = "";
},
},
});
diff --git a/frontend/src/stores/roms.ts b/frontend/src/stores/roms.ts
index 1ac0af0d9..9b52fee53 100644
--- a/frontend/src/stores/roms.ts
+++ b/frontend/src/stores/roms.ts
@@ -1,15 +1,11 @@
import type { SearchRomSchema } from "@/__generated__";
import type { DetailedRomSchema, SimpleRomSchema } from "@/__generated__/";
-import storeCollection, {
- type Collection,
- type VirtualCollection,
-} from "@/stores/collections";
+import romApi from "@/services/api/rom";
+import { type Collection, type VirtualCollection } from "@/stores/collections";
import storeGalleryFilter from "@/stores/galleryFilter";
import { type Platform } from "@/stores/platforms";
import type { ExtractPiniaStoreType } from "@/types";
-import { getStatusKeyForText } from "@/utils";
-import { groupBy, isNull, isUndefined, uniqBy } from "lodash";
-import { nanoid } from "nanoid";
+import { isNull, isUndefined } from "lodash";
import { defineStore } from "pinia";
type GalleryFilterStore = ExtractPiniaStoreType;
@@ -23,25 +19,35 @@ const defaultRomsState = {
currentVirtualCollection: null as VirtualCollection | null,
currentRom: null as DetailedRom | null,
allRoms: [] as SimpleRom[],
- _grouped: [] as SimpleRom[],
- _filteredIDs: new Set(),
- _selectedIDs: new Set(),
+ selectedIDs: new Set(),
recentRoms: [] as SimpleRom[],
continuePlayingRoms: [] as SimpleRom[],
lastSelectedIndex: -1,
- selecting: false,
- itemsPerBatch: 72,
- gettingRoms: false,
+ selectingRoms: false,
+ fetchingRoms: false,
+ initialSearch: false,
+ fetchLimit: 72,
+ fetchOffset: 0,
+ fetchTotalRoms: 0,
+ characterIndex: {} as Record,
+ selectedCharacter: null as string | null,
+ orderBy: "name" as keyof SimpleRom,
+ orderDir: "asc" as "asc" | "desc",
};
+// This caches the first 72 roms fetched for each platform
+const _romsCacheByID = new Map();
+const _romsCacheByPlatform = new Map();
+const _romsCacheByCollection = new Map();
+const _romsCacheByVirtualCollection = new Map();
+
export default defineStore("roms", {
- state: () => defaultRomsState,
+ state: () => ({ ...defaultRomsState }),
getters: {
- filteredRoms: (state) =>
- state._grouped.filter((rom) => state._filteredIDs.has(rom.id)),
+ filteredRoms: (state) => state.allRoms,
selectedRoms: (state) =>
- state._grouped.filter((rom) => state._selectedIDs.has(rom.id)),
+ state.allRoms.filter((rom) => state.selectedIDs.has(rom.id)),
},
actions: {
@@ -50,70 +56,115 @@ export default defineStore("roms", {
? true
: localStorage.getItem("settings.groupRoms") === "true";
},
- _getGroupedRoms(roms: SimpleRom[]): SimpleRom[] {
- // Group roms by external id.
- return Object.values(
- groupBy(
- roms,
- (game) =>
- // If external id is null, generate a random id so that the roms are not grouped
- game.igdb_id || game.moby_id || game.ss_id || nanoid(),
- ),
- ).map((games) => {
- // Find the index of the game where the 'rom_user' property has 'is_main_sibling' set to true.
- return games.find((game) => game.rom_user?.is_main_sibling) || games[0];
- });
- },
- _reorder() {
- // Sort roms by comparator string
- this.allRoms = uniqBy(this.allRoms, "id").sort((a, b) => {
- return a.sort_comparator.localeCompare(b.sort_comparator);
- });
-
- // Check if roms should be grouped
- if (!this._shouldGroupRoms()) {
- this._grouped = this.allRoms;
- return;
- }
-
- // Group roms by external id
- this._grouped = this._getGroupedRoms(this.allRoms).sort((a, b) => {
- return a.sort_comparator.localeCompare(b.sort_comparator);
- });
- },
setCurrentPlatform(platform: Platform | null) {
this.currentPlatform = platform;
+ if (platform) {
+ const romIDs = _romsCacheByPlatform.get(platform.id);
+ if (romIDs) {
+ this.allRoms = romIDs
+ .filter((id) => _romsCacheByID.has(id))
+ .map((id) => _romsCacheByID.get(id)!) as SimpleRom[];
+ }
+ }
},
setCurrentRom(rom: DetailedRom) {
this.currentRom = rom;
},
setRecentRoms(roms: SimpleRom[]) {
- if (this._shouldGroupRoms()) {
- // Group by external ID to only display a single entry per sibling,
- // and sorted on rom ID in descending order.
- this.recentRoms = this._getGroupedRoms(roms).sort(
- (a, b) => b.id - a.id,
- );
- } else {
- this.recentRoms = roms;
- }
+ this.recentRoms = roms;
},
setContinuePlayedRoms(roms: SimpleRom[]) {
this.continuePlayingRoms = roms;
},
setCurrentCollection(collection: Collection | null) {
this.currentCollection = collection;
+ if (collection) {
+ const romIDs = _romsCacheByCollection.get(collection.id);
+ if (romIDs) {
+ this.allRoms = romIDs
+ .filter((id) => _romsCacheByID.has(id))
+ .map((id) => _romsCacheByID.get(id)!) as SimpleRom[];
+ }
+ }
},
setCurrentVirtualCollection(collection: VirtualCollection | null) {
this.currentVirtualCollection = collection;
+ if (collection) {
+ const romIDs = _romsCacheByVirtualCollection.get(collection.id);
+ if (romIDs) {
+ this.allRoms = romIDs
+ .filter((id) => _romsCacheByID.has(id))
+ .map((id) => _romsCacheByID.get(id)!) as SimpleRom[];
+ }
+ }
},
- set(roms: SimpleRom[]) {
- this.allRoms = roms;
- this._reorder();
+ fetchRoms(galleryFilter: GalleryFilterStore, concat = true) {
+ if (this.fetchingRoms) return Promise.resolve();
+ this.fetchingRoms = true;
+
+ return new Promise((resolve, reject) => {
+ romApi
+ .getRoms({
+ ...galleryFilter.$state,
+ platformId:
+ this.currentPlatform?.id ??
+ galleryFilter.selectedPlatform?.id ??
+ null,
+ collectionId: this.currentCollection?.id ?? null,
+ virtualCollectionId: this.currentVirtualCollection?.id ?? null,
+ limit: this.fetchLimit,
+ offset: this.fetchOffset,
+ orderBy: this.orderBy,
+ orderDir: this.orderDir,
+ groupByMetaId: this._shouldGroupRoms(),
+ })
+ .then(({ data: { items, offset, total, char_index } }) => {
+ if (!concat || this.fetchOffset === 0) {
+ this.allRoms = items;
+
+ // Cache the first batch of roms for each platform
+ if (this.currentPlatform) {
+ _romsCacheByPlatform.set(
+ this.currentPlatform.id,
+ items.map((rom) => rom.id),
+ );
+ items.forEach((rom) => _romsCacheByID.set(rom.id, rom));
+ } else if (this.currentCollection) {
+ _romsCacheByCollection.set(
+ this.currentCollection.id,
+ items.map((rom) => rom.id),
+ );
+ items.forEach((rom) => _romsCacheByID.set(rom.id, rom));
+ } else if (this.currentVirtualCollection) {
+ _romsCacheByVirtualCollection.set(
+ this.currentVirtualCollection.id,
+ items.map((rom) => rom.id),
+ );
+ items.forEach((rom) => _romsCacheByID.set(rom.id, rom));
+ }
+ } else {
+ this.allRoms = this.allRoms.concat(items);
+ }
+
+ // Update the offset and total roms in filtered database result
+ if (offset !== null) this.fetchOffset = offset + this.fetchLimit;
+ if (total !== null) this.fetchTotalRoms = total;
+
+ // Set the character index for the current platform
+ this.characterIndex = char_index;
+
+ resolve(items);
+ })
+ .catch((error) => {
+ reject(error);
+ })
+ .finally(() => {
+ this.fetchingRoms = false;
+ });
+ });
},
add(roms: SimpleRom[]) {
this.allRoms = this.allRoms.concat(roms);
- this._reorder();
},
addToRecent(rom: SimpleRom) {
this.recentRoms = [rom, ...this.recentRoms];
@@ -136,7 +187,6 @@ export default defineStore("roms", {
this.recentRoms = this.recentRoms.map((value) =>
value.id === rom.id ? rom : value,
);
- this._reorder();
},
remove(roms: SimpleRom[]) {
this.allRoms = this.allRoms.filter((value) => {
@@ -144,263 +194,44 @@ export default defineStore("roms", {
return rom.id === value.id;
});
});
- this._grouped = this._grouped.filter((value) => {
- return !roms.find((rom) => {
- return rom.id === value.id;
- });
- });
- roms.forEach((rom) => this._filteredIDs.delete(rom.id));
},
reset() {
- Object.assign(this, defaultRomsState);
+ Object.assign(this, {
+ ...defaultRomsState,
+ recentRoms: this.recentRoms,
+ continuePlayingRoms: this.continuePlayingRoms,
+ });
},
- // Filter roms by gallery filter store state
- setFiltered(roms: SimpleRom[], galleryFilter: GalleryFilterStore) {
- this._filteredIDs = new Set(roms.map((rom) => rom.id));
- if (galleryFilter.filterText !== null) {
- this._filterText(galleryFilter.filterText);
- }
- if (galleryFilter.filterUnmatched) {
- this._filterUnmatched();
- }
- if (galleryFilter.filterMatched) {
- this._filterMatched();
- }
- if (galleryFilter.filterFavourites) {
- this._filterFavourites();
- }
- if (galleryFilter.filterDuplicates) {
- this._filterDuplicates();
- }
- if (galleryFilter.selectedPlatform) {
- this._filterPlatform(galleryFilter.selectedPlatform);
- }
- if (galleryFilter.selectedGenre) {
- this._filterGenre(galleryFilter.selectedGenre);
- }
- if (galleryFilter.selectedFranchise) {
- this._filterFranchise(galleryFilter.selectedFranchise);
- }
- if (galleryFilter.selectedCollection) {
- this._filterCollection(galleryFilter.selectedCollection);
- }
- if (galleryFilter.selectedCompany) {
- this._filterCompany(galleryFilter.selectedCompany);
- }
- if (galleryFilter.selectedAgeRating) {
- this._filterAgeRating(galleryFilter.selectedAgeRating);
- }
- if (galleryFilter.selectedRegion) {
- this._filterRegion(galleryFilter.selectedRegion);
- }
- if (galleryFilter.selectedLanguage) {
- this._filterLanguage(galleryFilter.selectedLanguage);
- }
- if (galleryFilter.selectedStatus) {
- this._filterStatus(galleryFilter.selectedStatus);
- } else {
- this._filteredIDs = new Set(
- // Filter hidden roms if the status is not hidden
- this.filteredRoms
- .filter((rom) => !rom.rom_user.hidden)
- .map((rom) => rom.id),
- );
- }
+ resetPagination() {
+ this.fetchLimit = 72;
+ this.fetchOffset = 0;
+ this.fetchTotalRoms = 0;
},
- _filterText(searchFilter: string) {
- const bySearch = new Set(
- this.filteredRoms
- .filter(
- (rom) =>
- rom.name?.toLowerCase().includes(searchFilter.toLowerCase()) ||
- rom.fs_name?.toLowerCase().includes(searchFilter.toLowerCase()),
- )
- .map((roms) => roms.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = bySearch.intersection(this._filteredIDs);
- },
- _filterUnmatched() {
- const byUnmatched = new Set(
- this.filteredRoms
- .filter((rom) => !rom.igdb_id && !rom.moby_id && !rom.ss_id)
- .map((roms) => roms.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byUnmatched.intersection(this._filteredIDs);
- },
- _filterMatched() {
- const byMatched = new Set(
- this.filteredRoms
- .filter((rom) => rom.igdb_id || rom.moby_id || rom.ss_id)
- .map((roms) => roms.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byMatched.intersection(this._filteredIDs);
- },
- _filterFavourites() {
- const collectionStore = storeCollection();
-
- const byFavourites = new Set(
- this.filteredRoms
- .filter((rom) =>
- collectionStore.favCollection?.rom_ids?.includes(rom.id),
- )
- .map((roms) => roms.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byFavourites.intersection(this._filteredIDs);
- },
- _filterDuplicates() {
- const byDuplicates = new Set(
- this.filteredRoms
- .filter((rom) => rom.sibling_roms?.length)
- .map((rom) => rom.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byDuplicates.intersection(this._filteredIDs);
- },
- _filterPlatform(platformToFilter: Platform) {
- const byPlatform = new Set(
- this.filteredRoms
- .filter((rom) => rom.platform_id === platformToFilter.id)
- .map((rom) => rom.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byPlatform.intersection(this._filteredIDs);
- },
- _filterGenre(genreToFilter: string) {
- const byGenre = new Set(
- this.filteredRoms
- .filter((rom) => rom.genres.some((genre) => genre === genreToFilter))
- .map((rom) => rom.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byGenre.intersection(this._filteredIDs);
- },
- _filterFranchise(franchiseToFilter: string) {
- const byFranchise = new Set(
- this.filteredRoms
- .filter((rom) =>
- rom.franchises.some((franchise) => franchise === franchiseToFilter),
- )
- .map((rom) => rom.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byFranchise.intersection(this._filteredIDs);
- },
- _filterCollection(collectionToFilter: string) {
- const byCollection = new Set(
- this.filteredRoms
- .filter((rom) =>
- rom.meta_collections.some(
- (collection) => collection === collectionToFilter,
- ),
- )
- .map((rom) => rom.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byCollection.intersection(this._filteredIDs);
- },
- _filterCompany(companyToFilter: string) {
- const byCompany = new Set(
- this.filteredRoms
- .filter((rom) =>
- rom.companies.some((company) => company === companyToFilter),
- )
- .map((rom) => rom.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byCompany.intersection(this._filteredIDs);
- },
- _filterAgeRating(ageRatingToFilter: string) {
- const byAgeRating = new Set(
- this.filteredRoms
- .filter((rom) =>
- rom.age_ratings.some(
- (ageRating) => ageRating === ageRatingToFilter,
- ),
- )
- .map((rom) => rom.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byAgeRating.intersection(this._filteredIDs);
- },
- _filterRegion(regionToFilter: string) {
- const byRegion = new Set(
- this.filteredRoms
- .filter((rom) =>
- rom.regions.some((region) => region === regionToFilter),
- )
- .map((rom) => rom.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byRegion.intersection(this._filteredIDs);
- },
- _filterLanguage(languageToFilter: string) {
- const byLanguage = new Set(
- this.filteredRoms
- .filter((rom) =>
- rom.languages.some((language) => language === languageToFilter),
- )
- .map((rom) => rom.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byLanguage.intersection(this._filteredIDs);
- },
- _filterStatus(statusToFilter: string) {
- const stf = getStatusKeyForText(statusToFilter);
-
- const byStatus = new Set(
- this.filteredRoms
- .filter(
- (rom) =>
- rom.rom_user.status === stf ||
- (stf === "now_playing" && rom.rom_user.now_playing) ||
- (stf === "backlogged" && rom.rom_user.backlogged) ||
- (stf === "hidden" && rom.rom_user.hidden),
- )
- // Filter hidden roms if the status is not hidden
- .filter((rom) => (stf === "hidden" ? true : !rom.rom_user.hidden))
- .map((rom) => rom.id),
- );
-
- // @ts-expect-error intersection is recently defined on Set
- this._filteredIDs = byStatus.intersection(this._filteredIDs);
- },
- // Selected roms
setSelection(roms: SimpleRom[]) {
- this._selectedIDs = new Set(roms.map((rom) => rom.id));
+ this.selectedIDs = new Set(roms.map((rom) => rom.id));
},
addToSelection(rom: SimpleRom) {
- this._selectedIDs.add(rom.id);
+ this.selectedIDs.add(rom.id);
},
removeFromSelection(rom: SimpleRom) {
- this._selectedIDs.delete(rom.id);
+ this.selectedIDs.delete(rom.id);
},
updateLastSelected(index: number) {
this.lastSelectedIndex = index;
},
- isSelecting() {
- this.selecting = !this.selecting;
+ setSelecting() {
+ this.selectingRoms = !this.selectingRoms;
},
resetSelection() {
- this._selectedIDs = new Set();
+ this.selectedIDs = new Set();
this.lastSelectedIndex = -1;
},
+ setOrderBy(orderBy: keyof SimpleRom) {
+ this.orderBy = orderBy;
+ },
+ setOrderDir(orderDir: "asc" | "desc") {
+ this.orderDir = orderDir;
+ },
isSimpleRom(rom: SimpleRom | SearchRomSchema): rom is SimpleRom {
return !isNull(rom.id) && !isUndefined(rom.id);
},
diff --git a/frontend/src/styles/common.css b/frontend/src/styles/common.css
index 18bd6b14c..8f9a5aea2 100644
--- a/frontend/src/styles/common.css
+++ b/frontend/src/styles/common.css
@@ -3,14 +3,14 @@ body {
background-color: rgba(var(--v-theme-background)) !important;
overflow-y: auto;
}
+.main-layout {
+ z-index: 1010 !important;
+}
.text-shadow {
text-shadow:
1px 1px 3px #000000,
0 0 3px #000000 !important;
}
-.v-progress-linear {
- z-index: 9999 !important;
-}
.translucent {
backdrop-filter: blur(3px) !important;
text-shadow:
@@ -63,9 +63,26 @@ body {
border: 1px solid rgba(var(--v-theme-primary)) !important;
transform: scale(1.05);
}
-#main-app-bar {
- top: 0 !important;
+.greyscale {
+ filter: grayscale(100%);
}
-#main-app-bar ~ #gallery-app-bar {
- top: 45px !important;
+.unset-height {
+ height: unset !important;
+}
+.drawer-mobile {
+ width: calc(100% - 16px) !important;
+}
+.bottom-0 {
+ bottom: 0 !important;
+}
+.bottom-50 {
+ bottom: 50px !important;
+}
+.max-h-50 {
+ height: fit-content !important;
+ max-height: 50dvh !important;
+}
+.max-h-70 {
+ height: fit-content !important;
+ max-height: 70dvh !important;
}
diff --git a/frontend/src/styles/scrollbar.css b/frontend/src/styles/scrollbar.css
index e363166aa..43f3ecce9 100644
--- a/frontend/src/styles/scrollbar.css
+++ b/frontend/src/styles/scrollbar.css
@@ -1,6 +1,6 @@
::-webkit-scrollbar {
- width: 2px;
- height: 2px;
+ width: 4px;
+ height: 4px;
}
::-webkit-scrollbar-track {
background: transparent;
diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts
index 42379c3dd..ae4fbd8dc 100644
--- a/frontend/src/utils/index.ts
+++ b/frontend/src/utils/index.ts
@@ -2,6 +2,10 @@ import cronstrue from "cronstrue";
import type { SimpleRom } from "@/stores/roms";
import type { Heartbeat } from "@/stores/heartbeat";
import type { RomFileSchema, RomUserStatus } from "@/__generated__";
+import { computed } from "vue";
+import { useDisplay } from "vuetify";
+import { storeToRefs } from "pinia";
+import storeNavigation from "@/stores/navigation";
/**
* Views configuration object.
@@ -47,6 +51,25 @@ export const views: Record<
},
};
+/**
+ * Get icon associated to role.
+ *
+ * @param role The role as string.
+ * @returns The mdi icon string.
+ */
+export function getRoleIcon(role: string) {
+ switch (role) {
+ case "admin":
+ return "mdi-shield-crown-outline";
+ case "editor":
+ return "mdi-file-edit-outline";
+ case "viewer":
+ return "mdi-book-open-variant-outline";
+ default:
+ return "mdi-account";
+ }
+}
+
/**
* Default path for user avatars.
*/
@@ -107,7 +130,9 @@ export function getDownloadLink({
rom: SimpleRom;
fileIDs?: number[];
}) {
- return `${window.location.origin}${encodeURI(getDownloadPath({ rom, fileIDs }))}`;
+ return `${window.location.origin}${encodeURI(
+ getDownloadPath({ rom, fileIDs }),
+ )}`;
}
/**
@@ -563,7 +588,8 @@ export function getTextForStatus(status: PlayingStatus) {
* @param text The text to convert.
* @returns The corresponding status key.
*/
-export function getStatusKeyForText(text: string) {
+export function getStatusKeyForText(text: string | null) {
+ if (!text) return null;
return inverseRomStatusMap[text];
}
@@ -590,3 +616,18 @@ export function is3DSCIARom(rom: SimpleRom): boolean {
return hasValidExtension || hasValidFile;
}
+
+export function calculateMainLayoutWidth() {
+ const { smAndDown } = useDisplay();
+ const navigationStore = storeNavigation();
+ const { mainBarCollapsed } = storeToRefs(navigationStore);
+ const calculatedWidth = computed(() => {
+ return smAndDown.value
+ ? "calc(100% - 16px) !important"
+ : mainBarCollapsed.value
+ ? "calc(100% - 76px) !important"
+ : "calc(100% - 116px) !important";
+ });
+
+ return { calculatedWidth };
+}
diff --git a/frontend/src/views/Auth/Setup.vue b/frontend/src/views/Auth/Setup.vue
index 753ab0ef8..24b822fa4 100644
--- a/frontend/src/views/Auth/Setup.vue
+++ b/frontend/src/views/Auth/Setup.vue
@@ -9,8 +9,10 @@ import { ROUTES } from "@/plugins/router";
import type { Emitter } from "mitt";
import { computed, inject, ref } from "vue";
import { useDisplay } from "vuetify";
+import { useI18n } from "vue-i18n";
// Props
+const { t } = useI18n();
const { xs } = useDisplay();
const emitter = inject>("emitter");
const heartbeat = storeHeartbeat();
@@ -115,7 +117,7 @@ async function finishWizard() {
;
@@ -45,52 +44,40 @@ const emitter = inject>("emitter");
// Functions
async function fetchRoms() {
- if (gettingRoms.value) return;
-
- gettingRoms.value = true;
+ if (fetchingRoms.value) return;
emitter?.emit("showLoadingDialog", {
- loading: gettingRoms.value,
+ loading: true,
scrim: false,
});
- try {
- const { data } = await romApi.getRoms({
- collectionId: romsStore.currentCollection?.id,
- virtualCollectionId: romsStore.currentVirtualCollection?.id,
+ romsStore
+ .fetchRoms(galleryFilterStore)
+ .then(() => {
+ emitter?.emit("showLoadingDialog", {
+ loading: false,
+ scrim: false,
+ });
+ })
+ .catch((error) => {
+ emitter?.emit("snackbarShow", {
+ msg: `Couldn't fetch roms for platform ID ${currentPlatform.value?.id}: ${error}`,
+ icon: "mdi-close-circle",
+ color: "red",
+ timeout: 4000,
+ });
+ noCollectionError.value = true;
+ emitter?.emit("showLoadingDialog", {
+ loading: false,
+ scrim: false,
+ });
});
- romsStore.set(data);
- romsStore.setFiltered(data, galleryFilterStore);
-
- gettingRoms.value = false;
- emitter?.emit("showLoadingDialog", {
- loading: gettingRoms.value,
- scrim: false,
- });
- } catch (error) {
- emitter?.emit("snackbarShow", {
- msg: `Couldn't fetch roms for collection ID ${currentCollection.value?.id}: ${error}`,
- icon: "mdi-close-circle",
- color: "red",
- timeout: 4000,
- });
- console.error(
- `Couldn't fetch roms for collection ID ${currentCollection.value?.id}: ${error}`,
- );
- noCollectionError.value = true;
- } finally {
- gettingRoms.value = false;
- emitter?.emit("showLoadingDialog", {
- loading: gettingRoms.value,
- scrim: false,
- });
- }
}
function onGameClick(emitData: { rom: SimpleRom; event: MouseEvent }) {
let index = filteredRoms.value.indexOf(emitData.rom);
if (
emitData.event.shiftKey ||
- romsStore.selecting ||
+ romsStore.selectingRoms ||
romsStore.selectedRoms.length > 0
) {
emitData.event.preventDefault();
@@ -141,32 +128,25 @@ function onGameTouchEnd() {
}
function onScroll() {
- if (galleryViewStore.currentView != 2) {
- window.setTimeout(async () => {
- const { scrollTop, scrollHeight, clientHeight } =
- document.documentElement;
- scrolledToTop.value = scrollTop === 0;
- const totalScrollableHeight = scrollHeight - clientHeight;
- const ninetyPercentPoint = totalScrollableHeight * 0.9;
- if (
- scrollTop >= ninetyPercentPoint &&
- itemsShown.value < filteredRoms.value.length
- ) {
- itemsShown.value = itemsShown.value + itemsPerBatch.value;
- galleryViewStore.scroll = scrollHeight;
- }
- }, 100);
- clearTimeout(timeout);
- }
+ clearTimeout(timeout);
+
+ window.setTimeout(async () => {
+ scrolledToTop.value = window.scrollY === 0;
+ if (
+ window.innerHeight + window.scrollY >= document.body.offsetHeight - 60 &&
+ fetchTotalRoms.value > allRoms.value.length
+ ) {
+ await fetchRoms();
+ }
+ }, 100);
}
function resetGallery() {
romsStore.reset();
- galleryFilterStore.reset();
+ galleryFilterStore.resetFilters();
galleryFilterStore.activeFilterDrawer = false;
scrolledToTop.value = true;
noCollectionError.value = false;
- itemsShown.value = itemsPerBatch.value;
}
onMounted(async () => {
@@ -192,15 +172,12 @@ onMounted(async () => {
allRoms.value.length === 0) &&
collection
) {
- romsStore.setCurrentCollection(collection);
- romsStore.setCurrentVirtualCollection(null);
resetGallery();
+ romsStore.setCurrentCollection(collection);
await fetchRoms();
}
- window.addEventListener("wheel", onScroll);
window.addEventListener("scroll", onScroll);
- window.addEventListener("touchmove", onScroll);
}
},
{ immediate: true }, // Ensure watcher is triggered immediately
@@ -223,15 +200,12 @@ onMounted(async () => {
allRoms.value.length === 0) &&
collection
) {
- romsStore.setCurrentCollection(null);
- romsStore.setCurrentVirtualCollection(collection);
resetGallery();
+ romsStore.setCurrentVirtualCollection(collection);
await fetchRoms();
}
- window.addEventListener("wheel", onScroll);
window.addEventListener("scroll", onScroll);
- window.addEventListener("touchmove", onScroll);
}
},
{ immediate: true }, // Ensure watcher is triggered immediately
@@ -262,7 +236,6 @@ onBeforeRouteUpdate(async (to, from) => {
collection
) {
romsStore.setCurrentCollection(collection);
- romsStore.setCurrentVirtualCollection(null);
await fetchRoms();
}
}
@@ -295,25 +268,23 @@ onBeforeRouteUpdate(async (to, from) => {
});
onBeforeUnmount(() => {
- window.removeEventListener("wheel", onScroll);
window.removeEventListener("scroll", onScroll);
- window.removeEventListener("touchmove", onScroll);
});
-
+
-
+
{
-
-
-
+
+
+
+
+
-
+
diff --git a/frontend/src/views/Gallery/Platform.vue b/frontend/src/views/Gallery/Platform.vue
index 9f356f46c..dc3cd2892 100644
--- a/frontend/src/views/Gallery/Platform.vue
+++ b/frontend/src/views/Gallery/Platform.vue
@@ -3,10 +3,10 @@ import GalleryAppBar from "@/components/Gallery/AppBar/Platform/Base.vue";
import FabOverlay from "@/components/Gallery/FabOverlay.vue";
import EmptyGame from "@/components/common/EmptyStates/EmptyGame.vue";
import EmptyPlatform from "@/components/common/EmptyStates/EmptyPlatform.vue";
-import Skeleton from "@/components/Gallery/Skeleton.vue";
import GameCard from "@/components/common/Game/Card/Base.vue";
-import GameDataTable from "@/components/common/Game/Table.vue";
-import romApi from "@/services/api/rom";
+import Skeleton from "@/components/Gallery/Skeleton.vue";
+import LoadMoreBtn from "@/components/Gallery/LoadMoreBtn.vue";
+import GameTable from "@/components/common/Game/Table.vue";
import storeGalleryFilter from "@/stores/galleryFilter";
import storeGalleryView from "@/stores/galleryView";
import storePlatforms from "@/stores/platforms";
@@ -33,57 +33,51 @@ const {
selectedRoms,
currentPlatform,
currentCollection,
- itemsPerBatch,
- gettingRoms,
+ fetchingRoms,
+ fetchTotalRoms,
} = storeToRefs(romsStore);
-const itemsShown = ref(itemsPerBatch.value);
const noPlatformError = ref(false);
const router = useRouter();
-let timeout: ReturnType;
const emitter = inject>("emitter");
+let timeout: ReturnType;
// Functions
async function fetchRoms() {
- if (gettingRoms.value) return;
+ if (fetchingRoms.value) return;
- gettingRoms.value = true;
emitter?.emit("showLoadingDialog", {
- loading: gettingRoms.value,
+ loading: true,
scrim: false,
});
- try {
- const { data } = await romApi.getRoms({
- platformId: romsStore.currentPlatform?.id,
+ romsStore
+ .fetchRoms(galleryFilterStore)
+ .then(() => {
+ emitter?.emit("showLoadingDialog", {
+ loading: false,
+ scrim: false,
+ });
+ })
+ .catch((error) => {
+ emitter?.emit("snackbarShow", {
+ msg: `Couldn't fetch roms for platform ID ${currentPlatform.value?.id}: ${error}`,
+ icon: "mdi-close-circle",
+ color: "red",
+ timeout: 4000,
+ });
+ noPlatformError.value = true;
+ emitter?.emit("showLoadingDialog", {
+ loading: false,
+ scrim: false,
+ });
});
-
- romsStore.set(data);
- romsStore.setFiltered(data, galleryFilterStore);
- } catch (error) {
- emitter?.emit("snackbarShow", {
- msg: `Couldn't fetch roms for platform ID ${currentPlatform.value?.id}: ${error}`,
- icon: "mdi-close-circle",
- color: "red",
- timeout: 4000,
- });
- console.error(
- `Couldn't fetch roms for platform ID ${currentPlatform.value?.id}: ${error}`,
- );
- noPlatformError.value = true;
- } finally {
- gettingRoms.value = false;
- emitter?.emit("showLoadingDialog", {
- loading: gettingRoms.value,
- scrim: false,
- });
- }
}
function onGameClick(emitData: { rom: SimpleRom; event: MouseEvent }) {
let index = filteredRoms.value.indexOf(emitData.rom);
if (
emitData.event.shiftKey ||
- romsStore.selecting ||
+ romsStore.selectingRoms ||
romsStore.selectedRoms.length > 0
) {
emitData.event.preventDefault();
@@ -134,34 +128,25 @@ function onGameTouchEnd() {
}
function onScroll() {
- if (galleryViewStore.currentView != 2) {
- clearTimeout(timeout);
+ clearTimeout(timeout);
- window.setTimeout(async () => {
- const { scrollTop, scrollHeight, clientHeight } =
- document.documentElement;
- scrolledToTop.value = scrollTop === 0;
- const totalScrollableHeight = scrollHeight - clientHeight;
- const ninetyPercentPoint = totalScrollableHeight * 0.9;
- if (
- scrollTop >= ninetyPercentPoint &&
- itemsShown.value < filteredRoms.value.length
- ) {
- itemsShown.value = itemsShown.value + itemsPerBatch.value;
- galleryViewStore.scroll = scrollHeight;
- }
- }, 100);
- clearTimeout(timeout);
- }
+ window.setTimeout(async () => {
+ scrolledToTop.value = window.scrollY === 0;
+ if (
+ window.innerHeight + window.scrollY >= document.body.offsetHeight - 60 &&
+ fetchTotalRoms.value > allRoms.value.length
+ ) {
+ await fetchRoms();
+ }
+ }, 100);
}
function resetGallery() {
romsStore.reset();
- galleryFilterStore.reset();
+ galleryFilterStore.resetFilters();
galleryFilterStore.activeFilterDrawer = false;
scrolledToTop.value = true;
noPlatformError.value = false;
- itemsShown.value = itemsPerBatch.value;
}
onMounted(async () => {
@@ -183,14 +168,12 @@ onMounted(async () => {
allRoms.value.length === 0) &&
platform
) {
- romsStore.setCurrentPlatform(platform);
resetGallery();
+ romsStore.setCurrentPlatform(platform);
await fetchRoms();
}
- window.addEventListener("wheel", onScroll);
window.addEventListener("scroll", onScroll);
- window.addEventListener("touchmove", onScroll);
} else {
noPlatformError.value = true;
}
@@ -234,24 +217,22 @@ onBeforeRouteUpdate(async (to, from) => {
});
onBeforeUnmount(() => {
- window.removeEventListener("wheel", onScroll);
window.removeEventListener("scroll", onScroll);
- window.removeEventListener("touchmove", onScroll);
});
-
+
-
+
{
-
-
-
+
+
+
+
+
-
+
diff --git a/frontend/src/views/Gallery/Search.vue b/frontend/src/views/Gallery/Search.vue
index e74ca5c9e..cbbfcc850 100644
--- a/frontend/src/views/Gallery/Search.vue
+++ b/frontend/src/views/Gallery/Search.vue
@@ -5,42 +5,44 @@ import EmptySearch from "@/components/common/EmptyStates/EmptySearch.vue";
import EmptyGame from "@/components/common/EmptyStates/EmptyGame.vue";
import GameCard from "@/components/common/Game/Card/Base.vue";
import Skeleton from "@/components/Gallery/Skeleton.vue";
-import GameDataTable from "@/components/common/Game/Table.vue";
+import LoadMoreBtn from "@/components/Gallery/LoadMoreBtn.vue";
+import GameTable from "@/components/common/Game/Table.vue";
import storeGalleryFilter from "@/stores/galleryFilter";
import storeGalleryView from "@/stores/galleryView";
import storeRoms, { type SimpleRom } from "@/stores/roms";
import { views } from "@/utils";
import { ROUTES } from "@/plugins/router";
import { storeToRefs } from "pinia";
-import { onBeforeUnmount, onMounted, ref } from "vue";
+import { inject, onBeforeUnmount, onMounted, ref } from "vue";
import { useRouter } from "vue-router";
+import type { Emitter } from "mitt";
+import type { Events } from "@/types/emitter";
// Props
const galleryViewStore = storeGalleryView();
const { scrolledToTop, currentView } = storeToRefs(galleryViewStore);
const galleryFilterStore = storeGalleryFilter();
-const { searchText } = storeToRefs(galleryFilterStore);
+const { searchTerm } = storeToRefs(galleryFilterStore);
const romsStore = storeRoms();
const router = useRouter();
-const initialSearch = ref(false);
const {
- allRoms,
filteredRoms,
selectedRoms,
currentPlatform,
currentCollection,
- itemsPerBatch,
- gettingRoms,
+ fetchingRoms,
+ initialSearch,
+ fetchTotalRoms,
} = storeToRefs(romsStore);
+const emitter = inject>("emitter");
-const itemsShown = ref(itemsPerBatch.value);
let timeout: ReturnType;
function onGameClick(emitData: { rom: SimpleRom; event: MouseEvent }) {
let index = filteredRoms.value.indexOf(emitData.rom);
if (
emitData.event.shiftKey ||
- romsStore.selecting ||
+ romsStore.selectingRoms ||
romsStore.selectedRoms.length > 0
) {
emitData.event.preventDefault();
@@ -90,63 +92,67 @@ function onGameTouchEnd() {
clearTimeout(timeout);
}
+function fetchRoms() {
+ romsStore
+ .fetchRoms(galleryFilterStore)
+ .catch((error) => {
+ emitter?.emit("snackbarShow", {
+ msg: `Couldn't fetch roms: ${error}`,
+ icon: "mdi-close-circle",
+ color: "red",
+ timeout: 4000,
+ });
+ })
+ .finally(() => {
+ galleryFilterStore.activeFilterDrawer = false;
+ });
+}
+
function onScroll() {
- if (currentView.value != 2) {
- window.setTimeout(async () => {
- const { scrollTop, scrollHeight, clientHeight } =
- document.documentElement;
- scrolledToTop.value = scrollTop === 0;
- const totalScrollableHeight = scrollHeight - clientHeight;
- const ninetyPercentPoint = totalScrollableHeight * 0.9;
- if (
- scrollTop >= ninetyPercentPoint &&
- itemsShown.value < filteredRoms.value.length
- ) {
- itemsShown.value = itemsShown.value + itemsPerBatch.value;
- galleryViewStore.scroll = scrollHeight;
- }
- }, 100);
- clearTimeout(timeout);
- }
+ clearTimeout(timeout);
+
+ window.setTimeout(async () => {
+ scrolledToTop.value = window.scrollY === 0;
+ if (
+ window.innerHeight + window.scrollY >= document.body.offsetHeight - 60 &&
+ fetchTotalRoms.value > filteredRoms.value.length
+ ) {
+ await fetchRoms();
+ }
+ }, 100);
}
function resetGallery() {
romsStore.reset();
- galleryFilterStore.reset();
+ galleryFilterStore.resetFilters();
galleryFilterStore.activeFilterDrawer = false;
scrolledToTop.value = true;
- itemsShown.value = itemsPerBatch.value;
}
onMounted(async () => {
currentPlatform.value = null;
currentCollection.value = null;
resetGallery();
- window.addEventListener("wheel", onScroll);
window.addEventListener("scroll", onScroll);
- window.addEventListener("touchmove", onScroll);
});
onBeforeUnmount(() => {
- window.removeEventListener("wheel", onScroll);
window.removeEventListener("scroll", onScroll);
- window.removeEventListener("touchmove", onScroll);
- searchText.value = "";
+ searchTerm.value = "";
});
-
+
-
+
-
{
-
-
-
+
+
+
+
+
-
+
diff --git a/frontend/src/views/GameDetails.vue b/frontend/src/views/GameDetails.vue
index 21ecc0006..92d34b0ac 100644
--- a/frontend/src/views/GameDetails.vue
+++ b/frontend/src/views/GameDetails.vue
@@ -45,11 +45,11 @@ const emitter = inject>("emitter");
const noRomError = ref(false);
const romsStore = storeRoms();
const platformsStore = storePlatforms();
-const { currentRom, gettingRoms } = storeToRefs(romsStore);
+const { currentRom, fetchingRoms } = storeToRefs(romsStore);
// Functions
async function fetchDetails() {
- gettingRoms.value = true;
+ fetchingRoms.value = true;
await romApi
.getRom({ romId: parseInt(route.params.rom as string) })
.then(({ data }) => {
@@ -61,7 +61,7 @@ async function fetchDetails() {
})
.finally(() => {
emitter?.emit("showLoadingDialog", { loading: false, scrim: false });
- gettingRoms.value = false;
+ fetchingRoms.value = false;
});
}
@@ -78,7 +78,9 @@ onBeforeMount(async () => {
if (currentRom.value) {
const currentPlatform = platformsStore.get(currentRom.value.platform_id);
- if (currentPlatform) romsStore.setCurrentPlatform(currentPlatform);
+ if (currentPlatform && currentPlatform != romsStore.currentPlatform) {
+ romsStore.setCurrentPlatform(currentPlatform);
+ }
}
const downloadStore = storeDownload();
@@ -99,10 +101,14 @@ watch(
-
+
-
+
@@ -111,11 +117,8 @@ watch(
-
-
+
+
.title-desktop {
margin-top: -190px;
- top: 290px;
- left: 350px;
}
#artwork-container {
diff --git a/frontend/src/views/Home.vue b/frontend/src/views/Home.vue
index 1b8ba0503..33e5ecaab 100644
--- a/frontend/src/views/Home.vue
+++ b/frontend/src/views/Home.vue
@@ -52,8 +52,8 @@ onMounted(async () => {
fetchingContinuePlaying.value = true;
romApi
.getRecentRoms()
- .then(({ data: recentData }) => {
- romsStore.setRecentRoms(recentData);
+ .then(({ data: { items } }) => {
+ romsStore.setRecentRoms(items);
})
.catch((error) => {
console.error(error);
@@ -61,11 +61,12 @@ onMounted(async () => {
.finally(() => {
fetchingRecentAdded.value = false;
});
+
romApi
.getRecentPlayedRoms()
- .then(({ data: recentPlayedData }) => {
+ .then(({ data: { items } }) => {
romsStore.setContinuePlayedRoms(
- recentPlayedData.filter((rom) => rom.rom_user.last_played),
+ items.filter((rom) => rom.rom_user.last_played),
);
})
.catch((error) => {
@@ -78,28 +79,33 @@ onMounted(async () => {
-
+
-
+
+
+
-
-
diff --git a/frontend/src/views/Player/EmulatorJS/Base.vue b/frontend/src/views/Player/EmulatorJS/Base.vue
index ba85a3799..bdb084712 100644
--- a/frontend/src/views/Player/EmulatorJS/Base.vue
+++ b/frontend/src/views/Player/EmulatorJS/Base.vue
@@ -17,11 +17,13 @@ import CacheDialog from "./CacheDialog.vue";
import type { Emitter } from "mitt";
import type { Events } from "@/types/emitter";
import { getEmptyCoverImage } from "@/utils/covers";
+import { useDisplay } from "vuetify";
const EMULATORJS_VERSION = "4.2.1";
// Props
const { t } = useI18n();
+const { smAndDown } = useDisplay();
const route = useRoute();
const auth = storeAuth();
const romsStore = storeRoms();
@@ -240,7 +242,7 @@ onBeforeUnmount(async () => {
"
/>
{
"
/>
-
+
@@ -318,7 +320,7 @@ onBeforeUnmount(async () => {
-
+
@@ -404,8 +406,8 @@ onBeforeUnmount(async () => {
>
+import RDialog from "@/components/common/RDialog.vue";
+import userApi from "@/services/api/user";
+import storeAuth from "@/stores/auth";
+import storeUsers from "@/stores/users";
+import type { Events } from "@/types/emitter";
+import type { Emitter } from "mitt";
+import type { UserItem } from "@/types/user";
+import { defaultAvatarPath, getRoleIcon } from "@/utils";
+import { inject, ref, onMounted, onUnmounted } from "vue";
+import { useDisplay } from "vuetify";
+import { useI18n } from "vue-i18n";
+import { storeToRefs } from "pinia";
+
+// Props
+const { t } = useI18n();
+const { lgAndUp } = useDisplay();
+const auth = storeAuth();
+const { user } = storeToRefs(auth);
+const userToEdit = ref(null);
+const usersStore = storeUsers();
+const imagePreviewUrl = ref("");
+const emitter = inject>("emitter");
+
+function triggerFileInput() {
+ const fileInput = document.getElementById("file-input");
+ fileInput?.click();
+}
+
+function previewImage(event: Event) {
+ const input = event.target as HTMLInputElement;
+ if (!input.files) return;
+
+ const reader = new FileReader();
+ reader.onload = () => {
+ imagePreviewUrl.value = reader.result?.toString();
+ };
+ if (input.files[0]) {
+ reader.readAsDataURL(input.files[0]);
+ }
+}
+
+function editUser() {
+ if (!userToEdit.value) return;
+
+ userApi
+ .updateUser(userToEdit.value)
+ .then(({ data }) => {
+ emitter?.emit("snackbarShow", {
+ msg: `User ${data.username} updated successfully`,
+ icon: "mdi-check-bold",
+ color: "green",
+ timeout: 5000,
+ });
+ usersStore.update(data);
+ if (data.id == auth.user?.id) {
+ auth.setUser(data);
+ }
+ })
+ .catch(({ response, message }) => {
+ emitter?.emit("snackbarShow", {
+ msg: `Unable to edit user: ${
+ response?.data?.detail || response?.statusText || message
+ }`,
+ icon: "mdi-close-circle",
+ color: "red",
+ timeout: 5000,
+ });
+ });
+
+ emitter?.emit("refreshDrawer", null);
+}
+
+onMounted(() => {
+ userToEdit.value = { ...user.value, password: "", avatar: undefined };
+});
+
+onUnmounted(() => {
+ imagePreviewUrl.value = "";
+});
+
+
+
+
+
+
+
+
+
+ mdi-pencil
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ getRoleIcon(item.title) }}
+ {{ item.title }}
+
+
+
+
+
+ {{ getRoleIcon(item.title) }}
+
+
+
+
+
+
+
+
+
+ {{ t("common.apply") }}
+
+
+
+
+
diff --git a/poetry.lock b/poetry.lock
index 144f22573..07b2b4108 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -175,10 +175,6 @@ files = [
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a37b8f0391212d29b3a91a799c8e4a2855e0576911cdfb2515487e30e322253d"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:e84799f09591700a4154154cab9787452925578841a94321d5ee8fb9a9a328f0"},
{file = "Brotli-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f66b5337fa213f1da0d9000bc8dc0cb5b896b726eefd9c6046f699b169c41b9e"},
- {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5dab0844f2cf82be357a0eb11a9087f70c5430b2c241493fc122bb6f2bb0917c"},
- {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e4fe605b917c70283db7dfe5ada75e04561479075761a0b3866c081d035b01c1"},
- {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:1e9a65b5736232e7a7f91ff3d02277f11d339bf34099a56cdab6a8b3410a02b2"},
- {file = "Brotli-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:58d4b711689366d4a03ac7957ab8c28890415e267f9b6589969e74b6e42225ec"},
{file = "Brotli-1.1.0-cp310-cp310-win32.whl", hash = "sha256:be36e3d172dc816333f33520154d708a2657ea63762ec16b62ece02ab5e4daf2"},
{file = "Brotli-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:0c6244521dda65ea562d5a69b9a26120769b7a9fb3db2fe9545935ed6735b128"},
{file = "Brotli-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a3daabb76a78f829cafc365531c972016e4aa8d5b4bf60660ad8ecee19df7ccc"},
@@ -191,14 +187,8 @@ files = [
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:19c116e796420b0cee3da1ccec3b764ed2952ccfcc298b55a10e5610ad7885f9"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:510b5b1bfbe20e1a7b3baf5fed9e9451873559a976c1a78eebaa3b86c57b4265"},
{file = "Brotli-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a1fd8a29719ccce974d523580987b7f8229aeace506952fa9ce1d53a033873c8"},
- {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c247dd99d39e0338a604f8c2b3bc7061d5c2e9e2ac7ba9cc1be5a69cb6cd832f"},
- {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1b2c248cd517c222d89e74669a4adfa5577e06ab68771a529060cf5a156e9757"},
- {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:2a24c50840d89ded6c9a8fdc7b6ed3692ed4e86f1c4a4a938e1e92def92933e0"},
- {file = "Brotli-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f31859074d57b4639318523d6ffdca586ace54271a73ad23ad021acd807eb14b"},
{file = "Brotli-1.1.0-cp311-cp311-win32.whl", hash = "sha256:39da8adedf6942d76dc3e46653e52df937a3c4d6d18fdc94a7c29d263b1f5b50"},
{file = "Brotli-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:aac0411d20e345dc0920bdec5548e438e999ff68d77564d5e9463a7ca9d3e7b1"},
- {file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:32d95b80260d79926f5fab3c41701dbb818fde1c9da590e77e571eefd14abe28"},
- {file = "Brotli-1.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b760c65308ff1e462f65d69c12e4ae085cff3b332d894637f6273a12a482d09f"},
{file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:316cc9b17edf613ac76b1f1f305d2a748f1b976b033b049a6ecdfd5612c70409"},
{file = "Brotli-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:caf9ee9a5775f3111642d33b86237b05808dafcd6268faa492250e9b78046eb2"},
{file = "Brotli-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:70051525001750221daa10907c77830bc889cb6d865cc0b813d9db7fefc21451"},
@@ -209,24 +199,8 @@ files = [
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4093c631e96fdd49e0377a9c167bfd75b6d0bad2ace734c6eb20b348bc3ea180"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:7e4c4629ddad63006efa0ef968c8e4751c5868ff0b1c5c40f76524e894c50248"},
{file = "Brotli-1.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:861bf317735688269936f755fa136a99d1ed526883859f86e41a5d43c61d8966"},
- {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:87a3044c3a35055527ac75e419dfa9f4f3667a1e887ee80360589eb8c90aabb9"},
- {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c5529b34c1c9d937168297f2c1fde7ebe9ebdd5e121297ff9c043bdb2ae3d6fb"},
- {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ca63e1890ede90b2e4454f9a65135a4d387a4585ff8282bb72964fab893f2111"},
- {file = "Brotli-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e79e6520141d792237c70bcd7a3b122d00f2613769ae0cb61c52e89fd3443839"},
{file = "Brotli-1.1.0-cp312-cp312-win32.whl", hash = "sha256:5f4d5ea15c9382135076d2fb28dde923352fe02951e66935a9efaac8f10e81b0"},
{file = "Brotli-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:906bc3a79de8c4ae5b86d3d75a8b77e44404b0f4261714306e3ad248d8ab0951"},
- {file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8bf32b98b75c13ec7cf774164172683d6e7891088f6316e54425fde1efc276d5"},
- {file = "Brotli-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7bc37c4d6b87fb1017ea28c9508b36bbcb0c3d18b4260fcdf08b200c74a6aee8"},
- {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c0ef38c7a7014ffac184db9e04debe495d317cc9c6fb10071f7fefd93100a4f"},
- {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91d7cc2a76b5567591d12c01f019dd7afce6ba8cba6571187e21e2fc418ae648"},
- {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a93dde851926f4f2678e704fadeb39e16c35d8baebd5252c9fd94ce8ce68c4a0"},
- {file = "Brotli-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f0db75f47be8b8abc8d9e31bc7aad0547ca26f24a54e6fd10231d623f183d089"},
- {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6967ced6730aed543b8673008b5a391c3b1076d834ca438bbd70635c73775368"},
- {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:7eedaa5d036d9336c95915035fb57422054014ebdeb6f3b42eac809928e40d0c"},
- {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d487f5432bf35b60ed625d7e1b448e2dc855422e87469e3f450aa5552b0eb284"},
- {file = "Brotli-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:832436e59afb93e1836081a20f324cb185836c617659b07b129141a8426973c7"},
- {file = "Brotli-1.1.0-cp313-cp313-win32.whl", hash = "sha256:43395e90523f9c23a3d5bdf004733246fba087f2948f87ab28015f12359ca6a0"},
- {file = "Brotli-1.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:9011560a466d2eb3f5a6e4929cf4a09be405c64154e12df0dd72713f6500e32b"},
{file = "Brotli-1.1.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a090ca607cbb6a34b0391776f0cb48062081f5f60ddcce5d11838e67a01928d1"},
{file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2de9d02f5bda03d27ede52e8cfe7b865b066fa49258cbab568720aa5be80a47d"},
{file = "Brotli-1.1.0-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2333e30a5e00fe0fe55903c8832e08ee9c3b1382aacf4db26664a16528d51b4b"},
@@ -236,10 +210,6 @@ files = [
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:fd5f17ff8f14003595ab414e45fce13d073e0762394f957182e69035c9f3d7c2"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:069a121ac97412d1fe506da790b3e69f52254b9df4eb665cd42460c837193354"},
{file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:e93dfc1a1165e385cc8239fab7c036fb2cd8093728cbd85097b284d7b99249a2"},
- {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_aarch64.whl", hash = "sha256:aea440a510e14e818e67bfc4027880e2fb500c2ccb20ab21c7a7c8b5b4703d75"},
- {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_i686.whl", hash = "sha256:6974f52a02321b36847cd19d1b8e381bf39939c21efd6ee2fc13a28b0d99348c"},
- {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_ppc64le.whl", hash = "sha256:a7e53012d2853a07a4a79c00643832161a910674a893d296c9f1259859a289d2"},
- {file = "Brotli-1.1.0-cp36-cp36m-musllinux_1_2_x86_64.whl", hash = "sha256:d7702622a8b40c49bffb46e1e3ba2e81268d5c04a34f460978c6b5517a34dd52"},
{file = "Brotli-1.1.0-cp36-cp36m-win32.whl", hash = "sha256:a599669fd7c47233438a56936988a2478685e74854088ef5293802123b5b2460"},
{file = "Brotli-1.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d143fd47fad1db3d7c27a1b1d66162e855b5d50a89666af46e1679c496e8e579"},
{file = "Brotli-1.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:11d00ed0a83fa22d29bc6b64ef636c4552ebafcef57154b4ddd132f5638fbd1c"},
@@ -251,10 +221,6 @@ files = [
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:919e32f147ae93a09fe064d77d5ebf4e35502a8df75c29fb05788528e330fe74"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:23032ae55523cc7bccb4f6a0bf368cd25ad9bcdcc1990b64a647e7bbcce9cb5b"},
{file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:224e57f6eac61cc449f498cc5f0e1725ba2071a3d4f48d5d9dffba42db196438"},
- {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:cb1dac1770878ade83f2ccdf7d25e494f05c9165f5246b46a621cc849341dc01"},
- {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:3ee8a80d67a4334482d9712b8e83ca6b1d9bc7e351931252ebef5d8f7335a547"},
- {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:5e55da2c8724191e5b557f8e18943b1b4839b8efc3ef60d65985bcf6f587dd38"},
- {file = "Brotli-1.1.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:d342778ef319e1026af243ed0a07c97acf3bad33b9f29e7ae6a1f68fd083e90c"},
{file = "Brotli-1.1.0-cp37-cp37m-win32.whl", hash = "sha256:587ca6d3cef6e4e868102672d3bd9dc9698c309ba56d41c2b9c85bbb903cdb95"},
{file = "Brotli-1.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:2954c1c23f81c2eaf0b0717d9380bd348578a94161a65b3a2afc62c86467dd68"},
{file = "Brotli-1.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:efa8b278894b14d6da122a72fefcebc28445f2d3f880ac59d46c90f4c13be9a3"},
@@ -267,10 +233,6 @@ files = [
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ab4fbee0b2d9098c74f3057b2bc055a8bd92ccf02f65944a241b4349229185a"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:141bd4d93984070e097521ed07e2575b46f817d08f9fa42b16b9b5f27b5ac088"},
{file = "Brotli-1.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fce1473f3ccc4187f75b4690cfc922628aed4d3dd013d047f95a9b3919a86596"},
- {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:d2b35ca2c7f81d173d2fadc2f4f31e88cc5f7a39ae5b6db5513cf3383b0e0ec7"},
- {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:af6fa6817889314555aede9a919612b23739395ce767fe7fcbea9a80bf140fe5"},
- {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:2feb1d960f760a575dbc5ab3b1c00504b24caaf6986e2dc2b01c09c87866a943"},
- {file = "Brotli-1.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:4410f84b33374409552ac9b6903507cdb31cd30d2501fc5ca13d18f73548444a"},
{file = "Brotli-1.1.0-cp38-cp38-win32.whl", hash = "sha256:db85ecf4e609a48f4b29055f1e144231b90edc90af7481aa731ba2d059226b1b"},
{file = "Brotli-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3d7954194c36e304e1523f55d7042c59dc53ec20dd4e9ea9d151f1b62b4415c0"},
{file = "Brotli-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:5fb2ce4b8045c78ebbc7b8f3c15062e435d47e7393cc57c25115cfd49883747a"},
@@ -283,10 +245,6 @@ files = [
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:949f3b7c29912693cee0afcf09acd6ebc04c57af949d9bf77d6101ebb61e388c"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:89f4988c7203739d48c6f806f1e87a1d96e0806d44f0fba61dba81392c9e474d"},
{file = "Brotli-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:de6551e370ef19f8de1807d0a9aa2cdfdce2e85ce88b122fe9f6b2b076837e59"},
- {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0737ddb3068957cf1b054899b0883830bb1fec522ec76b1098f9b6e0f02d9419"},
- {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:4f3607b129417e111e30637af1b56f24f7a49e64763253bbc275c75fa887d4b2"},
- {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:6c6e0c425f22c1c719c42670d561ad682f7bfeeef918edea971a79ac5252437f"},
- {file = "Brotli-1.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:494994f807ba0b92092a163a0a283961369a65f6cbe01e8891132b7a320e61eb"},
{file = "Brotli-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f0d8a7a6b5983c2496e364b969f0e526647a06b075d034f3297dc66f3b360c64"},
{file = "Brotli-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:cdad5b9014d83ca68c25d2e9444e28e967ef16e80f6b436918c700c117a85467"},
{file = "Brotli-1.1.0.tar.gz", hash = "sha256:81de08ac11bcb85841e440c13611c00b67d3bf82698314928d0b676362546724"},
@@ -674,6 +632,39 @@ typing-extensions = ">=4.8.0"
all = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=2.11.2)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.7)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"]
standard = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "jinja2 (>=2.11.2)", "python-multipart (>=0.0.7)", "uvicorn[standard] (>=0.12.0)"]
+[[package]]
+name = "fastapi-pagination"
+version = "0.12.34"
+description = "FastAPI pagination"
+optional = false
+python-versions = "<4.0,>=3.8"
+groups = ["main"]
+files = [
+ {file = "fastapi_pagination-0.12.34-py3-none-any.whl", hash = "sha256:089d1078aae1784395b4dbd923d0c8246641ddcc291c5ec6d92a30edb92ecbdd"},
+ {file = "fastapi_pagination-0.12.34.tar.gz", hash = "sha256:05ee8c0bc572072160f7f30900bfd87869e1880c87bc5797922fec2e49e65f11"},
+]
+
+[package.dependencies]
+pydantic = ">=1.9.1"
+typing-extensions = ">=4.8.0,<5.0.0"
+
+[package.extras]
+all = ["SQLAlchemy (>=1.3.20)", "asyncpg (>=0.24.0)", "beanie (>=1.25.0)", "bunnet (>=1.1.0,<2.0.0)", "databases (>=0.6.0)", "django (<5.0.0)", "mongoengine (>=0.23.1,<0.30.0)", "motor (>=3.6.0,<4.0.0)", "odmantic (>=1.0.2,<2.0.0)", "orm (>=0.3.1)", "piccolo (>=0.89,<1.22)", "pony (>=0.7.16,<0.8.0)", "scylla-driver (>=3.25.6,<4.0.0)", "sqlakeyset (>=2.0.1680321678,<3.0.0)", "sqlmodel (>=0.0.22)", "tortoise-orm (>=0.22.0)"]
+asyncpg = ["SQLAlchemy (>=1.3.20)", "asyncpg (>=0.24.0)"]
+beanie = ["beanie (>=1.25.0)"]
+bunnet = ["bunnet (>=1.1.0,<2.0.0)"]
+databases = ["databases (>=0.6.0)"]
+django = ["databases (>=0.6.0)", "django (<5.0.0)"]
+mongoengine = ["mongoengine (>=0.23.1,<0.30.0)"]
+motor = ["motor (>=3.6.0,<4.0.0)"]
+odmantic = ["odmantic (>=1.0.2,<2.0.0)"]
+orm = ["databases (>=0.6.0)", "orm (>=0.3.1)"]
+piccolo = ["piccolo (>=0.89,<1.22)"]
+scylla-driver = ["scylla-driver (>=3.25.6,<4.0.0)"]
+sqlalchemy = ["SQLAlchemy (>=1.3.20)", "sqlakeyset (>=2.0.1680321678,<3.0.0)"]
+sqlmodel = ["sqlakeyset (>=2.0.1680321678,<3.0.0)", "sqlmodel (>=0.0.22)"]
+tortoise = ["tortoise-orm (>=0.22.0)"]
+
[[package]]
name = "freezegun"
version = "1.5.1"
@@ -3716,24 +3707,6 @@ files = [
{file = "Unidecode-1.3.8.tar.gz", hash = "sha256:cfdb349d46ed3873ece4586b96aa75258726e2fa8ec21d6f00a591d98806c2f4"},
]
-[[package]]
-name = "urllib3"
-version = "1.26.20"
-description = "HTTP library with thread-safe connection pooling, file post, and more."
-optional = false
-python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7"
-groups = ["main"]
-markers = "platform_python_implementation == \"PyPy\""
-files = [
- {file = "urllib3-1.26.20-py2.py3-none-any.whl", hash = "sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e"},
- {file = "urllib3-1.26.20.tar.gz", hash = "sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32"},
-]
-
-[package.extras]
-brotli = ["brotli (==1.0.9) ; os_name != \"nt\" and python_version < \"3\" and platform_python_implementation == \"CPython\"", "brotli (>=1.0.9) ; python_version >= \"3\" and platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; (os_name != \"nt\" or python_version >= \"3\") and platform_python_implementation != \"CPython\"", "brotlipy (>=0.6.0) ; os_name == \"nt\" and python_version < \"3\""]
-secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress ; python_version == \"2.7\"", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"]
-socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]
-
[[package]]
name = "urllib3"
version = "2.3.0"
@@ -3741,7 +3714,7 @@ description = "HTTP library with thread-safe connection pooling, file post, and
optional = false
python-versions = ">=3.9"
groups = ["main"]
-markers = "platform_python_implementation != \"PyPy\""
+markers = "platform_python_implementation == \"PyPy\""
files = [
{file = "urllib3-2.3.0-py3-none-any.whl", hash = "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df"},
{file = "urllib3-2.3.0.tar.gz", hash = "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d"},
@@ -3773,6 +3746,24 @@ h11 = ">=0.8"
[package.extras]
standard = ["colorama (>=0.4) ; sys_platform == \"win32\"", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1) ; sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\"", "watchfiles (>=0.13)", "websockets (>=10.4)"]
+[[package]]
+name = "vcrpy"
+version = "5.1.0"
+description = "Automatically mock your HTTP interactions to simplify and speed up testing"
+optional = true
+python-versions = ">=3.8"
+groups = ["main"]
+markers = "platform_python_implementation == \"PyPy\" and extra == \"test\""
+files = [
+ {file = "vcrpy-5.1.0-py2.py3-none-any.whl", hash = "sha256:605e7b7a63dcd940db1df3ab2697ca7faf0e835c0852882142bafb19649d599e"},
+ {file = "vcrpy-5.1.0.tar.gz", hash = "sha256:bbf1532f2618a04f11bce2a99af3a9647a32c880957293ff91e0a5f187b6b3d2"},
+]
+
+[package.dependencies]
+PyYAML = "*"
+wrapt = "*"
+yarl = "*"
+
[[package]]
name = "vcrpy"
version = "7.0.0"
@@ -3780,7 +3771,7 @@ description = "Automatically mock your HTTP interactions to simplify and speed u
optional = true
python-versions = ">=3.9"
groups = ["main"]
-markers = "platform_python_implementation == \"PyPy\" and extra == \"test\""
+markers = "platform_python_implementation != \"PyPy\" and extra == \"test\""
files = [
{file = "vcrpy-7.0.0-py2.py3-none-any.whl", hash = "sha256:55791e26c18daa363435054d8b35bd41a4ac441b6676167635d1b37a71dbe124"},
{file = "vcrpy-7.0.0.tar.gz", hash = "sha256:176391ad0425edde1680c5b20738ea3dc7fb942520a48d2993448050986b3a50"},
@@ -3788,10 +3779,7 @@ files = [
[package.dependencies]
PyYAML = "*"
-urllib3 = [
- {version = "<2", markers = "platform_python_implementation == \"PyPy\""},
- {version = "*", markers = "platform_python_implementation != \"PyPy\" and python_version >= \"3.10\""},
-]
+urllib3 = {version = "*", markers = "platform_python_implementation != \"PyPy\" and python_version >= \"3.10\""}
wrapt = "*"
yarl = "*"
@@ -4181,4 +4169,4 @@ test = ["fakeredis", "pytest", "pytest-asyncio", "pytest-env", "pytest-mock", "p
[metadata]
lock-version = "2.1"
python-versions = "^3.12"
-content-hash = "cd26d8392654433fd53cea5277d3deb5afd847cf2c48f9bebb8fa7bf5f4be66c"
+content-hash = "3dea00d714187e695c44714ef3a71db53aa55e8453c7f5f91b712af11b0b0e6f"
diff --git a/pyproject.toml b/pyproject.toml
index 03e84c88d..56d2bbb74 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -51,6 +51,7 @@ dependencies = [
"websockets == 12.0",
"yarl ~= 1.14",
"zipfile-deflate64 ~= 0.2",
+ "fastapi-pagination (>=0.12.34,<0.13.0)",
]
[project.optional-dependencies]
diff --git a/pytest.ini b/pytest.ini
index 71d8b3f49..6219b74c4 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -17,4 +17,5 @@ env =
SCHEDULED_UPDATE_SWITCH_TITLEDB_CRON=0 4 * * *
UPLOAD_TIMEOUT=20
LOGLEVEL=DEBUG
+ DEV_MODE=false
OIDC_ENABLED=false