A self-hosted media server and file management system
Vue ffmpegfile-serverjellyfinlaravelmediamedia-playermedia-servermediabrowsermediaservermusicmusic-librarymusic-playermusicplayerself-hostedvuejs
refactor: rename all HomeComponents or paths to Explore
aminnausina4360245733d
diff --git a/app/Http/Controllers/Api/V1/Feed/HomeController.php b/app/Http/Controllers/Api/V1/Feed/ExploreController.phpsimilarity index 99%rename from app/Http/Controllers/Api/V1/Feed/HomeController.phprename to app/Http/Controllers/Api/V1/Feed/ExploreController.phpindex c5b0e4c3..b30883df 100644--- a/app/Http/Controllers/Api/V1/Feed/HomeController.php+++ b/app/Http/Controllers/Api/V1/Feed/ExploreController.php@@ -17,7 +17,7 @@ use Illuminate\Http\Request;use Illuminate\Support\Collection;use Illuminate\Support\Facades\Cache;-class HomeController extends Controller {+class ExploreController extends Controller {protected int $defaultLimit = 20;public function continueWatching(Request $request) {diff --git a/resources/js/components/drawers/HomeRightSidebarDrawer.vue b/resources/js/components/drawers/ExploreRightSidebarDrawer.vuesimilarity index 78%rename from resources/js/components/drawers/HomeRightSidebarDrawer.vuerename to resources/js/components/drawers/ExploreRightSidebarDrawer.vueindex 0a7d1b74..08ac7ce9 100644--- a/resources/js/components/drawers/HomeRightSidebarDrawer.vue+++ b/resources/js/components/drawers/ExploreRightSidebarDrawer.vue@@ -4,7 +4,7 @@ import { useDrawer } from '@aminnausin/cedar-ui';import { useRoute } from 'vue-router';import { watch } from 'vue';-import HomeRightSidebar from '@/components/panels/HomeRightSidebar.vue';+import ExploreRightSidebar from '@/components/panels/ExploreRightSidebar.vue';const drawer = useDrawer();const route = useRoute();@@ -17,6 +17,6 @@ watch(<template><BaseDrawer>- <HomeRightSidebar />+ <ExploreRightSidebar /></BaseDrawer></template>diff --git a/resources/js/components/home/HomeActivityFeed.vue b/resources/js/components/explore/ExploreActivityFeed.vuesimilarity index 98%rename from resources/js/components/home/HomeActivityFeed.vuerename to resources/js/components/explore/ExploreActivityFeed.vueindex 3375447c..c6ef92da 100644--- a/resources/js/components/home/HomeActivityFeed.vue+++ b/resources/js/components/explore/ExploreActivityFeed.vue@@ -1,7 +1,7 @@<script setup lang="ts">import type { FolderResource, VideoResource } from '@/contracts/media';-import { groupActivityFeed, useActivityFeed } from '@/service/home/useActivityFeed';+import { groupActivityFeed, useActivityFeed } from '@/service/explore/useActivityFeed';import { TableLoadingSpinner } from '@/components/cedar-ui/table';import { toPlural } from '@/service/util';import { computed } from 'vue';diff --git a/resources/js/components/home/HomeHero.vue b/resources/js/components/explore/ExploreHero.vuesimilarity index 100%rename from resources/js/components/home/HomeHero.vuerename to resources/js/components/explore/ExploreHero.vuediff --git a/resources/js/components/home/HomeShelf.vue b/resources/js/components/explore/ExploreShelf.vuesimilarity index 100%rename from resources/js/components/home/HomeShelf.vuerename to resources/js/components/explore/ExploreShelf.vuediff --git a/resources/js/components/home/HomeSpotlight.vue b/resources/js/components/explore/ExploreSpotlight.vuesimilarity index 99%rename from resources/js/components/home/HomeSpotlight.vuerename to resources/js/components/explore/ExploreSpotlight.vueindex 06ecd0f2..dcade6fd 100644--- a/resources/js/components/home/HomeSpotlight.vue+++ b/resources/js/components/explore/ExploreSpotlight.vue@@ -1,6 +1,6 @@<script setup lang="ts">import type { SwipeDirection } from '@aminnausin/cedar-ui';-import type { SpotlightItem } from '@/service/home/useSpotlightItems';+import type { SpotlightItem } from '@/service/explore/useSpotlightItems';import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';import { handleStorageURL, toPlural } from '@/service/util';diff --git a/resources/js/components/panels/HomeRightSidebar.vue b/resources/js/components/panels/ExploreRightSidebar.vuesimilarity index 79%rename from resources/js/components/panels/HomeRightSidebar.vuerename to resources/js/components/panels/ExploreRightSidebar.vueindex 12fedb4c..a11916b7 100644--- a/resources/js/components/panels/HomeRightSidebar.vue+++ b/resources/js/components/panels/ExploreRightSidebar.vue@@ -1,5 +1,5 @@<script setup lang="ts">-import { useRecentlyUpdated, useRecentlyUploaded } from '@/service/home/useHomeQueries';+import { useRecentlyUpdated, useRecentlyUploaded } from '@/service/explore/useExploreQueries';import { defineAsyncComponent, computed } from 'vue';import { useAppStore } from '@/stores/AppStore';@@ -10,7 +10,7 @@ const { data: recentlyUploaded, isLoading: isLoadingVideo } = useRecentlyUploadeconst { data: recentlyUpdated, isLoading: isLoadingUpdated } = useRecentlyUpdated();const AppStore = useAppStore();-const HomeActivityFeedAsync = defineAsyncComponent(async () => await import('@/components/home/HomeActivityFeed.vue'));+const ExploreActivityFeedAsync = defineAsyncComponent(async () => await import('@/components/explore/ExploreActivityFeed.vue'));const HistorySidebarAsync = defineAsyncComponent(async () => await import('@/components/panels/HistorySidebar.vue'));const isLoading = computed(() => isLoadingVideo.value || isLoadingMusic.value || isLoadingUpdated.value);@@ -18,7 +18,7 @@ const isLoading = computed(() => isLoadingVideo.value || isLoadingMusic.value ||<template><Suspense v-if="AppStore.selectedSideBar === 'feed'">- <HomeActivityFeedAsync :videos="recentlyUploaded" :music="recentlyUploadedMusic" :updated-folders="recentlyUpdated" :is-loading="isLoading" />+ <ExploreActivityFeedAsync :videos="recentlyUploaded" :music="recentlyUploadedMusic" :updated-folders="recentlyUpdated" :is-loading="isLoading" /><template #fallback><SidebarSkeleton />diff --git a/resources/js/components/panels/HomeFeedSidebar.vue b/resources/js/components/panels/HomeFeedSidebar.vuedeleted file mode 100644index e69de29b..00000000diff --git a/resources/js/components/panels/NavBar.vue b/resources/js/components/panels/NavBar.vueindex c595c5d3..a2ec5a80 100755--- a/resources/js/components/panels/NavBar.vue+++ b/resources/js/components/panels/NavBar.vue@@ -14,7 +14,7 @@ import { ref, watch } from 'vue';import { drawer } from '@aminnausin/cedar-ui';import FolderDetailsSidebarDrawer from '@/components/drawers/FolderDetailsSidebarDrawer.vue';-import HomeRightSidebarDrawer from '@/components/drawers/HomeRightSidebarDrawer.vue';+import ExploreRightSidebarDrawer from '@/components/drawers/ExploreRightSidebarDrawer.vue';import VideoSidebarDrawer from '@/components/drawers/VideoSidebarDrawer.vue';import ToggleLightMode from '@/components/inputs/ToggleLightMode.vue';import SidebarDrawer from '@/components/drawers/SidebarDrawer.vue';@@ -90,7 +90,7 @@ watch(isDesktop, (now) => {toggleRightSidebar(currentSidebar === 'history' ? 'history' : 'folders', VideoSidebarDrawer);break;case 'explore':- toggleRightSidebar(currentSidebar === 'history' ? 'history' : 'feed', HomeRightSidebarDrawer);+ toggleRightSidebar(currentSidebar === 'history' ? 'history' : 'feed', ExploreRightSidebarDrawer);break;case 'folder':toggleRightSidebar('folders', FolderDetailsSidebarDrawer);@@ -174,7 +174,7 @@ watch(isDesktop, (now) => {</NavButton><NavButtonv-if="$route.name === 'explore'"- @click="toggleRightSidebar('feed', HomeRightSidebarDrawer)"+ @click="toggleRightSidebar('feed', ExploreRightSidebarDrawer)":label="'activity feed'":active="selectedSideBar == 'feed'"title="Toggle activity feed"@@ -184,7 +184,7 @@ watch(isDesktop, (now) => {</NavButton><NavButtonv-if="($route.name === 'home' || $route.name === 'explore') && userData"- @click="toggleRightSidebar('history', $route.name === 'home' ? VideoSidebarDrawer : HomeRightSidebarDrawer)"+ @click="toggleRightSidebar('history', $route.name === 'home' ? VideoSidebarDrawer : ExploreRightSidebarDrawer)":label="'history'":active="selectedSideBar === 'history'"title="Toggle recent watch history"diff --git a/resources/js/router/index.ts b/resources/js/router/index.tsindex 6ed8acdf..5b483d75 100644--- a/resources/js/router/index.ts+++ b/resources/js/router/index.ts@@ -40,7 +40,7 @@ export const router = createRouter({path: '/explore',name: 'explore',meta: { name: 'Explore' },- component: () => import('@/views/HomeView.vue'),+ component: () => import('@/views/ExploreView.vue'),},{path: '/login',@@ -96,7 +96,7 @@ export const router = createRouter({if (meta?.protected || from.name === 'logout') {nextPath = '/';- nextTitle = 'Home';+ nextTitle = 'Explore';}document.title = nextTitle;diff --git a/resources/js/service/home/homeAPI.ts b/resources/js/service/explore/exploreAPI.tssimilarity index 100%rename from resources/js/service/home/homeAPI.tsrename to resources/js/service/explore/exploreAPI.tsdiff --git a/resources/js/service/home/useActivityFeed.ts b/resources/js/service/explore/useActivityFeed.tssimilarity index 100%rename from resources/js/service/home/useActivityFeed.tsrename to resources/js/service/explore/useActivityFeed.tsdiff --git a/resources/js/service/home/useHomeQueries.ts b/resources/js/service/explore/useExploreQueries.tssimilarity index 73%rename from resources/js/service/home/useHomeQueries.tsrename to resources/js/service/explore/useExploreQueries.tsindex 0a52ad31..3c603e7c 100644--- a/resources/js/service/home/useHomeQueries.ts+++ b/resources/js/service/explore/useExploreQueries.ts@@ -1,4 +1,4 @@-import { getContinueWatching, getRecentlyAdded, getRecentlyReleased, getRecentlyUpdated, getRecentlyUploaded } from '@/service/home/homeAPI';+import { getContinueWatching, getRecentlyAdded, getRecentlyReleased, getRecentlyUpdated, getRecentlyUploaded } from '@/service/explore/exploreAPI';import { useQuery } from '@tanstack/vue-query';import { computed } from 'vue';import { useAuth } from '@/composables/auth/useAuth';@@ -6,7 +6,7 @@ import { useAuth } from '@/composables/auth/useAuth';export const useContinueWatching = () => {const { isAuthenticated } = useAuth();return useQuery({- queryKey: ['auth', 'home', 'continue-watching'],+ queryKey: ['auth', 'explore', 'continue-watching'],queryFn: getContinueWatching,staleTime: 1000 * 30,retry: false,@@ -16,7 +16,7 @@ export const useContinueWatching = () => {export const useRecentlyReleased = () => {return useQuery({- queryKey: ['auth', 'home', 'recently-released'],+ queryKey: ['auth', 'explore', 'recently-released'],queryFn: getRecentlyReleased,staleTime: 1000 * 30,retry: false,@@ -25,7 +25,7 @@ export const useRecentlyReleased = () => {export const useRecentlyUpdated = () => {return useQuery({- queryKey: ['auth', 'home', 'recently-updated'],+ queryKey: ['auth', 'explore', 'recently-updated'],queryFn: getRecentlyUpdated,staleTime: 1000 * 30,retry: false,@@ -34,7 +34,7 @@ export const useRecentlyUpdated = () => {export const useRecentlyAdded = () => {return useQuery({- queryKey: ['auth', 'home', 'recently-added'],+ queryKey: ['auth', 'explore', 'recently-added'],queryFn: getRecentlyAdded,staleTime: 1000 * 30,retry: false,@@ -43,7 +43,7 @@ export const useRecentlyAdded = () => {export const useRecentlyUploaded = (mediaType?: 'video' | 'audio') => {return useQuery({- queryKey: ['auth', 'home', ['recently-uploaded', mediaType].filter(Boolean).join('-')],+ queryKey: ['auth', 'explore', ['recently-uploaded', mediaType].filter(Boolean).join('-')],queryFn: () => getRecentlyUploaded(mediaType),staleTime: 1000 * 30,retry: false,diff --git a/resources/js/service/home/useSpotlightItems.ts b/resources/js/service/explore/useSpotlightItems.tssimilarity index 100%rename from resources/js/service/home/useSpotlightItems.tsrename to resources/js/service/explore/useSpotlightItems.tsdiff --git a/resources/js/views/HomeView.vue b/resources/js/views/ExploreView.vuesimilarity index 85%rename from resources/js/views/HomeView.vuerename to resources/js/views/ExploreView.vueindex 8455a39f..5e7d672c 100644--- a/resources/js/views/HomeView.vue+++ b/resources/js/views/ExploreView.vue@@ -1,8 +1,8 @@<script setup lang="ts">-import { useContinueWatching, useRecentlyAdded, useRecentlyReleased, useRecentlyUpdated, useRecentlyUploaded } from '@/service/home/useHomeQueries';+import { useContinueWatching, useRecentlyAdded, useRecentlyReleased, useRecentlyUpdated, useRecentlyUploaded } from '@/service/explore/useExploreQueries';import { getScreenSizeRank, toFormattedDate, toTimeSpan } from '@/service/util';import { breakpointsTailwind, useBreakpoints } from '@vueuse/core';-import { interleaveSpotlightItems } from '@/service/home/useSpotlightItems';+import { interleaveSpotlightItems } from '@/service/explore/useSpotlightItems';import { computed, onMounted } from 'vue';import { useAppStore } from '@/stores/AppStore';import { storeToRefs } from 'pinia';@@ -12,9 +12,9 @@ import LayoutBase from '@/layouts/LayoutBase.vue';import RecentlyUploadedCard from '@/components/cards/data/RecentlyUploadedCard.vue';import RecentlyWatchedCard from '@/components/cards/data/RecentlyWatchedCard.vue';import BrowseFolderCard from '@/components/cards/data/explore/BrowseFolderCard.vue';-import HomeRightSidebar from '@/components/panels/HomeRightSidebar.vue';-import HomeSpotlight from '@/components/home/HomeSpotlight.vue';-import HomeShelf from '@/components/home/HomeShelf.vue';+import ExploreRightSidebar from '@/components/panels/ExploreRightSidebar.vue';+import ExploreSpotlight from '@/components/explore/ExploreSpotlight.vue';+import ExploreShelf from '@/components/explore/ExploreShelf.vue';const { pageTitle } = storeToRefs(useAppStore());@@ -56,10 +56,10 @@ onMounted(() => {<template><LayoutBase><template #content>- <div id="content-home" class="page-height @container flex flex-col gap-8 text-sm">- <HomeSpotlight v-if="spotlightItems.length || isLoadingSpotlight" :items="spotlightItems" :is-loading="isLoadingSpotlight" />+ <div id="content-explore" class="page-height @container flex flex-col gap-8 text-sm">+ <ExploreSpotlight v-if="spotlightItems.length || isLoadingSpotlight" :items="spotlightItems" :is-loading="isLoadingSpotlight" />- <HomeShelf+ <ExploreShelfv-if="isLoadingContinueWatching || !!continueWatching?.length"title="Continue Watching"skeleton-class="w-56 3xl:w-76 aspect-video"@@ -67,9 +67,9 @@ onMounted(() => {:is-loading="isLoadingContinueWatching"><RecentlyWatchedCard class="3xl:w-76" v-for="(media, index) in continueWatching" :key="media.id" :media="media" :eagerLoad="index < 2" />- </HomeShelf>+ </ExploreShelf>- <HomeShelf+ <ExploreShelftitle="Recently Updated Folders"skeleton-class="w-40 aspect-2-3":item-count="recentlyUpdated?.length"@@ -79,9 +79,9 @@ onMounted(() => {<BrowseFolderCard v-for="(folder, index) in recentlyUpdated" :key="folder.id" :folder="folder" :eagerLoad="index < 2"><span v-if="folder.series?.updated_at" class="text-foreground-1 truncate"> Updated {{ toTimeSpan(folder.series?.updated_at, '') }} </span></BrowseFolderCard>- </HomeShelf>+ </ExploreShelf>- <HomeShelf+ <ExploreShelftitle="Recently Added Series"skeleton-class="w-40 aspect-2-3":item-count="recentlyAdded?.length"@@ -95,9 +95,9 @@ onMounted(() => {Added {{ toFormattedDate(folder.series?.created_at, false, { year: 'numeric', month: 'short', day: 'numeric' }) }}</span></BrowseFolderCard>- </HomeShelf>+ </ExploreShelf>- <HomeShelf+ <ExploreShelftitle="Recently Released Series"skeleton-class="w-40 aspect-2-3":item-count="recentlyReleased?.length"@@ -109,9 +109,9 @@ onMounted(() => {{{ toFormattedDate(folder.series?.started_at, false, { year: 'numeric', month: 'long' }) }}</span></BrowseFolderCard>- </HomeShelf>+ </ExploreShelf>- <HomeShelf+ <ExploreShelfv-if="isLoadingRecentlyUploaded || !!recentlyUploaded?.length"title="Recently Uploaded Videos"skeleton-class="w-56 3xl:w-76 aspect-video"@@ -119,9 +119,9 @@ onMounted(() => {:is-loading="isLoadingRecentlyUploaded"><RecentlyUploadedCard class="3xl:w-76" v-for="media in recentlyUploaded" :key="media.id" :media="media" />- </HomeShelf>+ </ExploreShelf>- <HomeShelf+ <ExploreShelfv-if="isLoadingRecentlyUploadedMusic || !!recentlyUploadedMusic?.length"title="Recently Uploaded Music"skeleton-class="w-40 aspect-square"@@ -129,11 +129,11 @@ onMounted(() => {:is-loading="isLoadingRecentlyUploadedMusic"><RecentlyUploadedCard v-for="media in recentlyUploadedMusic" :key="media.id" :media="media" :force-audio="true" class="w-40" />- </HomeShelf>+ </ExploreShelf></div></template><template v-slot:sidebar>- <HomeRightSidebar />+ <ExploreRightSidebar /></template></LayoutBase></template>diff --git a/routes/api.php b/routes/api.phpindex 773b83b8..65281f07 100755--- a/routes/api.php+++ b/routes/api.php@@ -7,7 +7,7 @@ use App\Http\Controllers\Api\V1\AuthController;use App\Http\Controllers\Api\V1\CategoryController;use App\Http\Controllers\Api\V1\EmailController;use App\Http\Controllers\Api\V1\ExternalMetadataController;-use App\Http\Controllers\Api\V1\Feed\HomeController;+use App\Http\Controllers\Api\V1\Feed\ExploreController;use App\Http\Controllers\Api\V1\FolderController;use App\Http\Controllers\Api\V1\JobController;use App\Http\Controllers\Api\V1\Media\MediaController;@@ -168,11 +168,11 @@ Route::withoutMiddleware([// HomeRoute::prefix('/explore')->group(function () {- Route::get('continue-watching', [HomeController::class, 'continueWatching']);- Route::get('recently-released', [HomeController::class, 'recentlyReleased']);- Route::get('recently-updated', [HomeController::class, 'recentlyUpdated']);- Route::get('recently-added', [HomeController::class, 'recentlyAdded']);- Route::get('recently-uploaded', [HomeController::class, 'recentlyUploaded']);+ Route::get('continue-watching', [ExploreController::class, 'continueWatching']);+ Route::get('recently-released', [ExploreController::class, 'recentlyReleased']);+ Route::get('recently-updated', [ExploreController::class, 'recentlyUpdated']);+ Route::get('recently-added', [ExploreController::class, 'recentlyAdded']);+ Route::get('recently-uploaded', [ExploreController::class, 'recentlyUploaded']);});// Libraries (categories)