Skip to content

Commit d0ec47e

Browse files
authored
Merge pull request #8 from SurjitSahoo/feat/download-enhancements
Download Enhancements, Integrate Clarity analytics, database migrations, and cache redesign
2 parents 3d5b8ac + 49ec6f3 commit d0ec47e

File tree

121 files changed

+5551
-1011
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+5551
-1011
lines changed

.agent/rules/project-context.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ This is an offline-first Android client app for the [audiobookshelf](https://git
1818
- If the offline track is deleted/cleared while the book is being played, the player should attempt to fallback to the online URL if the server is reachable, otherwise pause playback and persist the last playback state (track ID, playback position/timestamp, current chapter/index, and playback status) plus a flag indicating offline content was removed; ensure the rule notes that these persisted fields are used to resume or report playback state and are written atomically to the player state store.
1919
- The app must be fully functional for downloaded content when offline.
2020

21+
## Future Plans (Not to be implemented now)
22+
- The app should support multi-server / multi-user connections. A user should be able to connect to a server, download a few books for offline listening, then disconnect and connect to a new server and download few more books, and listen to all the books offline, and then connecting back to the previous server should push (sync) progress updates from the books which were downloaded earlier for offline listening.
23+
- The app should also support uploading books that were downloaded from a server to another server (sharing)
24+
- The app should support importing audiobooks from the phone storage directly without any server connection. Optionally, the user should be able to upload these audiobooks to the server along with the progress.
25+
2126
## Ensure Stability
2227

2328
- Ensure null-safety when converting data (e.g., check for division by zero in percentage calculations).
@@ -40,4 +45,4 @@ This is an offline-first Android client app for the [audiobookshelf](https://git
4045
- **ABSOLUTELY NO** hardcoded user-facing strings in UI code. All strings must be extracted to `strings.xml` and accessed via `stringResource`.
4146
- Use `associateBy` or proper indexing for collection lookups (O(1)) instead of nested loops (O(N^2)) when synchronizing data.
4247
- Avoid expensive operations on the main thread.
43-
- No code duplication, keep the code clean and easy to maintain.
48+
- No code duplication, keep the code clean and easy to maintain.

.coderabbit.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language: "en-US"
2+
reviews:
3+
auto_title_placeholder: "@coderabbit title"

.github/workflows/release.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,38 @@ jobs:
4444
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
4545
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
4646

47+
- name: Build Changelog
48+
id: build_changelog
49+
uses: mikepenz/release-changelog-builder-action@v5
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
configuration: |
54+
{
55+
"categories": [
56+
{
57+
"title": "## 🚀 Features",
58+
"labels": ["feature", "enhancement"]
59+
},
60+
{
61+
"title": "## 🐛 Bug Fixes",
62+
"labels": ["fix", "bug"]
63+
},
64+
{
65+
"title": "## 📦 Dependencies & Maintenance",
66+
"labels": ["chore", "deps", "dependency", "refactor"]
67+
}
68+
],
69+
"template": "{{CHANGELOG}}"
70+
}
71+
4772
- name: Create Release
48-
uses: softprops/action-gh-release@v1
73+
uses: softprops/action-gh-release@v2
4974
with:
5075
files: app/build/outputs/apk/release/app-release.apk
5176
tag_name: v${{ steps.get_version.outputs.version }}
5277
name: Kahani v${{ steps.get_version.outputs.version }}
53-
body: |
54-
Automated Release for Kahani.
55-
Commit: ${{ github.sha }}
78+
body: ${{ steps.build_changelog.outputs.changelog }}
5679
draft: false
5780
prerelease: false
5881
env:

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ render.experimental.xml
2727
*.jks
2828
*.keystore
2929

30-
# Google Services (e.g. APIs or Firebase)
31-
google-services.json
32-
3330
# Android Profiling
3431
*.hprof
3532

app/build.gradle.kts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ plugins {
88
id("com.google.dagger.hilt.android")
99
id("org.jmailen.kotlinter") version "5.2.0"
1010
id("com.google.devtools.ksp")
11+
alias(libs.plugins.google.services)
12+
alias(libs.plugins.firebase.crashlytics)
1113
}
1214

1315
kotlinter {
@@ -60,11 +62,7 @@ android {
6062

6163
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
6264

63-
val acraReportLogin = "8yJ59n0UToCja8LR"
64-
val acraReportPassword = "kuW9TV7BbJByuIAc"
65-
66-
buildConfigField("String", "ACRA_REPORT_LOGIN", "\"$acraReportLogin\"")
67-
buildConfigField("String", "ACRA_REPORT_PASSWORD", "\"$acraReportPassword\"")
65+
buildConfigField("String", "CLARITY_PROJECT_ID", "\"vc8bgk8nk9\"")
6866

6967
signingConfigs {
7068
create("release") {
@@ -183,17 +181,19 @@ dependencies {
183181
implementation(libs.androidx.glance.appwidget)
184182
implementation(libs.androidx.glance.material3)
185183

186-
implementation(libs.acra.core)
187-
implementation(libs.acra.http)
188-
implementation(libs.acra.toast)
189-
190184
implementation(libs.androidx.room.runtime)
191185
implementation(libs.androidx.room.ktx)
192186

193187
implementation(libs.converter.moshi)
194188
implementation(libs.moshi)
195189
implementation(libs.moshi.kotlin)
196190

191+
implementation(libs.microsoft.clarity)
192+
193+
implementation(platform(libs.firebase.bom))
194+
implementation(libs.firebase.crashlytics)
195+
implementation(libs.firebase.analytics)
196+
197197
debugImplementation(libs.androidx.ui.tooling)
198198
debugImplementation(libs.androidx.ui.test.manifest)
199199
}

app/google-services.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"project_info": {
3+
"project_number": "139954826172",
4+
"project_id": "kahani-app-android",
5+
"storage_bucket": "kahani-app-android.firebasestorage.app"
6+
},
7+
"client": [
8+
{
9+
"client_info": {
10+
"mobilesdk_app_id": "1:139954826172:android:0f4f76f1de010ba41699b9",
11+
"android_client_info": {
12+
"package_name": "com.kahani.app"
13+
}
14+
},
15+
"oauth_client": [],
16+
"api_key": [
17+
{
18+
"current_key": "AIzaSyAB8o-65tB6TzUbdaqVAP9XnTl1wgC6dks"
19+
}
20+
],
21+
"services": {
22+
"appinvite_service": {
23+
"other_platform_oauth_client": []
24+
}
25+
}
26+
},
27+
{
28+
"client_info": {
29+
"mobilesdk_app_id": "1:139954826172:android:1d7d97392c6e248f1699b9",
30+
"android_client_info": {
31+
"package_name": "com.kahani.app.debug"
32+
}
33+
},
34+
"oauth_client": [],
35+
"api_key": [
36+
{
37+
"current_key": "AIzaSyAB8o-65tB6TzUbdaqVAP9XnTl1wgC6dks"
38+
}
39+
],
40+
"services": {
41+
"appinvite_service": {
42+
"other_platform_oauth_client": []
43+
}
44+
}
45+
}
46+
],
47+
"configuration_version": "1"
48+
}

app/proguard-rules.pro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@
1717
# Hilt and Dagger rules (usually bundled, but good to ensure)
1818
-keep class dagger.hilt.android.internal.** { *; }
1919
-keep class *__HiltBindingModule { *; }
20-
-keep class org.grakovne.lissen.**_HiltComponents$* { *; }
20+
-keep class org.grakovne.lissen.**_HiltComponents$* { *; }
21+
22+
# Microsoft Clarity
23+
-keep class com.microsoft.clarity.** { *; }
24+
-keep interface com.microsoft.clarity.** { *; }

0 commit comments

Comments
 (0)