mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-06 17:56:17 +00:00
wip
This commit is contained in:
@@ -29,6 +29,7 @@ import { Loader } from "./Loader";
|
||||
import { MediaSourceSelector } from "./MediaSourceSelector";
|
||||
import ProgressCircle from "./ProgressCircle";
|
||||
import { SubtitleTrackSelector } from "./SubtitleTrackSelector";
|
||||
import { toast } from "sonner-native";
|
||||
|
||||
interface DownloadProps extends ViewProps {
|
||||
item: BaseItemDto;
|
||||
@@ -65,9 +66,7 @@ export const DownloadItem: React.FC<DownloadProps> = ({ item, ...props }) => {
|
||||
bottomSheetModalRef.current?.present();
|
||||
}, []);
|
||||
|
||||
const handleSheetChanges = useCallback((index: number) => {
|
||||
console.log("handleSheetChanges", index);
|
||||
}, []);
|
||||
const handleSheetChanges = useCallback((index: number) => {}, []);
|
||||
|
||||
const closeModal = useCallback(() => {
|
||||
bottomSheetModalRef.current?.dismiss();
|
||||
@@ -286,22 +285,19 @@ export const DownloadItem: React.FC<DownloadProps> = ({ item, ...props }) => {
|
||||
onPress={() => {
|
||||
if (userCanDownload === true) {
|
||||
if (!item.Id) {
|
||||
Alert.alert("Error", "Item ID is undefined.");
|
||||
return;
|
||||
throw new Error("No item id");
|
||||
}
|
||||
closeModal();
|
||||
queueActions.enqueue(queue, setQueue, {
|
||||
id: item.Id,
|
||||
execute: async () => {
|
||||
await initiateDownload();
|
||||
},
|
||||
item,
|
||||
});
|
||||
initiateDownload();
|
||||
// Remove for now
|
||||
// queueActions.enqueue(queue, setQueue, {
|
||||
// id: item.Id,
|
||||
// execute: async () => {
|
||||
// },
|
||||
// item,
|
||||
// });
|
||||
} else {
|
||||
Alert.alert(
|
||||
"Disabled",
|
||||
"This user is not allowed to download files."
|
||||
);
|
||||
toast.error("You are not allowed to download files.");
|
||||
}
|
||||
}}
|
||||
color="purple"
|
||||
|
||||
@@ -118,8 +118,6 @@ export const ItemContent: React.FC<{ id: string }> = React.memo(({ id }) => {
|
||||
itemId: id,
|
||||
});
|
||||
|
||||
console.log("itemID", res?.Id);
|
||||
|
||||
return res;
|
||||
},
|
||||
enabled: !!id && !!api,
|
||||
|
||||
@@ -163,7 +163,6 @@ export const PlayButton: React.FC<Props> = ({ item, url, ...props }) => {
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
console.log("Device");
|
||||
setCurrentlyPlayingState({ item, url });
|
||||
router.push("/play");
|
||||
break;
|
||||
|
||||
@@ -76,7 +76,6 @@ export const ActiveDownload: React.FC<Props> = ({ ...props }) => {
|
||||
<View className="p-4 flex flex-row items-center justify-between w-full">
|
||||
<View>
|
||||
<Text className="font-semibold">{process.item.Name}</Text>
|
||||
<Text className="text-xs opacity-50">{process.item.Id}</Text>
|
||||
<Text className="text-xs opacity-50">{process.item.Type}</Text>
|
||||
<View className="flex flex-row items-center space-x-2 mt-1 text-purple-600">
|
||||
<Text className="text-xs">{process.progress.toFixed(0)}%</Text>
|
||||
|
||||
Reference in New Issue
Block a user