Merge branch 'master' into openid-connect

This commit is contained in:
Georges-Antoine Assi committed 2024-12-11 23:20:40 -05:00
commit bb43767249
4 files changed
+44 -30

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ class Platform(BaseModel):
)
aspect_ratio: Mapped[str] = mapped_column(
String, server_default=DEFAULT_COVER_ASPECT_RATIO
String(length=10), server_default=DEFAULT_COVER_ASPECT_RATIO
)
# This runs a subquery to get the count of roms for the platform
+6
View File
@@ -13,6 +13,7 @@ from sqlalchemy import (
DateTime,
Enum,
ForeignKey,
Index,
Integer,
String,
Text,
@@ -43,6 +44,11 @@ class Rom(BaseModel):
sgdb_id: Mapped[int | None]
moby_id: Mapped[int | None]
__table_args__ = (
Index("idx_roms_igdb_id", "igdb_id"),
Index("idx_roms_moby_id", "moby_id"),
)
file_name: Mapped[str] = mapped_column(String(length=450))
file_name_no_tags: Mapped[str] = mapped_column(String(length=450))
file_name_no_ext: Mapped[str] = mapped_column(String(length=450))
+37
View File
@@ -1,3 +1,40 @@
<script setup lang="ts">
import storeAuth from "@/stores/auth";
import storeConfig from "@/stores/config";
import storeHeartbeat from "@/stores/heartbeat";
import api from "@/services/api/index";
import userApi from "@/services/api/user";
import router from "@/plugins/router";
import { onBeforeMount } from "vue";
// Props
const heartbeat = storeHeartbeat();
const auth = storeAuth();
const configStore = storeConfig();
// Functions
onBeforeMount(async () => {
await api.get("/heartbeat").then(async ({ data: data }) => {
heartbeat.set(data);
if (heartbeat.value.SHOW_SETUP_WIZARD) {
router.push({ name: "setup" });
} else {
await userApi
.fetchCurrentUser()
.then(({ data: user }) => {
auth.setUser(user);
})
.catch((error) => {
console.error(error);
});
await api.get("/config").then(({ data: data }) => {
configStore.set(data);
});
}
});
});
</script>
<template>
<v-app>
<v-main class="h-100">
-29
View File
@@ -11,15 +11,9 @@ import Notification from "@/components/common/Notifications/Notification.vue";
import UploadProgress from "@/components/common/Notifications/UploadProgress.vue";
import SearchCoverDialog from "@/components/common/SearchCover.vue";
import ViewLoader from "@/components/common/ViewLoader.vue";
import router from "@/plugins/router";
import collectionApi from "@/services/api/collection";
import api from "@/services/api/index";
import platformApi from "@/services/api/platform";
import userApi from "@/services/api/user";
import storeAuth from "@/stores/auth";
import storeCollections from "@/stores/collections";
import storeConfig from "@/stores/config";
import storeHeartbeat from "@/stores/heartbeat";
import storeNavigation from "@/stores/navigation";
import storePlatforms from "@/stores/platforms";
import type { Events } from "@/types/emitter";
@@ -27,10 +21,7 @@ import type { Emitter } from "mitt";
import { inject, onBeforeMount } from "vue";
// Props
const heartbeat = storeHeartbeat();
const configStore = storeConfig();
const navigationStore = storeNavigation();
const auth = storeAuth();
const platformsStore = storePlatforms();
const collectionsStore = storeCollections();
const emitter = inject<Emitter<Events>>("emitter");
@@ -41,26 +32,6 @@ emitter?.on("refreshDrawer", async () => {
// Functions
onBeforeMount(async () => {
await api.get("/heartbeat").then(async ({ data: data }) => {
heartbeat.set(data);
if (heartbeat.value.SHOW_SETUP_WIZARD) {
router.push({ name: "setup" });
} else {
await userApi
.fetchCurrentUser()
.then(({ data: user }) => {
auth.setUser(user);
})
.catch((error) => {
console.error(error);
});
await api.get("/config").then(({ data: data }) => {
configStore.set(data);
});
}
});
await platformApi
.getPlatforms()
.then(({ data: platforms }) => {