From a4f0cecfa46f6146a53b46689d644f68de3cc4fa Mon Sep 17 00:00:00 2001 From: lunaticbum Date: Sat, 7 Sep 2024 18:34:21 +0900 Subject: [PATCH] .. --- .../rasel/lunar/launcher/feeds/Feeds.kt | 8 ++---- .../rasel/lunar/launcher/workers/WorkersDb.kt | 27 ++++++++++++++----- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/feeds/Feeds.kt b/app/src/main/kotlin/rasel/lunar/launcher/feeds/Feeds.kt index 7bcc794a..0c69a23a 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/feeds/Feeds.kt +++ b/app/src/main/kotlin/rasel/lunar/launcher/feeds/Feeds.kt @@ -229,6 +229,7 @@ internal class Feeds : Fragment() , CommadCallabck { val cmd = input.text.toString().trim().split(" ") when(cmd[0]) { "jf" -> { + consoleLog("on Cmd JF") GlobalScope.launch { excuteGetterMostByUrl("https://javmost.to/search/movie/${cmd[1]}") } } "mgn"-> { @@ -299,12 +300,7 @@ internal class Feeds : Fragment() , CommadCallabck { "https://javmost.to/latest-updates/page-2", "https://javmost.to/latest-updates/page-3", "https://javmost.to/latest-updates/page-4", - "https://javmost.to/latest-updates/page-5", - "https://javmost.to/latest-updates/page-6", - "https://javmost.to/latest-updates/page-7", - "https://javmost.to/latest-updates/page-8", - "https://javmost.to/latest-updates/page-9", - "https://javmost.to/latest-updates/page-10") + "https://javmost.to/latest-updates/page-5") GlobalScope.launch { urls.forEach { mostUrl -> excuteGetterMostByUrl(mostUrl) diff --git a/app/src/main/kotlin/rasel/lunar/launcher/workers/WorkersDb.kt b/app/src/main/kotlin/rasel/lunar/launcher/workers/WorkersDb.kt index 3f36d435..a9855f8c 100644 --- a/app/src/main/kotlin/rasel/lunar/launcher/workers/WorkersDb.kt +++ b/app/src/main/kotlin/rasel/lunar/launcher/workers/WorkersDb.kt @@ -30,7 +30,11 @@ object WorkersDb { fun insertData(rssData: RssData) { getRealm().apply { this.writeBlocking { - this.copyToRealm(rssData, UpdatePolicy.ALL) + try { + this.copyToRealm(rssData, UpdatePolicy.ERROR) + } catch (e : Exception) { + + } } } } @@ -39,7 +43,11 @@ object WorkersDb { rssDatas.forEach { try { getRealm().writeBlocking { - this.copyToRealm(it, UpdatePolicy.ALL) + try { + this.copyToRealm(it, UpdatePolicy.ERROR) + } catch (e : Exception) { + + } } } catch (e : Exception) { } @@ -52,11 +60,12 @@ object WorkersDb { try { getRealm().writeBlocking { if (it is RssData) { - this.copyToRealm(it, UpdatePolicy.ALL) + try { + this.copyToRealm(it, UpdatePolicy.ERROR) + } catch (e : Exception) { + + } } -// else if(it is RssDataInterface) { -// this.copyToRealm(it.getRssData(), UpdatePolicy.ALL) -// } } } catch (e : Exception) { } @@ -66,7 +75,11 @@ object WorkersDb { fun insertNoti(data: NotificationItem) { getRealm().apply { this.writeBlocking { - this.copyToRealm(data, UpdatePolicy.ALL) + try { + this.copyToRealm(data, UpdatePolicy.ERROR) + } catch (e : Exception) { + + } } } }