Skip to content

Commit

Permalink
Merge pull request #108 from himanshu8443/feature
Browse files Browse the repository at this point in the history
Feature
  • Loading branch information
Zenda-Cross authored Sep 12, 2024
2 parents 97f9123 + fed544c commit 24f0188
Show file tree
Hide file tree
Showing 26 changed files with 626 additions and 124 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ android {
applicationId "com.vega"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 54
versionName "2.4.1"
versionCode 55
versionName "2.4.2"
}
signingConfigs {
release {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vega",
"version": "2.4.1",
"version": "2.4.2",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
4 changes: 2 additions & 2 deletions src/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
]
],
"slug": "vega",
"version": "2.4.0",
"version": "2.4.2",
"sdkVersion": "51.0.0",
"android": {
"minSdkVersion": 24,
"package": "com.vega",
"versionCode": 53
"versionCode": 55
},
"platforms": ["ios", "android"]
}
Expand Down
13 changes: 12 additions & 1 deletion src/components/DownloadBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import {
Pressable,
TouchableOpacity,
Dimensions,
ToastAndroid,
} from 'react-native';
import React, {useEffect, useRef} from 'react';
import {Stream} from '../lib/providers/types';
import BottomSheet, {BottomSheetScrollView} from '@gorhom/bottom-sheet';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import SkeletonLoader from './Skeleton';
import RNReactNativeHapticFeedback from 'react-native-haptic-feedback';
import {Clipboard} from 'react-native';

