Skip to content

Commit

Permalink
bump version, misc
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed Jun 12, 2023
1 parent 8a780e3 commit 8e54aa8
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 82 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"source.fixAll.eslint": false,
"source.fixAll.format": false
},
"typescript.tsdk": "node_modules\\typescript\\lib"
"typescript.tsdk": "node_modules\\typescript\\lib",
"java.configuration.updateBuildConfiguration": "disabled"
}
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ android {
applicationId "io.filen.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 2059
versionName "2.0.59"
versionCode 2060
versionName "2.0.60"
}

splits {
Expand Down
8 changes: 4 additions & 4 deletions ios/Filen.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Filen/Filen.entitlements;
CURRENT_PROJECT_VERSION = 2059;
CURRENT_PROJECT_VERSION = 2060;
DEVELOPMENT_TEAM = 7YTW5D2K7P;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Filen/Info.plist;
Expand All @@ -657,7 +657,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.59;
MARKETING_VERSION = 2.0.60;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -685,15 +685,15 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Filen/Filen.entitlements;
CURRENT_PROJECT_VERSION = 2059;
CURRENT_PROJECT_VERSION = 2060;
DEVELOPMENT_TEAM = 7YTW5D2K7P;
INFOPLIST_FILE = Filen/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 2.0.59;
MARKETING_VERSION = 2.0.60;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
2 changes: 1 addition & 1 deletion ios/Filen.xcodeproj/xcshareddata/xcschemes/Filen.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
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": "filen-mobile",
"version": "2.0.59",
"version": "2.0.60",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang/zh/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export const zh: {
permissionsCameraTitle: "相机权限",
permissionsCameraMessage: "Filen 需要获得相机权限才能正常运行。",
permissionsMediaLocationTitle: "媒体保存位置权限",
permissionsMediaLocationMessage: "Filen 需要获得媒体保存位置权限才能正常运行。"
permissionsMediaLocationMessage: "Filen 需要获得媒体保存位置权限才能正常运行。",
hideTextEditorLineNumbers: "隐藏编辑器行号",
sortByUploadDate: "上传日期",
cameraUploadCompressImages: "压缩图像"
Expand Down
71 changes: 18 additions & 53 deletions src/lib/db/db.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import SQLite from "react-native-sqlite-storage"
import { Asset } from "expo-media-library"
import { getAssetId } from "../helpers"
import memoryCache from "../memoryCache"
import { Semaphore } from "../helpers"
import storage from "../storage"
import { memoize } from "lodash"
Expand Down Expand Up @@ -66,7 +65,7 @@ export const get = async <T>(key: string): Promise<any> => {
try {
const value = storage.getString(PREFIX + key)

if (typeof value == "undefined") {
if (typeof value === "undefined") {
return null
}

Expand Down Expand Up @@ -110,10 +109,6 @@ export const hashDbFsKey = memoize(async (key: string): Promise<string> => {

export const dbFs = {
get: async <T>(key: string) => {
if (memoryCache.has(PREFIX + key)) {
return memoryCache.get(PREFIX + key) as any as T
}

const keyHashed = await hashDbFsKey(key)
const path = (await getDownloadPath({ type: "db" })) + keyHashed
const stat = await fs.stat(path)
Expand Down Expand Up @@ -148,14 +143,8 @@ export const dbFs = {
encoding: "utf8"
}
)

memoryCache.set(PREFIX + key, value)
},
has: async (key: string) => {
if (memoryCache.has(PREFIX + key)) {
return true
}

const keyHashed = await hashDbFsKey(key)
const path = (await getDownloadPath({ type: "db" })) + keyHashed
const stat = await fs.stat(path)
Expand All @@ -176,8 +165,6 @@ export const dbFs = {
}

await fs.unlink(path)

memoryCache.delete(PREFIX + key)
},
warmUp: async () => {
const path = await getDownloadPath({ type: "db" })
Expand All @@ -188,7 +175,7 @@ export const dbFs = {
if (file.length === keyHashed.length) {
const read = await fs.readAsString(path + file, "utf8")

if (read.slice(0, 64).indexOf("loadItems:") == -1) {
if (read.slice(0, 64).indexOf("loadItems:") === -1) {
continue
}

Expand All @@ -202,11 +189,9 @@ export const dbFs = {
continue
}

if (value.key.indexOf("loadItems:") == -1) {
if (value.key.indexOf("loadItems:") === -1) {
continue
}

memoryCache.set(PREFIX + value.key, value.value)
}
}
}
Expand Down Expand Up @@ -242,21 +227,14 @@ export const cameraUpload = {
},
setLastModified: async (asset: Asset, lastModified: number): Promise<void> => {
const assetId = getAssetId(asset)
const [result] = await query(
"SELECT rowid FROM camera_upload_last_modified WHERE asset_id = ? ORDER BY rowid DESC LIMIT 1",
[assetId]
)
const hasRow = result.rows.length == 1
const [result] = await query("SELECT rowid FROM camera_upload_last_modified WHERE asset_id = ? ORDER BY rowid DESC LIMIT 1", [
assetId
])
const hasRow = result.rows.length === 1

await (hasRow
? query("UPDATE camera_upload_last_modified SET last_modified = ? WHERE asset_id = ?", [
lastModified,
assetId
])
: query("INSERT INTO camera_upload_last_modified (asset_id, last_modified) VALUES (?, ?)", [
assetId,
lastModified
]))
? query("UPDATE camera_upload_last_modified SET last_modified = ? WHERE asset_id = ?", [lastModified, assetId])
: query("INSERT INTO camera_upload_last_modified (asset_id, last_modified) VALUES (?, ?)", [assetId, lastModified]))
},
getLastModifiedStat: async (asset: Asset): Promise<number> => {
const assetId = getAssetId(asset)
Expand All @@ -273,28 +251,18 @@ export const cameraUpload = {
},
setLastModifiedStat: async (asset: Asset, lastModified: number): Promise<void> => {
const assetId = getAssetId(asset)
const [result] = await query(
"SELECT rowid FROM camera_upload_last_modified_stat WHERE asset_id = ? ORDER BY rowid DESC LIMIT 1",
[assetId]
)
const hasRow = result.rows.length == 1
const [result] = await query("SELECT rowid FROM camera_upload_last_modified_stat WHERE asset_id = ? ORDER BY rowid DESC LIMIT 1", [
assetId
])
const hasRow = result.rows.length === 1

await (hasRow
? query("UPDATE camera_upload_last_modified_stat SET last_modified = ? WHERE asset_id = ?", [
lastModified,
assetId
])
: query("INSERT INTO camera_upload_last_modified_stat (asset_id, last_modified) VALUES (?, ?)", [
assetId,
lastModified
]))
? query("UPDATE camera_upload_last_modified_stat SET last_modified = ? WHERE asset_id = ?", [lastModified, assetId])
: query("INSERT INTO camera_upload_last_modified_stat (asset_id, last_modified) VALUES (?, ?)", [assetId, lastModified]))
},
getLastSize: async (asset: Asset): Promise<number> => {
const assetId = getAssetId(asset)
const [result] = await query(
"SELECT size FROM camera_upload_last_size WHERE asset_id = ? ORDER BY rowid DESC LIMIT 1",
[assetId]
)
const [result] = await query("SELECT size FROM camera_upload_last_size WHERE asset_id = ? ORDER BY rowid DESC LIMIT 1", [assetId])

if (result.rows.length !== 1) {
return -1
Expand All @@ -304,11 +272,8 @@ export const cameraUpload = {
},
setLastSize: async (asset: Asset, size: number): Promise<void> => {
const assetId = getAssetId(asset)
const [result] = await query(
"SELECT rowid FROM camera_upload_last_size WHERE asset_id = ? ORDER BY rowid DESC LIMIT 1",
[assetId]
)
const hasRow = result.rows.length == 1
const [result] = await query("SELECT rowid FROM camera_upload_last_size WHERE asset_id = ? ORDER BY rowid DESC LIMIT 1", [assetId])
const hasRow = result.rows.length === 1

await (hasRow
? query("UPDATE camera_upload_last_size SET size = ? WHERE asset_id = ?", [size, assetId])
Expand Down
2 changes: 1 addition & 1 deletion src/lib/services/cameraUpload/cameraUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ export const getAssetURI = async (asset: MediaLibrary.Asset) => {
}

export const convertHeicToJPGIOS = async (inputPath: string) => {
if (!inputPath.toLowerCase().endsWith(".heic")) {
if (!inputPath.toLowerCase().endsWith(".heic") || Platform.OS !== "ios") {
return inputPath
}

Expand Down
38 changes: 20 additions & 18 deletions src/screens/SettingsScreen/SettingsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -857,24 +857,26 @@ export const SettingsScreen = memo(({ navigation, route }: SettingsScreenProps)
/>
}
/>
<SettingsButtonLinkHighlight
title={i18n(lang, "hideTextEditorLineNumbers")}
iconBackgroundColor={getColor(darkMode, "indigo")}
iconName="code-outline"
rightComponent={
<Switch
trackColor={getColor(darkMode, "switchTrackColor")}
thumbColor={
hideEditorLineNumbers
? getColor(darkMode, "switchThumbColorEnabled")
: getColor(darkMode, "switchThumbColorDisabled")
}
ios_backgroundColor={getColor(darkMode, "switchIOSBackgroundColor")}
onValueChange={() => setHideEditorLineNumbers(!hideEditorLineNumbers)}
value={hideEditorLineNumbers}
/>
}
/>
{Platform.OS === "ios" && (
<SettingsButtonLinkHighlight
title={i18n(lang, "hideTextEditorLineNumbers")}
iconBackgroundColor={getColor(darkMode, "indigo")}
iconName="code-outline"
rightComponent={
<Switch
trackColor={getColor(darkMode, "switchTrackColor")}
thumbColor={
hideEditorLineNumbers
? getColor(darkMode, "switchThumbColorEnabled")
: getColor(darkMode, "switchThumbColorDisabled")
}
ios_backgroundColor={getColor(darkMode, "switchIOSBackgroundColor")}
onValueChange={() => setHideEditorLineNumbers(!hideEditorLineNumbers)}
value={hideEditorLineNumbers}
/>
}
/>
)}
</SettingsGroup>
<SettingsGroup>
<SettingsButtonLinkHighlight
Expand Down

0 comments on commit 8e54aa8

Please sign in to comment.