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