1.0.4提审

This commit is contained in:
澜声世纪 2025-12-29 09:01:07 +08:00
parent 7b5276ead5
commit b2c7d5e34e
6 changed files with 37 additions and 22 deletions

View File

@ -3041,7 +3041,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.3; MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive; PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -3086,7 +3086,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.3; MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive; PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

View File

@ -50,18 +50,24 @@ struct NRNovelAPI {
} }
/// ///
static func requestUploadRecord(_ id: String, chapterId: String) { static func requestUploadRecord(_ id: String, chapterId: String) async -> Bool {
// var param = NRNetwork.Parameters(path: "/novel/watchProgressReport") await withCheckedContinuation { continuation in
var param = NRNetwork.Parameters(path: "/createHistory") // var param = NRNetwork.Parameters(path: "/novel/watchProgressReport")
param.isToast = false var param = NRNetwork.Parameters(path: "/createHistory")
param.parameters = [ param.isToast = false
"short_play_id" : id, param.parameters = [
// "short_play_video_id" : chapterId "short_play_id" : id,
"video_id" : chapterId // "short_play_video_id" : chapterId
] "video_id" : chapterId
]
NRNetwork.request(parameters: param) { (response: NRNetwork.Response<String>) in
NRNetwork.request(parameters: param) { (response: NRNetwork.Response<String>) in
if response.isSuccess {
continuation.resume(returning: true)
} else {
continuation.resume(returning: false)
}
}
} }
} }

View File

@ -39,7 +39,7 @@ class NRNovelReaderViewController: NRViewController {
} }
} }
let oldBrightness: CGFloat = UIScreen.main.brightness var oldBrightness: CGFloat = UIScreen.main.brightness
private(set) lazy var viewModel: NRNovelReadViewModel = { private(set) lazy var viewModel: NRNovelReadViewModel = {
let vm = NRNovelReadViewModel() let vm = NRNovelReadViewModel()

View File

@ -171,12 +171,14 @@ extension NRNovelReadViewModel {
model.page = pageModel.page?.intValue model.page = pageModel.page?.intValue
NRKeyedArchiver.archiver(folderName: kNRReadRecordFolderName, fileName: novelId, object: model) NRKeyedArchiver.archiver(folderName: kNRReadRecordFolderName, fileName: novelId, object: model)
let lastTime = uploadRecordDate?.timeIntervalSince1970 ?? 0 if self.lastUploadCatalogId == nil || self.lastUploadCatalogId != catalogModel.id {
let nowTime = Date().timeIntervalSince1970 self.lastUploadCatalogId = catalogModel.id
Task {
if lastTime == 0 || nowTime - lastTime > 1 {//5 let result = await NRNovelAPI.requestUploadRecord(novelId, chapterId: catalogModel.id ?? "")
uploadRecordDate = Date() if !result {
NRNovelAPI.requestUploadRecord(novelId, chapterId: catalogModel.id ?? "") self.lastUploadCatalogId = nil
}
}
} }
} }

View File

@ -44,8 +44,8 @@ class NRNovelReadViewModel: NSObject {
return tap return tap
}() }()
/// ///id
var uploadRecordDate: Date? var lastUploadCatalogId: String?
weak var popView: UIView? weak var popView: UIView?

View File

@ -14,6 +14,11 @@ class NRNovelReadSetManager: NSObject {
private(set) var readSet: NRNovelReadSet = UserDefaults.nr_object(forKey: kNRNovelReadSetDefaultsKey, as: NRNovelReadSet.self) ?? NRNovelReadSet() private(set) var readSet: NRNovelReadSet = UserDefaults.nr_object(forKey: kNRNovelReadSetDefaultsKey, as: NRNovelReadSet.self) ?? NRNovelReadSet()
override init() {
super.init()
// NotificationCenter.default.addObserver(self, selector: #selector(willEnterForegroundNotification), name: UIApplication.willEnterForegroundNotification, object: nil)
}
/// ///
let animateDuration = 0.2 let animateDuration = 0.2
@ -26,6 +31,8 @@ class NRNovelReadSetManager: NSObject {
return .init(x: 16, y: 0, width: UIScreen.width - 32, height: UIScreen.height - contentTopViewHeight - contentBottomViewHeight) return .init(x: 16, y: 0, width: UIScreen.width - 32, height: UIScreen.height - contentTopViewHeight - contentBottomViewHeight)
} }
var systemBrightness: CGFloat = UIScreen.main.brightness
var currentTheme: NRReadTheme { var currentTheme: NRReadTheme {
if isNight { if isNight {
return nightTheme return nightTheme