Skip to content

Commit

Permalink
Merge pull request #132 from kl3jvi/new_parser_impl
Browse files Browse the repository at this point in the history
fixed anime sync
  • Loading branch information
kl3jvi authored Aug 16, 2023
2 parents 3eaed4d + aac4ce0 commit 4a181b7
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 48 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ android {
applicationId "com.kl3jvi.animity"
minSdk 21
targetSdk 33
versionCode 16
versionName "1.1.6"
versionCode 17
versionName "1.1.7"
archivesBaseName = "Animity-v$versionName"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
34 changes: 17 additions & 17 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"type": "UNIVERSAL",
"filters": [],
"attributes": [],
"versionCode": 16,
"versionName": "1.1.5",
"outputFile": "Animity-v1.1.5-universal-release.apk"
"versionCode": 17,
"versionName": "1.1.7",
"outputFile": "Animity-v1.1.7-universal-release.apk"
},
{
"type": "ONE_OF_MANY",
Expand All @@ -24,35 +24,35 @@
}
],
"attributes": [],
"versionCode": 16,
"versionName": "1.1.5",
"outputFile": "Animity-v1.1.5-armeabi-v7a-release.apk"
"versionCode": 17,
"versionName": "1.1.7",
"outputFile": "Animity-v1.1.7-armeabi-v7a-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "arm64-v8a"
"value": "x86"
}
],
"attributes": [],
"versionCode": 16,
"versionName": "1.1.5",
"outputFile": "Animity-v1.1.5-arm64-v8a-release.apk"
"versionCode": 17,
"versionName": "1.1.7",
"outputFile": "Animity-v1.1.7-x86-release.apk"
},
{
"type": "ONE_OF_MANY",
"filters": [
{
"filterType": "ABI",
"value": "x86"
"value": "arm64-v8a"
}
],
"attributes": [],
"versionCode": 16,
"versionName": "1.1.5",
"outputFile": "Animity-v1.1.5-x86-release.apk"
"versionCode": 17,
"versionName": "1.1.7",
"outputFile": "Animity-v1.1.7-arm64-v8a-release.apk"
},
{
"type": "ONE_OF_MANY",
Expand All @@ -63,9 +63,9 @@
}
],
"attributes": [],
"versionCode": 16,
"versionName": "1.1.5",
"outputFile": "Animity-v1.1.5-x86_64-release.apk"
"versionCode": 17,
"versionName": "1.1.7",
"outputFile": "Animity-v1.1.7-x86_64-release.apk"
}
],
"elementType": "File"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.kl3jvi.animity.data.model.ui_models
import com.google.gson.annotations.SerializedName

