Skip to content

Commit

Permalink
- publish v7.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
czy0729 committed Oct 31, 2022
1 parent 4664773 commit 374a7d7
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 57 deletions.
32 changes: 10 additions & 22 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,32 @@ Google Play 被恶意举报已被暂停申诉无果,因为不同渠道包互
- 超展开(帖吧)
- 时光机(个人中心)、用户空间
- 不限于搜索、排行榜、索引、目录、每日放送、年鉴、标签
- 其他站点同步到 bgm 功能

### 特色功能

- 大部分资源覆盖到自维护 [CDN](https://github.com/czy0729/Bangumi-Subject),访问高速化
- 图片使用 [CDN](https://github.com/czy0729/Bangumi-OSS),有后处理,比源网站更快、质量更高、流量更小
- 封面图片和大部分脱敏静态数据覆盖到自费国内 CDN 中间层,访问高速化
- 当季番剧精准到单集网络播放源、漫画源查询,找番剧、文库、游戏、音乐
- 番剧、游戏截图预览
- [小圣杯](https://bgm.tv/dev/app/1143)(角色交易空气游戏, App 独立设计 UI 和交互)

## Update

v7.1.0 - 2022/09/25
v7.2.3 - 2022/10/31

—— 新增 ——

- [x] [发现] 找条目功能重构 (更新了更多的数据、更合理的分类等,具体细节请进入页面使用查看)
- [x] 条目未放送的章节按钮,支持添加放送提醒到手机日历 (暂安卓 only)
- [x] [条目] 预览图的单独列表页面

—— 优化 ——

- [x] [人物] 以京都动画人物页面卡顿为基准,单独优化
- [x] [条目] 标签增加了可以直接跳转到〔找条目〕对应筛选条件的逻辑
- [x] 大量减少了打包到 APP 里面的静态数据,减少安卓内存溢出闪退
- [x] [系统] 大幅缩短了冷启动时间(因为缓存的本地数据改成懒加载,可能会导致进入一个以往访问过的页面,不能马上显示完整
- [x] [首页收藏] 章节支持批量添加日历提醒 (新使用了日历账号管理,并且 iOS 也支持此功能了)
- [x] [iOS] 允许修改切页动画

—— 修复 ——

- [x] 修复了默认头像用户自定义 APP 头像后,所有默认头像都为自己的问题
- [x] 修复了若干已知问题
- [x] [安卓] 修复了找条目中【按名字排序】闪退;发现页面中【SMB 管理】闪退等问题

[CHANGELOGS](https://github.com/czy0729/Bangumi/blob/master/web/CHANGELOG.MD)

Expand All @@ -97,20 +95,8 @@ v7.1.0 - 2022/09/25

## PowerBy

[![](https://data.jsdelivr.com/v1/package/gh/czy0729/Bangumi-Subject/badge)](https://www.jsdelivr.com/package/gh/czy0729/Bangumi-Subject) [[Bangumi-Subject]](https://github.com/czy0729/Bangumi-Subject) 条目快照

[![](https://data.jsdelivr.com/v1/package/gh/ekibot/bangumi-onair/badge)](https://www.jsdelivr.com/package/gh/ekibot/bangumi-onair) [[Bangumi-OnAir]](https://github.com/ekibot/bangumi-onair) [ekibun](https://github.com/ekibun) 的单集播放数据源

[![](https://data.jsdelivr.com/v1/package/gh/czy0729/Bangumi-Mono/badge)](https://www.jsdelivr.com/package/gh/czy0729/Bangumi-Mono) [[Bangumi-Mono]](https://github.com/czy0729/Bangumi-Mono)人物快照

[![](https://data.jsdelivr.com/v1/package/gh/czy0729/Bangumi-OSS/badge)](https://www.jsdelivr.com/package/gh/czy0729/Bangumi-OSS) [[Bangumi-OSS]](https://github.com/czy0729/Bangumi-OSS) 热门条目封面和活跃用户头像对象存储

[![](https://data.jsdelivr.com/v1/package/gh/czy0729/Bangumi-Rakuen/badge)](https://www.jsdelivr.com/package/gh/czy0729/Bangumi-Rakuen) [[Bangumi-Rakuen]](https://github.com/czy0729/Bangumi-Rakuen) 帖子快照

[![](https://data.jsdelivr.com/v1/package/gh/czy0729/Bangumi-Static/badge)](https://www.jsdelivr.com/package/gh/czy0729/Bangumi-Static) [[Bangumi-Static]](https://github.com/czy0729/Bangumi-Static) 聚合静态数据

[![](https://data.jsdelivr.com/v1/package/gh/czy0729/Bangumi-Game/badge)](https://www.jsdelivr.com/package/gh/czy0729/Bangumi-Game) [[Bangumi-Game]](https://github.com/czy0729/Bangumi-Game) 游戏条目扩展数据

[[bangumi-mosaic-tile]](https://github.com/weizhenye/bangumi-mosaic-tile) [weizhenye](https://github.com/weizhenye) 的用户统计瓷砖库

[[bangumi-data]](https://github.com/bangumi-data/bangumi-data) 番组数据索引
Expand Down Expand Up @@ -174,6 +160,8 @@ react-native run-android // [android] 真机 usb 调试

- 遇到 spawnSync adb ENOENT,参考 [stackoverflow](https://stackoverflow.com/questions/38835931/react-native-adb-reverse-enoent)

- 第一次就遇到打包失败,看看是不是遇到 read timeout 等问题,表示需要科学上网。明明前一天还能打包成功,后一天就失败,也可能是依赖包无法获取的问题,因为 gradlew 依赖包只有 24 小时的缓存时间,尝试使用 --offline 命令

** 补充常见错误,已在 mac M1 上调试成功 **

最近购入了 M1,尝试实用新环境,iOS expo 运行一路顺风,但是打包 apk 遇到很多问题,总结如下:
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ allprojects {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven { url "https://maven.aliyun.com/nexus/content/groups/public/" }
maven { url "https://maven.aliyun.com/nexus/content/groups/public" }
maven { url "https://maven.aliyun.com/nexus/content/repositories/jcenter" }
maven { url 'https://jcenter.bintray.com/umsdk/release' }
mavenCentral {
Expand Down
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"expo": {
"description": "A React Native App for https://bgm.tv, tinygrail plugin 4.5.0",
"version": "7.2.2",
"version": "7.2.3",
"android": {
"versionCode": 70220,
"versionCode": 70230,
"package": "com.czy0729.bangumi",
"adaptiveIcon": {
"foregroundImage": "./src/assets/images/foreground.png",
Expand Down
2 changes: 1 addition & 1 deletion config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: czy0729
* @Date: 2019-06-02 14:42:28
* @Last Modified by: czy0729
* @Last Modified time: 2022-10-25 16:56:37
* @Last Modified time: 2022-10-30 21:24:34
*/
import { Paths } from '@types'

Expand Down
2 changes: 2 additions & 0 deletions src/constants/events/other.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default {
'其他.试用CDN': 'Other.cdnMagma',
'其他.管理条目': 'Other.manageSubject',
'其他.添加日历': 'Other.saveCalenderEvent',
'其他.批量添加日历': 'Other.batchSaveCalenderEvent',
'其他.重新授权': 'Other.reOauth',

'AC搜索.缩略框': 'ACSearch.popable',
'AC搜索.跳转': 'ACSearch.to',
Expand Down
50 changes: 27 additions & 23 deletions src/screens/home/v2/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export default class ScreenHomeV2 extends store {
inited = true

await this.initStore()
this.initFetch()
requestAnimationFrame(() => {
this.initFetch()
})
}

return true
Expand Down Expand Up @@ -130,34 +132,38 @@ export default class ScreenHomeV2 extends store {
let flag = refresh
let { _loaded } = this.collection
if (typeof _loaded !== 'number') _loaded = 0
if (getTimestamp() - _loaded > 60 * 60 || !this.collection.list.length) flag = true
if (getTimestamp() - _loaded > 60 * 60 * 3 || !this.collection.list.length) {
flag = true
}

// 需要刷新数据
if (flag) {
const data = await Promise.all([
userStore.fetchCollection(),
userStore.fetchUserProgress()
])
if (data?.[0]?.list?.length) return this.fetchSubjectsQueue(data[0].list)
if (await this.initQueue()) return true

// 可能是 access_token 过期了, 需要重新刷新 access_token
if (userStore.isWebLogin) {
const success = await userStore.reOauth()

// oauth 成功后重新刷新数据
if (success) {
const data = await Promise.all([
userStore.fetchCollection(),
userStore.fetchUserProgress()
])
if (data?.[0]?.list?.length) return this.fetchSubjectsQueue(data[0].list)
if (await userStore.reOauth()) {
t('其他.重新授权')
return this.initQueue()
}
}
}

return true
}

/** 初始化进度和条目等数据 */
initQueue = async () => {
const data = await Promise.all([
userStore.fetchCollection(),
userStore.fetchUserProgress()
])
if (data?.[0]?.list?.length) return this.fetchSubjectsQueue(data[0].list)

return false
}

/** -------------------- fetch -------------------- */
/** 请求条目信息 */
fetchSubject = (subjectId: SubjectId, index: number = 0) => {
Expand All @@ -183,26 +189,19 @@ export default class ScreenHomeV2 extends store {
/** 队列请求条目信息 */
fetchSubjectsQueue = async (list = []) => {
const fetchs = this.sortList(list).map(({ subject_id }, index) => () => {
// this.setState({
// progress: {
// current: index + 1
// }
// })
return this.fetchSubject(subject_id, index)
})

if (fetchs.length) {
this.setState({
progress: {
fetching: true
// message: '更新条目信息',
// current: 1,
// total: fetchs.length
}
})
}

await queue(fetchs, 1)
await sleep(40)
this.setState({
progress: EXCLUDE_STATE.progress
})
Expand Down Expand Up @@ -1309,6 +1308,11 @@ export default class ScreenHomeV2 extends store {
hide()
info('已完成')
feedback()

t('其他.批量添加日历', {
subjectId,
length: fns.length
})
},
'一键添加放送提醒'
)
Expand Down
29 changes: 22 additions & 7 deletions src/stores/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import otaStore from './ota'
import rakuenStore from './rakuen'
import searchStore from './search'
import smbStore from './smb'
import subjectStore from './subject'
import subjectStore, { getInt } from './subject'
import systemStore from './system'
import tagStore from './tag'
import themeStore from './theme'
Expand All @@ -39,12 +39,21 @@ class GlobalStores {

inited = true

// systemStore.init 和 themeStore.init 维持旧逻辑
/** systemStore.init 和 themeStore.init 维持旧逻辑 */
await systemStore.init()
await themeStore.init()
await smbStore.init('data')

// 其他 store 使用新的懒读取本地数据逻辑
/**
* 其他 store 使用新的懒读取本地数据逻辑,以下数据在初始化前拿出来
* 会显著提高 APP 使用体验,实际上不取出来也不会影响使用
*/
// usersStore
const usersStoreKeys = ['users'] as const
for (let i = 0; i < usersStoreKeys.length; i += 1) {
await usersStore.init(usersStoreKeys[i])
}

// userStore
const userStoreKeys = [
'accessToken',
'formhash',
Expand All @@ -58,11 +67,17 @@ class GlobalStores {
await userStore.init(userStoreKeys[i])
}

const usersStoreKeys = ['users'] as const
for (let i = 0; i < usersStoreKeys.length; i += 1) {
await usersStore.init(usersStoreKeys[i])
// subjectStoreKeys
const subjectStoreKeys: `subject${number}`[] = []
userStore.collection.list.forEach(item => {
subjectStoreKeys.push(`subject${getInt(item.subject_id)}`)
})
for (let i = 0; i < subjectStoreKeys.length; i += 1) {
await subjectStore.init(subjectStoreKeys[i])
}

if (DEV) console.info('========== GlobalStores init ==========')

return systemStore.setting
} catch (error) {
return false
Expand Down
2 changes: 1 addition & 1 deletion src/stores/subject/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ for (let i = 0; i < 1000; i += 1) {
state[`subjectFormHTML${i}`] = {}
}

function getInt(subjectId: SubjectId) {
export function getInt(subjectId: SubjectId) {
const str = String(subjectId)
return Number(str.slice(str.length - 3, str.length))
}
Expand Down
31 changes: 31 additions & 0 deletions web/CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# CHANGELOG

v7.2.3 - 2022/10/31

—— 新增 ——

- [x] [条目] 预览图的单独列表页面

—— 优化 ——

- [x] [系统] 大幅缩短了冷启动时间(因为缓存的本地数据改成懒加载,可能会导致进入一个以往访问过的页面,不能马上显示完整
- [x] [首页收藏] 章节支持批量添加日历提醒 (新使用了日历账号管理,并且 iOS 也支持此功能了)
- [x] [iOS] 允许修改切页动画

—— 修复 ——

- [x] [安卓] 修复了找条目中【按名字排序】闪退;发现页面中【SMB 管理】闪退等问题

v7.2.0 - 2022/10/17

—— 新增 ——

- [x] [发现] 新增豆瓣同步 (实验性,目前支持同步部分动画和三次元条目)

—— 优化 ——

- [x] 优化了部分三四级页面的表现 (例如人物已支线显示多 CV)
- [x] 从这个版本开始就算网站挂掉了,APP 也能支持显示大部分静态数据

—— 修复 ——

- [x] [首页发现] 修复了网格模式条目封面不刷新的问题

v7.1.0 - 2022/09/25

—— 新增 ——
Expand Down
1 change: 1 addition & 0 deletions web/android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"39": "sudo mv ./node_modules ../SDK && mv ../SDK/39/node_modules ./ && mv ../SDK/node_modules ../SDK/38 && cp ./package.json ./web/android/package.json && cp ./web/ios/package.json ./package.json",
"android": "watchman watch-del '/Users/chen/Bangumi32' && watchman watch-project '/Users/chen/Bangumi32' && react-native run-android --no-jetifier",
"build": "cd android && ./gradlew assembleRelease && cd .. && node web/rename.js",
"build:offline": "cd android && ./gradlew assembleRelease --offline && cd .. && node web/rename.js",
"build:ios": "expo build:ios -c",
"clean": "cd android && ./gradlew clean",
"k": "sudo purge",
Expand Down

0 comments on commit 374a7d7

Please sign in to comment.