Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
urFate committed Dec 22, 2024
2 parents e4cd11d + 60d6a51 commit 2a473d5
Show file tree
Hide file tree
Showing 40 changed files with 2,324 additions and 303 deletions.
7 changes: 3 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}

buildFeatures {
Expand Down Expand Up @@ -101,7 +101,6 @@ dependencies {
debugImplementation(libs.androidx.compose.ui.test.manifest)

// Compose UI
implementation(libs.de.mr.pine.utils.zoomables)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.material.icons.extended)
Expand Down
19 changes: 10 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand All @@ -19,8 +19,11 @@
android:label="@string/app_name"
android:supportsRtl="false"
android:theme="@style/Theme.App.Starting"
tools:targetApi="34" >

tools:targetApi="34">
<activity
android:name=".ui.activity.downloads.DownloadsActivity"
android:exported="false"
android:theme="@style/Theme.ShiraBox" />
<activity
android:name=".ui.activity.update.AppUpdateActivity"
android:exported="false"
Expand Down Expand Up @@ -56,7 +59,7 @@
android:name=".ui.activity.MainActivity"
android:exported="true"
android:hardwareAccelerated="true"
android:theme="@style/Theme.App.Starting" >
android:theme="@style/Theme.App.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -68,7 +71,7 @@
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true" >
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
Expand All @@ -77,17 +80,15 @@
<service
android:name=".service.NotificationService"
android:enabled="true"
android:exported="false" >
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

<service
android:name=".service.media.MediaDownloadsService"
android:enabled="true"
android:exported="false" >
</service>
android:exported="false"/>

<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/java/org/shirabox/app/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class App : Application(), ImageLoaderFactory {
private val job = SupervisorJob()
private val scope = CoroutineScope(Dispatchers.IO + job)

companion object {
lateinit var appDatabase: AppDatabase
}

override fun newImageLoader(): ImageLoader {
return ImageLoader.Builder(this)
.diskCache {
Expand All @@ -37,11 +41,11 @@ class App : Application(), ImageLoaderFactory {
super.onCreate()

FirebaseApp.initializeApp(this)
val db = AppDatabase.getAppDataBase(this)!!
appDatabase = AppDatabase.getAppDataBase(this)!!

// Subscribe to notifications
scope.launch {
db.contentDao().getFavourites().collectLatest { list ->
appDatabase.contentDao().getFavourites().collectLatest { list ->
list.forEach { favouriteAnime ->
if (favouriteAnime.shiraboxId != null) {
val topic = "id-${favouriteAnime.shiraboxId}"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/org/shirabox/app/ValuesHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.shirabox.app
import android.content.Context
import org.shirabox.app.ui.screen.favourites.SortType
import org.shirabox.core.model.ContentKind
import org.shirabox.core.model.Quality
import org.shirabox.core.model.ReleaseStatus

object ValuesHelper {
Expand Down Expand Up @@ -32,4 +33,7 @@ object ValuesHelper {
SortType.RECENT -> context.getString(R.string.recent_order)
SortType.STATUS -> context.getString(R.string.status_order)
}

fun buildOfflineMediaPath(contentUid: Long, quality: Quality, fileName: String) =
"/$contentUid/$quality/$fileName.mp4"
}
Loading

0 comments on commit 2a473d5

Please sign in to comment.