-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
193 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...roidMain/kotlin/dev/datlag/burningseries/ui/screen/initial/series/SeriesScreen.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.SideEffect | ||
import dev.datlag.burningseries.ui.KeyEventDispatcher | ||
import dev.datlag.burningseries.ui.PIPActions | ||
import dev.datlag.burningseries.ui.PIPEventDispatcher | ||
import dev.datlag.burningseries.ui.PIPModeListener | ||
|
||
@Composable | ||
actual fun EnterSeriesScreen() { | ||
SideEffect { | ||
KeyEventDispatcher = { null } | ||
PIPEventDispatcher = { null } | ||
PIPModeListener = { } | ||
PIPActions = { null } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ktopMain/kotlin/dev/datlag/burningseries/ui/screen/initial/series/SeriesScreen.desktop.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series | ||
|
||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
actual fun EnterSeriesScreen() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
plugins { | ||
alias(libs.plugins.multiplatform) | ||
alias(libs.plugins.serialization) | ||
alias(libs.plugins.ktorfit) | ||
} | ||
|
||
val artifact = VersionCatalog.artifactName("extension") | ||
group = artifact | ||
|
||
kotlin { | ||
js(IR) { | ||
browser() | ||
binaries.executable() | ||
} | ||
|
||
sourceSets { | ||
jsMain.get().dependencies { | ||
runtimeOnly(npm("webextension-polyfill", "0.10.0")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"manifest_version": 3, | ||
|
||
"name": "Burning-Series Activate", | ||
"description": "Burning-Series Activate is an extension to activate episodes for the app in your browser.", | ||
"version": "0.0.0", | ||
|
||
"action": { | ||
"default_icon": "icons/launcher_128.png", | ||
"default_popup": "popup.html" | ||
}, | ||
|
||
"icons": { | ||
"16": "icons/launcher_16.png", | ||
"32": "icons/launcher_32.png", | ||
"48": "icons/launcher_48.png", | ||
"64": "icons/launcher_64.png", | ||
"96": "icons/launcher_96.png", | ||
"128": "icons/launcher_128.png" | ||
}, | ||
|
||
"content_scripts": [ | ||
{ | ||
"matches": [ | ||
"*://*.bs.to/serie/*", | ||
"*://*.burningseries.co/serie/*", | ||
"*://*.burningseries.sx/serie/*", | ||
"*://*.burningseries.ac/serie/*", | ||
"*://*.burningseries.vc/serie/*", | ||
"*://*.burningseries.cx/serie/*", | ||
"*://*.burningseries.nz/serie/*", | ||
"*://*.burningseries.se/serie/*", | ||
"*://*.burningseries.tw/serie/*" | ||
], | ||
"js": [ | ||
"browser-polyfill.min.js", | ||
"content_script.js" | ||
] | ||
} | ||
], | ||
|
||
"background": { | ||
"service_worker": "background.js" | ||
}, | ||
|
||
"permissions": [ | ||
"storage", | ||
"background" | ||
], | ||
|
||
"host_permissions": [ | ||
"https://jsonbase.com/*", | ||
"https://*.googleapis.com/*" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
network/src/commonMain/kotlin/dev/datlag/burningseries/network/realm/RealmLoader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.datlag.burningseries.network.realm | ||
|
||
expect class RealmLoader { | ||
suspend fun login() | ||
|
||
suspend fun loadEpisodes(hosterHref: List<String>): List<String> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
network/src/commonMain/kotlin/dev/datlag/burningseries/network/state/NetworkStateSaver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
network/src/jsMain/kotlin/dev/datlag/burningseries/network/realm/RealmLoader.js.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package dev.datlag.burningseries.network.realm | ||
|
||
actual object RealmLoader { | ||
actual suspend fun login() { } | ||
|
||
actual suspend fun loadEpisodes(hosterHref: List<String>): List<String> { | ||
return emptyList() | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
network/src/realmCompatible/kotlin/dev/datlag/burningseries/network/realm/RealmLoader.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package dev.datlag.burningseries.network.realm | ||
|
||
import dev.datlag.burningseries.model.common.suspendCatching | ||
import dev.datlag.burningseries.network.state.NetworkStateSaver | ||
import io.realm.kotlin.mongodb.App | ||
import io.realm.kotlin.mongodb.Credentials | ||
import io.realm.kotlin.mongodb.User | ||
import org.mongodb.kbson.BsonDocument | ||
import io.realm.kotlin.mongodb.ext.call | ||
|
||
actual class RealmLoader(private val app: App?) { | ||
actual suspend fun login() { | ||
if (mongoUser == null) { | ||
mongoUser = suspendCatching { | ||
app?.login(Credentials.anonymous()) | ||
}.getOrNull() | ||
} | ||
} | ||
|
||
actual suspend fun loadEpisodes(hosterHref: List<String>): List<String> { | ||
return suspendCatching { | ||
val doc = mongoUser?.functions?.call<BsonDocument>("query", hosterHref.toTypedArray()) | ||
doc?.getArray("result")?.values?.map { it.asDocument().getString("url").value } | ||
}.getOrNull() ?: emptyList() | ||
} | ||
|
||
companion object { | ||
private var mongoUser: User? = null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters