..
This commit is contained in:
parent
ba869e8eb4
commit
d7647f57e8
@ -15,13 +15,13 @@ object RssList {
|
|||||||
"https://www.youtube.com/@fairyjaehyung",
|
"https://www.youtube.com/@fairyjaehyung",
|
||||||
"https://www.youtube.com/@15ya_egg",
|
"https://www.youtube.com/@15ya_egg",
|
||||||
"https://www.youtube.com/@%EC%A7%80%EB%AC%B4%EB%B9%84",
|
"https://www.youtube.com/@%EC%A7%80%EB%AC%B4%EB%B9%84",
|
||||||
"https://www.youtube.com/"
|
// "https://www.youtube.com/"
|
||||||
)
|
)
|
||||||
val newsFeeds = arrayListOf(
|
val newsFeeds = arrayListOf(
|
||||||
"https://news.google.com/rss?hl=ko&gl=KR&ceid=KR:ko",
|
"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/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(
|
val feedJsons = arrayListOf(
|
||||||
|
|||||||
@ -355,7 +355,7 @@ class MyWallpaperService : WallpaperService() {
|
|||||||
width = size?.first ?: 0
|
width = size?.first ?: 0
|
||||||
height = size?.second ?: 0
|
height = size?.second ?: 0
|
||||||
isOk = (width >= requiredSize*0.65 && height >= requiredSize*0.65)
|
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]")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -93,11 +93,11 @@ object TaskAggregator {
|
|||||||
|
|
||||||
// 병렬로 네트워크 요청 쏘기 (시간 획기적으로 단축됨)
|
// 병렬로 네트워크 요청 쏘기 (시간 획기적으로 단축됨)
|
||||||
val jobs = listOf(
|
val jobs = listOf(
|
||||||
async { RuliWebGetter(context).fetchData() },
|
// async { RuliWebGetter(context).fetchData() },
|
||||||
async { TheQooGetter(context).fetchData() },
|
async { TheQooGetter(context).fetchData() },
|
||||||
async { YoutubeGetter(context).fetchData() },
|
// async { YoutubeGetter(context).fetchData() },
|
||||||
async { DCGetter(context).fetchData() },
|
async { DCGetter(context).fetchData() },
|
||||||
async { FmKoreaGetter(context).fetchData() },
|
// async { FmKoreaGetter(context).fetchData() },
|
||||||
async { NewsFeedsGetter(context).fetchData() },
|
async { NewsFeedsGetter(context).fetchData() },
|
||||||
async { ClienGetter(context).fetchData() },
|
async { ClienGetter(context).fetchData() },
|
||||||
async { DotaxGetter(context).fetchData() },
|
async { DotaxGetter(context).fetchData() },
|
||||||
|
|||||||
@ -158,7 +158,23 @@ class TorrentService : Service() {
|
|||||||
|
|
||||||
networkCallback = object : ConnectivityManager.NetworkCallback() {
|
networkCallback = object : ConnectivityManager.NetworkCallback() {
|
||||||
override fun onCapabilitiesChanged(network: Network, caps: NetworkCapabilities) {
|
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()
|
updateSessionState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,11 +25,11 @@ class YoutubeGetter(context: Context) : BaseGetter(context) {
|
|||||||
@SuppressLint("RestrictedApi")
|
@SuppressLint("RestrictedApi")
|
||||||
override fun realWork(): List<RealmObject> {
|
override fun realWork(): List<RealmObject> {
|
||||||
rssUrls.clear()
|
rssUrls.clear()
|
||||||
rssUrls.addAll(RssList.youtubeUrls)
|
// rssUrls.addAll(RssList.youtubeUrls)
|
||||||
RssDataType.YOUTUBE.isOn {
|
RssDataType.YOUTUBE.isOn {
|
||||||
for (url in rssUrls) {
|
// for (url in rssUrls) {
|
||||||
temp.addAll(ytChannel(Jsoup.connect(url).userAgent(USAGT).get()))
|
// temp.addAll(ytChannel(Jsoup.connect(url).userAgent(USAGT).get()))
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
return temp
|
return temp
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user