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)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.3;
MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -3086,7 +3086,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.3;
MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = com.lssj.ReaderHive;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View File

@ -50,18 +50,24 @@ struct NRNovelAPI {
}
///
static func requestUploadRecord(_ id: String, chapterId: String) {
// var param = NRNetwork.Parameters(path: "/novel/watchProgressReport")
static func requestUploadRecord(_ id: String, chapterId: String) async -> Bool {
await withCheckedContinuation { continuation in
// var param = NRNetwork.Parameters(path: "/novel/watchProgressReport")
var param = NRNetwork.Parameters(path: "/createHistory")
param.isToast = false
param.parameters = [
"short_play_id" : id,
// "short_play_video_id" : chapterId
// "short_play_video_id" : chapterId
"video_id" : chapterId
]
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 = {
let vm = NRNovelReadViewModel()

View File

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

View File

@ -44,8 +44,8 @@ class NRNovelReadViewModel: NSObject {
return tap
}()
///
var uploadRecordDate: Date?
///id
var lastUploadCatalogId: String?
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()
override init() {
super.init()
// NotificationCenter.default.addObserver(self, selector: #selector(willEnterForegroundNotification), name: UIApplication.willEnterForegroundNotification, object: nil)
}
///
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)
}
var systemBrightness: CGFloat = UIScreen.main.brightness
var currentTheme: NRReadTheme {
if isNight {
return nightTheme