feat: show queue item from currently playing item in queueButton

This commit is contained in:
Prayag Prajapati committed 2024-09-14 11:33:18 +05:30
1 parent 48af14b64f
commit e82ff1ff0c
5 files changed
+18 -14

No files matched your search

+9 -5
View File
@@ -34,7 +34,7 @@ const QueueButton = () => {
const handlePlay = useMutation({ const handlePlay = useMutation({
mutationKey: ["handlePlayIndex"], mutationKey: ["handlePlayIndex"],
mutationFn: async ({ index }: { index: number }) => { mutationFn: async ({ index }: { index: number }) => {
const result = playItemFromQueue(index, user.data?.Id); const result = playItemFromQueue(index, user.data?.Id, api);
return result; return result;
}, },
onSuccess: () => { onSuccess: () => {
@@ -76,12 +76,16 @@ const QueueButton = () => {
position: "relative", position: "relative",
}} }}
> >
{queueItems.map((item, index) => { {queueItems
.slice(currentItemIndex, queueItems.length - 1)
.map((item, index) => {
return ( return (
<MenuItem <MenuItem
className="queue-item" className="queue-item"
disabled={index === currentItemIndex} disabled={index === 0}
onClick={() => handlePlay.mutate({ index })} onClick={() =>
handlePlay.mutate({ index: index + currentItemIndex })
}
key={item.Id} key={item.Id}
> >
<Typography variant="subtitle2"> <Typography variant="subtitle2">
@@ -113,7 +117,7 @@ const QueueButton = () => {
{getTypeIcon(item.Type)} {getTypeIcon(item.Type)}
</div> </div>
)} )}
{index === currentItemIndex && ( {index === 0 && (
<span <span
className="material-symbols-rounded" className="material-symbols-rounded"
style={{ style={{
+7 -5
View File
@@ -439,7 +439,7 @@ const ApiRouteChildren: ApiRouteChildren = {
const ApiRouteWithChildren = ApiRoute._addFileChildren(ApiRouteChildren) const ApiRouteWithChildren = ApiRoute._addFileChildren(ApiRouteChildren)
interface FileRoutesByFullPath { export interface FileRoutesByFullPath {
'/': typeof IndexRoute '/': typeof IndexRoute
'': typeof ApiRouteWithChildren '': typeof ApiRouteWithChildren
'/library': typeof ApiLibraryRouteWithChildren '/library': typeof ApiLibraryRouteWithChildren
@@ -468,7 +468,7 @@ interface FileRoutesByFullPath {
'/login/$userId/$userName': typeof ApiLoginUserIdUserNameRoute '/login/$userId/$userName': typeof ApiLoginUserIdUserNameRoute
} }
interface FileRoutesByTo { export interface FileRoutesByTo {
'/': typeof IndexRoute '/': typeof IndexRoute
'': typeof ApiRouteWithChildren '': typeof ApiRouteWithChildren
'/library': typeof ApiLibraryRouteWithChildren '/library': typeof ApiLibraryRouteWithChildren
@@ -496,7 +496,8 @@ interface FileRoutesByTo {
'/login/$userId/$userName': typeof ApiLoginUserIdUserNameRoute '/login/$userId/$userName': typeof ApiLoginUserIdUserNameRoute
} }
interface FileRoutesById { export interface FileRoutesById {
__root__: typeof rootRoute
'/': typeof IndexRoute '/': typeof IndexRoute
'/_api': typeof ApiRouteWithChildren '/_api': typeof ApiRouteWithChildren
'/_api/library': typeof ApiLibraryRouteWithChildren '/_api/library': typeof ApiLibraryRouteWithChildren
@@ -525,7 +526,7 @@ interface FileRoutesById {
'/_api/login/$userId/$userName': typeof ApiLoginUserIdUserNameRoute '/_api/login/$userId/$userName': typeof ApiLoginUserIdUserNameRoute
} }
interface FileRouteTypes { export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: fullPaths:
| '/' | '/'
@@ -582,6 +583,7 @@ interface FileRouteTypes {
| '/search' | '/search'
| '/login/$userId/$userName' | '/login/$userId/$userName'
id: id:
| '__root__'
| '/' | '/'
| '/_api' | '/_api'
| '/_api/library' | '/_api/library'
@@ -611,7 +613,7 @@ interface FileRouteTypes {
fileRoutesById: FileRoutesById fileRoutesById: FileRoutesById
} }
interface RootRouteChildren { export interface RootRouteChildren {
IndexRoute: typeof IndexRoute IndexRoute: typeof IndexRoute
ApiRoute: typeof ApiRouteWithChildren ApiRoute: typeof ApiRouteWithChildren
ErrorCodeRoute: typeof ErrorCodeRoute ErrorCodeRoute: typeof ErrorCodeRoute
+1
View File
@@ -139,6 +139,7 @@
flex-basis: 14%; flex-basis: 14%;
} }
width: 14%; width: 14%;
flex-basis: 14%;
height: fit-content; height: fit-content;
display: inline-flex; display: inline-flex;
flex-direction: row; flex-direction: row;
+1 -1
View File
@@ -7,7 +7,7 @@ export const Route = createFileRoute("/_api/login")({
const api = context.api; const api = context.api;
if (!api) { if (!api) {
console.info("Awaiting Api generation."); console.info("Awaiting Api generation.");
return; throw redirect({ to: "/login/manual" });
} }
const publicUsers = (await getUserApi(api).getPublicUsers()).data; const publicUsers = (await getUserApi(api).getPublicUsers()).data;
if (publicUsers.length > 0) { if (publicUsers.length > 0) {
-3
View File
@@ -1,4 +1,3 @@
.video { .video {
&-osd { &-osd {
opacity: 0; opacity: 0;
@@ -56,7 +55,6 @@
} }
} }
} }
video { video {
&::-webkit-media-text-track-display { &::-webkit-media-text-track-display {
overflow: visible !important; overflow: visible !important;
@@ -69,7 +67,6 @@ video {
text-shadow: 0 2px 10px rgb(0 0 0 / 0.8); text-shadow: 0 2px 10px rgb(0 0 0 / 0.8);
} }
} }
.video-player { .video-player {
background: black; background: black;
position: absolute; position: absolute;