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