Skip to content

Commit

Permalink
[1.3.5-beta] Changelog
Browse files Browse the repository at this point in the history
--bug fix on logging in Open Subtitles
--bug fix on space time continuum
--added more bugs to fix later
  • Loading branch information
wendale.dy committed Nov 7, 2022
1 parent d394f77 commit d7bfa71
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 18 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.3.4"
versionName "1.3.5"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
Expand Down
Binary file added builds/android/1.3.5-beta/app-release.apk
Binary file not shown.
22 changes: 14 additions & 8 deletions src/api/opensubtitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ export const getSubtitle = async (movie, token, season, episode) => {
Accept: "application/json",
"Api-key": apiKey
}
}).catch(e => console.log(e))
console.log("downloading subtitle")
}).catch(e => console.log(e)).then(res => res)
console.log("downloading subtitle", search)
const r_search = await search.json()
console.log(r_search.data[0].id)
const file_id = r_search.data[0]
const formData = new FormData()
console.log("file_id found: ", file_id.attributes.files[0].file_id)
Expand All @@ -28,15 +29,20 @@ export const getSubtitle = async (movie, token, season, episode) => {
const subtitle = await fetch("https://api.opensubtitles.com/api/v1/download", {
method: "POST",
headers: {
"User-Agent": "PostmanRuntime/7.29.2",
"Api-key": apiKey,
"Authorization": `Bearer ${token}`,
'Content-Type': 'application/json',
"Api-Key": apiKey
'Accept': 'application/json',
},
body: JSON.stringify(formData)
}).then(response => {console.log(response); response.json()}).catch(err => console.log("opensub Download: ", err))
console.log("download complete: ", subtitle)
return r_subtitle?.data?.link || false;
'body': JSON.stringify({
"file_id": file_id.attributes.files[0].file_id
})
}).then(res => res)
console.log("subtitle found: ", subtitle)
const r_data = await subtitle.json()
console.log("download complete: ", r_data)
console.log("subtitle: ", r_data?.link )
return r_data
} catch (err) {
console.log(err)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CreditsModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const CreditsModal = ({ isOpen, onClose }) => {
color: colors.white,
marginBottom: 20
}}
>1.3.4 beta</Text>
>1.3.5 beta</Text>
<ScrollView>
<Text
style={{
Expand Down
2 changes: 1 addition & 1 deletion src/components/MediaPlayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const MediaPlayer = ({
title: title,
language: 'en',
type: subtitle.split(".").pop() == "srt" ? TextTrackType.SRT : TextTrackType.VTT,
uri: subtitle
uri: subtitle.link
}] : []}
/>
)
Expand Down
3 changes: 2 additions & 1 deletion src/screens/Details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ const Details = ({ navigation, route }) => {
const video = await TheFlixProvider.loadFlicks(movie.link, 'movie');
setVideo(video.url);
if(open_subtitle_token != ""){
console.log("subtitle is loading")
const subtitle = await opensubtitle.getSubtitle(movie, open_subtitle_token);
if(subtitle){
setSubtitle(subtitle);
setSubtitle(subtitle?.link);
}
}
setStatus('success');
Expand Down
19 changes: 13 additions & 6 deletions src/screens/Settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,23 @@ const Settings = ({ navigation }) => {
},
open_subtitle_token: res.token,
player_type: player_type,
}))
})).catch((error) => {
console.log(error)
});
if(res.token){
dispatch(setOpenSubtitleToken({
username: username,
password: password,
token: res.token
}));
}else{
alert("Error logging in")
}
console.log(await AsyncStorage.getItem("userProfile"))
} catch (err) {
console.log(err)
alert("Wrong Username or Password")
}
dispatch(setOpenSubtitleToken({
username: username,
password: password,
token: res.token
}));
}
}

Expand Down

0 comments on commit d7bfa71

Please sign in to comment.