From e69f0c52b882720b9ce761b25e5a777882de1ebe Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sun, 8 Mar 2026 20:57:37 +0100 Subject: [PATCH] Minor improvements and code cleanup across components - Refactor PlexSettings component for better organization - Add utility functions to utils.ts for shared logic - Update API methods for improved error handling - Clean up navigation icon components - Remove unused code from CommandPalette and SeasonedButton - Fix minor issues in Movie popup component - Update page component imports (RegisterPage, TorrentsPage) --- src/api.ts | 16 + src/components/header/NavigationIcon.vue | 3 +- src/components/header/NavigationIcons.vue | 8 - src/components/popup/Movie.vue | 5 +- src/components/settings/PlexSettings.vue | 356 +++++++++++----------- src/components/ui/CommandPalette.vue | 1 - src/components/ui/SeasonedButton.vue | 4 +- src/pages/RegisterPage.vue | 2 +- src/pages/TorrentsPage.vue | 2 +- src/utils.ts | 14 + 10 files changed, 213 insertions(+), 198 deletions(-) diff --git a/src/api.ts b/src/api.ts index a1ee282..3deb5da 100644 --- a/src/api.ts +++ b/src/api.ts @@ -413,6 +413,20 @@ const unlinkPlexAccount = async () => { }); }; +const plexRecentlyAddedInLibrary = async (id: number) => { + const url = new URL(`/api/v2/plex/recently_added/${id}`, API_HOSTNAME); + const options: RequestInit = { + credentials: "include" + }; + + return fetch(url.href, options) + .then(resp => resp.json()) + .catch(error => { + console.error(`api error fetch plex recently added`); // eslint-disable-line no-console + throw error; + }); +}; + // - - - User graphs - - - const fetchGraphData = async ( @@ -543,6 +557,7 @@ const elasticSearchMoviesAndShows = async (query: string, count = 22) => { }; export { + API_HOSTNAME, getMovie, getShow, getPerson, @@ -559,6 +574,7 @@ export { getRequestStatus, linkPlexAccount, unlinkPlexAccount, + plexRecentlyAddedInLibrary, register, login, logout, diff --git a/src/components/header/NavigationIcon.vue b/src/components/header/NavigationIcon.vue index 8d17dbd..fd586eb 100644 --- a/src/components/header/NavigationIcon.vue +++ b/src/components/header/NavigationIcon.vue @@ -42,8 +42,7 @@ .navigation-link { display: grid; place-items: center; - height: var(--header-size); - width: var(--header-size); + min-height: var(--header-size); list-style: none; padding: 1rem 0.15rem; text-align: center; diff --git a/src/components/header/NavigationIcons.vue b/src/components/header/NavigationIcons.vue index 94211af..c52ed77 100644 --- a/src/components/header/NavigationIcons.vue +++ b/src/components/header/NavigationIcons.vue @@ -90,18 +90,10 @@ @include desktop { grid-template-rows: var(--header-size); - grid-auto-flow: row; } @include mobile { grid-template-columns: 1fr 1fr; } } - - :global(.navigation-icons > *:last-child) { - margin-top: auto; - justify-self: end; - align-self: end; - background-color: red; - } diff --git a/src/components/popup/Movie.vue b/src/components/popup/Movie.vue index b87f7dd..e119907 100644 --- a/src/components/popup/Movie.vue +++ b/src/components/popup/Movie.vue @@ -215,7 +215,8 @@ const props = defineProps(); const ASSET_URL = "https://image.tmdb.org/t/p/"; - const COLORS_URL = "https://colors.schleppe.cloud/colors"; + // const COLORS_URL = "https://colors.schleppe.cloud/colors"; + const COLORS_URL = "http://localhost:8080/colors"; const ASSET_SIZES = ["w500", "w780", "original"]; const media: Ref = ref(); @@ -435,7 +436,7 @@ > img { width: 100%; - border-radius: inherit; + border-radius: calc(1.6rem - 1px); } } } diff --git a/src/components/settings/PlexSettings.vue b/src/components/settings/PlexSettings.vue index 7aa6399..25defef 100644 --- a/src/components/settings/PlexSettings.vue +++ b/src/components/settings/PlexSettings.vue @@ -2,7 +2,7 @@
@@ -16,20 +16,20 @@ />
@@ -38,16 +38,18 @@ @@ -55,7 +57,6 @@