From d7647f57e8aa79a9e9ab8a97a8e39c33c3d1825f Mon Sep 17 00:00:00 2001 From: lunaticbum Date: Sun, 5 Apr 2026 09:30:18 +0900 Subject: [PATCH] .. --- .../bums/lunatic/launcher/utils/RssList.kt | 6 +++--- .../launcher/wall/MyWallpaperService.kt | 2 +- .../lunatic/launcher/workers/TaskAggregator.kt | 6 +++--- .../lunatic/launcher/workers/TorrentManager.kt | 18 +++++++++++++++++- .../lunatic/launcher/workers/YoutubeGetter.kt | 8 ++++---- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt b/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt index 86d6864b..2aabccdb 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/utils/RssList.kt @@ -15,13 +15,13 @@ object RssList { "https://www.youtube.com/@fairyjaehyung", "https://www.youtube.com/@15ya_egg", "https://www.youtube.com/@%EC%A7%80%EB%AC%B4%EB%B9%84", - "https://www.youtube.com/" +// "https://www.youtube.com/" ) val newsFeeds = arrayListOf( "https://news.google.com/rss?hl=ko&gl=KR&ceid=KR:ko", - "https://rss.nocutnews.co.kr/news/top.xml", +// "https://rss.nocutnews.co.kr/news/top.xml", "https://trends.google.co.kr/trending/rss?geo=KR", - "https://trends.google.co.kr/trends/trendingsearches/daily/rss?geo=KR" +// "https://trends.google.co.kr/trends/trendingsearches/daily/rss?geo=KR" ) val feedJsons = arrayListOf( diff --git a/app/src/main/kotlin/bums/lunatic/launcher/wall/MyWallpaperService.kt b/app/src/main/kotlin/bums/lunatic/launcher/wall/MyWallpaperService.kt index bc7a20ba..d02ccca6 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/wall/MyWallpaperService.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/wall/MyWallpaperService.kt @@ -355,7 +355,7 @@ class MyWallpaperService : WallpaperService() { width = size?.first ?: 0 height = size?.second ?: 0 isOk = (width >= requiredSize*0.65 && height >= requiredSize*0.65) - Blog.LOGE("loadFiles videoExtensions requiredSize $requiredSize width $width height $height [$isOk]") +// Blog.LOGE("loadFiles videoExtensions requiredSize $requiredSize width $width height $height [$isOk]") } } diff --git a/app/src/main/kotlin/bums/lunatic/launcher/workers/TaskAggregator.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/TaskAggregator.kt index b31edd2b..6a7f34a0 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/workers/TaskAggregator.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/TaskAggregator.kt @@ -93,11 +93,11 @@ object TaskAggregator { // 병렬로 네트워크 요청 쏘기 (시간 획기적으로 단축됨) val jobs = listOf( - async { RuliWebGetter(context).fetchData() }, +// async { RuliWebGetter(context).fetchData() }, async { TheQooGetter(context).fetchData() }, - async { YoutubeGetter(context).fetchData() }, +// async { YoutubeGetter(context).fetchData() }, async { DCGetter(context).fetchData() }, - async { FmKoreaGetter(context).fetchData() }, +// async { FmKoreaGetter(context).fetchData() }, async { NewsFeedsGetter(context).fetchData() }, async { ClienGetter(context).fetchData() }, async { DotaxGetter(context).fetchData() }, diff --git a/app/src/main/kotlin/bums/lunatic/launcher/workers/TorrentManager.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/TorrentManager.kt index c8d3db1c..6fa05119 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/workers/TorrentManager.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/TorrentManager.kt @@ -158,7 +158,23 @@ class TorrentService : Service() { networkCallback = object : ConnectivityManager.NetworkCallback() { override fun onCapabilitiesChanged(network: Network, caps: NetworkCapabilities) { - isWifiConnected = caps.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) + // 단순히 caps만 보지 말고, 현재 활성화된 기본 네트워크의 상태를 직접 다시 조회합니다. + val activeNet = connectivityManager.activeNetwork + val activeCaps = connectivityManager.getNetworkCapabilities(activeNet) + + val wifiNow = activeCaps?.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) == true + + // 상태가 실제로 변했을 때만 업데이트하여 불필요한 로그와 로직 실행을 방지합니다. + if (isWifiConnected != wifiNow) { + isWifiConnected = wifiNow + Blog.LOGE("와이파이 상태 변경: $isWifiConnected") + updateSessionState() + } + } + + // 네트워크가 완전히 끊겼을 때도 처리해주는 것이 안전합니다. + override fun onLost(network: Network) { + checkInitialStatus() // 전체 상태 다시 체크 updateSessionState() } } diff --git a/app/src/main/kotlin/bums/lunatic/launcher/workers/YoutubeGetter.kt b/app/src/main/kotlin/bums/lunatic/launcher/workers/YoutubeGetter.kt index a3c99429..c74b27f9 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/workers/YoutubeGetter.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/workers/YoutubeGetter.kt @@ -25,11 +25,11 @@ class YoutubeGetter(context: Context) : BaseGetter(context) { @SuppressLint("RestrictedApi") override fun realWork(): List { rssUrls.clear() - rssUrls.addAll(RssList.youtubeUrls) +// rssUrls.addAll(RssList.youtubeUrls) RssDataType.YOUTUBE.isOn { - for (url in rssUrls) { - temp.addAll(ytChannel(Jsoup.connect(url).userAgent(USAGT).get())) - } +// for (url in rssUrls) { +// temp.addAll(ytChannel(Jsoup.connect(url).userAgent(USAGT).get())) +// } } return temp }