data class DetailedAnimeInfo(
@SerializedName("Pages")
@SerializedName("Sites")
val pages: Pages?
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.kl3jvi.animity.data.model.ui_models

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable


@Serializable
data class MalSyncResponse(
@SerialName("aniId")
val aniId: Int,
@SerialName("aniUrl")
val aniUrl: String,
@SerialName("identifier")
val identifier: String,
@SerialName("image")
val image: String,
@SerialName("malId")
val malId: Int,
@SerialName("malUrl")
val malUrl: String,
@SerialName("page")
val page: String,
@SerialName("title")
val title: String,
@SerialName("type")
val type: String,
@SerialName("url")
val url: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class GogoAnimeApiClient @Inject constructor(
) = (animeService as GogoAnimeService).fetchM3u8PreProcessor(header, url)

suspend fun getGogoUrlFromAniListId(id: Int) =
(animeService as GogoAnimeService).getGogoUrlFromAniListId(id)
(animeService as GogoAnimeService).getGoGoDetailedUrl(id)

companion object {
val keysAndIv: Keys = Keys(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.kl3jvi.animity.data.network.anime_service.gogo
import com.kl3jvi.animity.data.model.ui_models.DetailedAnimeInfo
import com.kl3jvi.animity.data.model.ui_models.EpisodeWithTitle
import com.kl3jvi.animity.data.model.ui_models.GogoAnimeKeys
import com.kl3jvi.animity.data.model.ui_models.MalSyncResponse
import com.kl3jvi.animity.data.network.anime_service.base.BaseService
import okhttp3.ResponseBody
import retrofit2.http.*
Expand Down Expand Up @@ -49,8 +50,8 @@ interface GogoAnimeService : BaseService {
@Query("alias") alias: String
): ResponseBody

@GET("$MAL_SYNC_URL/{id}.json")
suspend fun getGogoUrlFromAniListId(
@GET("$MAL_SYNC_URL:{id}")
suspend fun getGoGoDetailedUrl(
@Path("id") id: Int
): DetailedAnimeInfo

Expand All @@ -62,7 +63,7 @@ interface GogoAnimeService : BaseService {

companion object {
const val MAL_SYNC_URL =
"https://raw.githubusercontent.com/MALSync/MAL-Sync-Backup/master/data/anilist/anime"
"https://api.malsync.moe/mal/anime/anilist"

const val EPISODE_TITLES =
"https://raw.githubusercontent.com/saikou-app/mal-id-filler-list/main/fillers"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import com.kl3jvi.animity.data.paging.FavoritesPagingSource
import com.kl3jvi.animity.domain.repositories.FavoriteRepository
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

@ExperimentalCoroutinesApi
Expand All @@ -32,6 +34,7 @@ class FavoriteRepositoryImpl @Inject constructor(
pagingSourceFactory = { FavoritesPagingSource(aniListGraphQlClient, userId) }
).flow.flowOn(ioDispatcher)
}

companion object {
const val NETWORK_PAGE_SIZE = 50
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import com.azhon.appupdate.manager.DownloadManager
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.kl3jvi.animity.BuildConfig
import com.kl3jvi.animity.R
import com.kl3jvi.animity.databinding.ActivityMainBinding
import com.kl3jvi.animity.utils.OnNeedToRequestPermissions
Expand Down Expand Up @@ -95,7 +93,6 @@ class MainActivity : AppCompatActivity(), PermissionsFeature {
}



/* Hiding the bottom navigation bar. */
private fun hideBottomNavBar() {
binding.navView.animate().translationY(binding.navView.height.toFloat())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.navigation.fragment.navArgs
import coil.load
import com.google.android.material.chip.Chip
import com.google.android.material.tabs.TabLayoutMediator
import com.google.android.material.transition.MaterialFadeThrough
import com.kl3jvi.animity.R
import com.kl3jvi.animity.data.mapper.MediaStatusAnimity
import com.kl3jvi.animity.data.model.ui_models.EpisodeModel
Expand Down Expand Up @@ -53,6 +54,7 @@ class DetailsFragment : Fragment(R.layout.fragment_details) {
private lateinit var title: String
private var check by Delegates.notNull<Boolean>()


override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding = FragmentDetailsBinding.bind(view)
Expand Down
40 changes: 20 additions & 20 deletions app/versionInfo.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
{
"Animity": {
"x86": {
"versionCode": 16,
"versionName": "1.1.6",
"direct_link": "https://github.com/kl3jvi/animity/releases/download/v0.2.2/Animity-v1.1.6-x86-release.apk",
"versionCode": 17,
"versionName": "1.1.7",
"direct_link": "https://github.com/kl3jvi/animity/releases/download/v0.2.3/Animity-v1.1.7-x86-release.apk",
"update_message": "New update available",
"apkSize": "Unknown size"
"apkSize": "7.17MB"
},
"armeabi-v7a": {
"versionCode": 16,
"versionName": "1.1.6",
"direct_link": "https://github.com/kl3jvi/animity/releases/download/v0.2.2/Animity-v1.1.6-armeabi-v7a-release.apk",
"versionCode": 17,
"versionName": "1.1.7",
"direct_link": "https://github.com/kl3jvi/animity/releases/download/v0.2.3/Animity-v1.1.7-armeabi-v7a-release.apk",
"update_message": "New update available",
"apkSize": "Unknown size"
"apkSize": "7.17MB"
},
"arm64_v8a": {
"versionCode": 16,
"versionName": "1.1.6",
"direct_link": "https://github.com/kl3jvi/animity/releases/download/v0.2.2/Animity-v1.1.6-arm64_v8a-release.apk",
"versionCode": 17,
"versionName": "1.1.7",
"direct_link": "https://github.com/kl3jvi/animity/releases/download/v0.2.3/Animity-v1.1.7-arm64_v8a-release.apk",
"update_message": "New update available",
"apkSize": "Unknown size"
},
"x86_64": {
"versionCode": 16,
"versionName": "1.1.6",
"direct_link": "https://github.com/kl3jvi/animity/releases/download/v0.2.2/Animity-v1.1.6-x86_64-release.apk",
"versionCode": 17,
"versionName": "1.1.7",
"direct_link": "https://github.com/kl3jvi/animity/releases/download/v0.2.3/Animity-v1.1.7-x86_64-release.apk",
"update_message": "New update available",
"apkSize": "Unknown size"
"apkSize": "7.17MB"
},
"universal": {
"versionCode": 16,
"versionName": "1.1.6",
"direct_link": "https://github.com/kl3jvi/animity/releases/download/v0.2.2/Animity-v1.1.6-universal-release.apk",
"versionCode": 17,
"versionName": "1.1.7",
"direct_link": "https://github.com/kl3jvi/animity/releases/download/v0.2.3/Animity-v1.1.7-universal-release.apk",
"update_message": "New update available",
"apkSize": "Unknown size"
"apkSize": "7.17MB"
}
}
}
}

0 comments on commit 4a181b7

Please sign in to comment.