mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 16:23:25 +00:00
feat: checkmark if track is active
This commit is contained in:
@@ -11,6 +11,13 @@ import { Button } from "../ui/Button";
|
|||||||
import { Text } from "../ui/Text";
|
import { Text } from "../ui/Text";
|
||||||
import { Controls } from "./Controls";
|
import { Controls } from "./Controls";
|
||||||
|
|
||||||
|
export interface AudioTrack {
|
||||||
|
uri: string;
|
||||||
|
name: string;
|
||||||
|
language: string;
|
||||||
|
active?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export const AudioTrackSelector = () => {
|
export const AudioTrackSelector = () => {
|
||||||
const tracks = usePlayerStore((state) => state.interface.audioTracks);
|
const tracks = usePlayerStore((state) => state.interface.audioTracks);
|
||||||
|
|
||||||
@@ -61,6 +68,13 @@ export const AudioTrackSelector = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Text>{track.name}</Text>
|
<Text>{track.name}</Text>
|
||||||
|
{track.active && (
|
||||||
|
<MaterialCommunityIcons
|
||||||
|
name="check-circle"
|
||||||
|
size={24}
|
||||||
|
color={colors.primary[300]}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
))}
|
))}
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@@ -11,7 +11,7 @@ import {
|
|||||||
import { fetchMediaDetails, fetchSeasonDetails } from "@movie-web/tmdb";
|
import { fetchMediaDetails, fetchSeasonDetails } from "@movie-web/tmdb";
|
||||||
|
|
||||||
import type { ItemData } from "../item/item";
|
import type { ItemData } from "../item/item";
|
||||||
import type { AudioTrack } from "~/stores/player/slices/interface";
|
import type { AudioTrack } from "./AudioTrackSelector";
|
||||||
import { PlayerStatus } from "~/stores/player/slices/interface";
|
import { PlayerStatus } from "~/stores/player/slices/interface";
|
||||||
import { usePlayerStore } from "~/stores/player/store";
|
import { usePlayerStore } from "~/stores/player/store";
|
||||||
import { Text } from "../ui/Text";
|
import { Text } from "../ui/Text";
|
||||||
@@ -121,6 +121,8 @@ export const ScraperProcess = ({ data }: ScraperProcessProps) => {
|
|||||||
name: (track.properties[0]?.attributes.name as string) ?? "Unknown",
|
name: (track.properties[0]?.attributes.name as string) ?? "Unknown",
|
||||||
language:
|
language:
|
||||||
(track.properties[0]?.attributes.language as string) ?? "Unknown",
|
(track.properties[0]?.attributes.language as string) ?? "Unknown",
|
||||||
|
active:
|
||||||
|
(track.properties[0]?.attributes.default as boolean) ?? false,
|
||||||
}));
|
}));
|
||||||
setAudioTracks(audioTracks);
|
setAudioTracks(audioTracks);
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { create } from "zustand";
|
import { create } from "zustand";
|
||||||
import { immer } from "zustand/middleware/immer";
|
import { immer } from "zustand/middleware/immer";
|
||||||
|
|
||||||
import type { AudioTrack } from "../player/slices/interface";
|
import type { AudioTrack } from "~/components/player/AudioTrackSelector";
|
||||||
|
|
||||||
export interface AudioTrackStore {
|
export interface AudioTrackStore {
|
||||||
selectedTrack: AudioTrack | null;
|
selectedTrack: AudioTrack | null;
|
||||||
|
@@ -3,18 +3,13 @@ import type { SeasonDetails } from "@movie-web/tmdb";
|
|||||||
|
|
||||||
import type { MakeSlice } from "./types";
|
import type { MakeSlice } from "./types";
|
||||||
import type { ItemData } from "~/components/item/item";
|
import type { ItemData } from "~/components/item/item";
|
||||||
|
import type { AudioTrack } from "~/components/player/AudioTrackSelector";
|
||||||
|
|
||||||
export enum PlayerStatus {
|
export enum PlayerStatus {
|
||||||
SCRAPING,
|
SCRAPING,
|
||||||
READY,
|
READY,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AudioTrack {
|
|
||||||
uri: string;
|
|
||||||
name: string;
|
|
||||||
language: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface InterfaceSlice {
|
export interface InterfaceSlice {
|
||||||
interface: {
|
interface: {
|
||||||
isIdle: boolean;
|
isIdle: boolean;
|
||||||
|
Reference in New Issue
Block a user