type Props = {
data: Stream[];
Expand Down Expand Up @@ -49,7 +52,7 @@ const DownloadBottomSheet = ({
<BottomSheet
// detached={true}
enablePanDownToClose={true}
snapPoints={['50%']}
snapPoints={['30%', 450]}
containerStyle={{marginHorizontal: 5}}
ref={bottomSheetRef}
backgroundStyle={{backgroundColor: '#1a1a1a'}}
Expand All @@ -75,6 +78,14 @@ const DownloadBottomSheet = ({
<TouchableOpacity
className="p-2 bg-white/30 rounded-md my-1"
key={item.link}
onLongPress={() => {
RNReactNativeHapticFeedback.trigger('effectTick', {
enableVibrateFallback: true,
ignoreAndroidSystemSettings: false,
});
Clipboard.setString(item.link);
ToastAndroid.show('Link copied', ToastAndroid.SHORT);
}}
onPress={() => {
onPress(item);
bottomSheetRef.current?.close();
Expand Down
39 changes: 33 additions & 6 deletions src/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,29 @@ import {HomeStackParamList, SearchStackParamList} from '../App';
import useContentStore from '../lib/zustand/contentStore';
import useHeroStore from '../lib/zustand/herostore';
import {Skeleton} from 'moti/skeleton';
import {MmmkvCache} from '../lib/Mmkv';
import {MMKV, MmmkvCache} from '../lib/Mmkv';
import {manifest} from '../lib/Manifest';
import {Info} from '../lib/providers/types';
import {Feather} from '@expo/vector-icons';
import Ionicons from '@expo/vector-icons/Ionicons';
import {DrawerLayout} from 'react-native-gesture-handler';

function Hero() {
function Hero({
isDrawerOpen,
drawerRef,
}: {
isDrawerOpen: boolean;
drawerRef: React.RefObject<DrawerLayout>;
}) {
const [post, setPost] = useState<any>();
const [loading, setLoading] = useState(true);
const [searchActive, setSearchActive] = useState(false);
const {provider} = useContentStore(state => state);
const {hero} = useHeroStore(state => state);
const [showHamburgerMenu] = useState(
MMKV.getBool('showHamburgerMenu') || false,
);
const [isDrawerDisabled] = useState(MMKV.getBool('disableDrawer') || false);
const navigation =
useNavigation<NativeStackNavigationProp<HomeStackParamList>>();
const searchNavigation =
Expand Down Expand Up @@ -74,7 +86,23 @@ function Hero() {
});
return (
<View className="relative">
<View className="absolute w-full top-6 p-2 z-30 justify-center items-center">
<View className="absolute w-full top-6 px-2 mt-2 z-30 flex-row justify-between items-center">
{!searchActive && (
<View
className={`${
showHamburgerMenu && !isDrawerDisabled
? 'opacity-100'
: 'opacity-0'
}`}>
<Pressable
className={`${isDrawerOpen ? 'opacity-0' : 'opacity-100'}`}
onPress={() => {
drawerRef.current?.openDrawer();
}}>
<Ionicons name="menu-sharp" size={27} color="white" />
</Pressable>
</View>
)}
{searchActive && (
<MotiView
from={{opacity: 0, scale: 0.5}}
Expand Down Expand Up @@ -105,13 +133,12 @@ function Hero() {
</MotiView>
)}
{!searchActive && (
<Pressable
className="w-full items-end absolute right-3 top-3"
onPress={() => setSearchActive(true)}>
<Pressable className="" onPress={() => setSearchActive(true)}>
<Feather name="search" size={24} color="white" />
</Pressable>
)}
</View>

<Skeleton show={loading} colorMode="dark">
<Image
source={{
Expand Down
144 changes: 74 additions & 70 deletions src/components/SeasonList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const SeasonList = ({
/>
<View className="flex-row flex-wrap justify-center gap-x-2 gap-y-2">
{/* episodesLinks */}
{
{episodeList.length > 0 && !episodeLoading && (
<FlatList
data={episodeList}
keyExtractor={(item, index) => item.link + index}
Expand Down Expand Up @@ -280,84 +280,86 @@ const SeasonList = ({
);
}}
/>
}
)}
{/* directLinks */}
{ActiveSeason?.directLinks && ActiveSeason?.directLinks.length > 0 && (
<View className="w-full justify-center items-center gap-y-2 mt-3 p-2">
<FlatList
data={ActiveSeason?.directLinks}
keyExtractor={(item, index) => item.link + index}
renderItem={({item, index}) => {
// set titleSide to justify-center if title is too long
ActiveSeason?.directLinks?.length &&
ActiveSeason?.directLinks?.length > 1 &&
item?.title?.length > 27 &&
setTitleSide('justify-start');
return (
<View
key={item.link + index}
className={`w-full justify-center items-center my-2 gap-2 flex-row
{ActiveSeason?.directLinks &&
ActiveSeason?.directLinks.length > 0 &&
!episodeLoading && (
<View className="w-full justify-center items-center gap-y-2 mt-3 p-2">
<FlatList
data={ActiveSeason?.directLinks}
keyExtractor={(item, index) => item.link + index}
renderItem={({item, index}) => {
// set titleSide to justify-center if title is too long
ActiveSeason?.directLinks?.length &&
ActiveSeason?.directLinks?.length > 1 &&
item?.title?.length > 27 &&
setTitleSide('justify-start');
return (
<View
key={item.link + index}
className={`w-full justify-center items-center my-2 gap-2 flex-row
${
isCompleted(item.link) || stickyMenu.link === item.link
? 'opacity-60'
: ''
}
`}>
<View className="flex-row w-full justify-between gap-2 items-center">
<TouchableOpacity
className={`rounded-md bg-white/30 w-[80%] h-12 items-center p-2 flex-row gap-x-2 relative ${titleSide}`}
onPress={() =>
playHandler({
link: item.link,
type: item.type || 'series',
primaryTitle: metaTitle,
secondaryTitle: item.title,
file: (
metaTitle +
ActiveSeason.title +
item.title
).replaceAll(/[^a-zA-Z0-9]/g, '_'),
})
}
onLongPress={() =>
onLongPressHandler(true, item.link, 'series')
}>
<Ionicons
name="play-circle"
size={28}
color={primary}
<View className="flex-row w-full justify-between gap-2 items-center">
<TouchableOpacity
className={`rounded-md bg-white/30 w-[80%] h-12 items-center p-2 flex-row gap-x-2 relative ${titleSide}`}
onPress={() =>
playHandler({
link: item.link,
type: item.type || 'series',
primaryTitle: metaTitle,
secondaryTitle: item.title,
file: (
metaTitle +
ActiveSeason.title +
item.title
).replaceAll(/[^a-zA-Z0-9]/g, '_'),
})
}
onLongPress={() =>
onLongPressHandler(true, item.link, 'series')
}>
<Ionicons
name="play-circle"
size={28}
color={primary}
/>
<Text className="text-white">
{ActiveSeason?.directLinks?.length &&
ActiveSeason?.directLinks?.length > 1
? item.title?.length > 27
? item.title.slice(0, 27) + '...'
: item.title
: 'Play'}
</Text>
</TouchableOpacity>
<Downloader
providerValue={providerValue}
link={item.link}
type={item.type || 'series'}
title={
metaTitle.length > 30
? metaTitle.slice(0, 30) + '... ' + item.title
: metaTitle + ' ' + item.title
}
fileName={(
metaTitle +
ActiveSeason.title +
item.title
).replaceAll(/[^a-zA-Z0-9]/g, '_')}
/>
<Text className="text-white">
{ActiveSeason?.directLinks?.length &&
ActiveSeason?.directLinks?.length > 1
? item.title?.length > 27
? item.title.slice(0, 27) + '...'
: item.title
: 'Play'}
</Text>
</TouchableOpacity>
<Downloader
providerValue={providerValue}
link={item.link}
type={item.type || 'series'}
title={
metaTitle.length > 30
? metaTitle.slice(0, 30) + '... ' + item.title
: metaTitle + ' ' + item.title
}
fileName={(
metaTitle +
ActiveSeason.title +
item.title
).replaceAll(/[^a-zA-Z0-9]/g, '_')}
/>
</View>
</View>
</View>
);
}}
/>
</View>
)}
);
}}
/>
</View>
)}
{episodeLoading && (
<MotiView
animate={{backgroundColor: '#0000'}}
Expand All @@ -376,6 +378,8 @@ const SeasonList = ({
<Skeleton colorMode={'dark'} width={'85%'} height={48} />
<Skeleton colorMode={'dark'} width={'85%'} height={48} />
<Skeleton colorMode={'dark'} width={'85%'} height={48} />
<Skeleton colorMode={'dark'} width={'85%'} height={48} />
<Skeleton colorMode={'dark'} width={'85%'} height={48} />
</MotiView>
)}
{LinkList?.length === 0 && (
Expand Down
2 changes: 2 additions & 0 deletions src/lib/Manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {HiAnime} from './providers/hiAnime';
import {vadapavProvider} from './providers/vadapav';
import {netflixMirror} from './providers/netflixMirror';
import {kissKhProvider} from './providers/kissKh';
import {cinemaLuxe} from './providers/cinemaLuxe';

export interface ProviderType {
searchFilter?: string;
Expand Down Expand Up @@ -82,4 +83,5 @@ export const manifest: Manifest = {
hiAnime: HiAnime,
vadapav: vadapavProvider,
kissKh: kissKhProvider,
cinemaLuxe: cinemaLuxe,
};
6 changes: 6 additions & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ export const providersList: ProvidersList[] = [
type: 'global',
flag: '🌏',
},
{
name: 'CinemaLuxe',
value: 'cinemaLuxe',
type: 'global',
flag: '🌏',
},
{
name: 'NetflixMirror',
value: 'netflixMirror',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const downloadManager = async ({
onlyAlertOnce: true,
progress: {
max: 100,
current: progress * 100,
current: Math.abs(progress) * 100,
indeterminate: false,
},
pressAction: {
Expand Down
24 changes: 12 additions & 12 deletions src/lib/providers/autoEmbed/allGetStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ export const allGetStream = async (
}

///// flimxy
// const flimxyStream = await getFlimxyStream(imdbId, season, episode, type);
// if (flimxyStream) {
// for (const quality in flimxyStream?.qualities) {
// streams.push({
// server: 'Flimxy-' + quality,
// link: flimxyStream?.qualities?.[quality]?.url,
// type: flimxyStream?.qualities?.[quality]?.type || 'mp4',
// quality: quality as any,
// });
// }
// }
const flimxyStream = await getFlimxyStream(imdbId, season, episode, type);
if (flimxyStream) {
for (const quality in flimxyStream?.qualities) {
streams.push({
server: 'Flimxy-' + quality,
link: flimxyStream?.qualities?.[quality]?.url,
type: flimxyStream?.qualities?.[quality]?.type || 'mp4',
quality: quality as any,
});
}
}

// whvx orion
const whvxStreamOrion = await getWhvxStream(
Expand Down Expand Up @@ -153,7 +153,7 @@ export const allGetStream = async (
}

///// rive
await getRiveStream(tmdbId, episode, season, type, streams);
// await getRiveStream(tmdbId, episode, season, type, streams);

///// vidsrcrip
await getVidSrcRip(tmdbId, season, episode, streams);
Expand Down
Loading

0 comments on commit 24f0188

Please sign in to comment.