Skip to content

Commit

Permalink
Merge branch 'master' into download
Browse files Browse the repository at this point in the history
  • Loading branch information
7ritn authored Jan 30, 2025
2 parents 48c9eb4 + beea2cd commit 4754762
Show file tree
Hide file tree
Showing 73 changed files with 560 additions and 243 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ trim_trailing_whitespace = true
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_blank_lines_around_block_when_branches = 0
ij_kotlin_line_break_after_multiline_when_entry = false
ij_kotlin_indent_before_arrow_on_new_line = false
ij_kotlin_name_count_to_use_star_import = 999
ij_kotlin_name_count_to_use_star_import_for_members = 999
ij_kotlin_packages_to_use_import_on_demand =
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/app-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ permissions:
jobs:
build:
name: Build
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
- name: Assemble debug APKs
run: ./gradlew assembleDebug
- name: Create publish bundle
run: mkdir -p build/gh-app-publish/; find app/build/ -iname "*.apk" -exec mv "{}" build/gh-app-publish/ \;
- name: Upload artifacts
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: build-artifacts
retention-days: 14
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/app-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ permissions:
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
continue-on-error: true
strategy:
matrix:
task: [ detekt, lint ]
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
- name: Run ${{ matrix.task }} task
run: ./gradlew ${{ matrix.task }}
- name: Upload SARIF files
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
if: ${{ always() }}
with:
sarif_file: .
12 changes: 6 additions & 6 deletions .github/workflows/app-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ on:
jobs:
publish:
name: Publish
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: ${{ contains(github.repository_owner, 'jellyfin') }}
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
- name: Set JELLYFIN_VERSION
run: echo "JELLYFIN_VERSION=$(echo ${GITHUB_REF#refs/tags/v} | tr / -)" >> $GITHUB_ENV
- name: Assemble release files
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
with:
asset_paths: '["build/jellyfin-publish/*"]'
- name: Upload release archive to repo.jellyfin.org
uses: burnett01/rsync-deployments@796cf0d5e4b535745ce49d7429f77cf39e25ef39 # 7.0.1
uses: burnett01/rsync-deployments@3cccb6851148e6198ed9ed89eb0d1c17b5e58cc7 # 7.0.2
with:
switches: -vrptz
path: build/jellyfin-publish/
Expand All @@ -84,7 +84,7 @@ jobs:
remote_user: ${{ secrets.REPO_USER }}
remote_key: ${{ secrets.REPO_KEY }}
- name: Update repo.jellyfin.org symlinks
uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3
uses: appleboy/ssh-action@7eaf76671a0d7eec5d98ee897acda4f968735a17 # v1.2.0
with:
host: ${{ secrets.REPO_HOST }}
username: ${{ secrets.REPO_USER }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/app-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ permissions:
jobs:
test:
name: Test
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
- name: Run test task
run: ./gradlew test
6 changes: 3 additions & 3 deletions .github/workflows/gradlew-validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ permissions:
jobs:
validate:
name: Validate
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
4 changes: 2 additions & 2 deletions .github/workflows/repo-merge-conflict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:
jobs:
triage:
name: Triage
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: ${{ contains(github.repository_owner, 'jellyfin') }}
steps:
- uses: eps1lon/actions-label-merge-conflict@1b1b1fcde06a9b3d089f3464c96417961dde1168 # v3.0.2
- uses: eps1lon/actions-label-merge-conflict@1df065ebe6e3310545d4f4c4e862e43bdca146f0 # v3.0.3
with:
dirtyLabel: merge conflict
repoToken: ${{ secrets.JF_BOT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/repo-milestone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
milestone:
name: Apply milestone
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: ${{ contains(github.repository_owner, 'jellyfin') }}
steps:
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/repo-stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ permissions:
jobs:
triage:
name: Triage
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: ${{ contains(github.repository_owner, 'jellyfin') }}
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ secrets.JF_BOT_TOKEN }}
days-before-stale: 120
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
*.iml
.gradle
/.kotlin
/local.properties
/.idea
.DS_Store
build
/captures
.externalNativeBuild
.cxx
.cxx
36 changes: 16 additions & 20 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.android.app)
Expand All @@ -8,20 +8,28 @@ plugins {
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.androidx.room)
alias(libs.plugins.detekt)
alias(libs.plugins.android.junit5)
}

detekt {
buildUponDefaultConfig = true
allRules = false
config = files("${rootProject.projectDir}/detekt.yml")
config.setFrom("${rootProject.projectDir}/detekt.yml")
autoCorrect = true
}

kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_11
optIn.add("kotlin.RequiresOptIn")
}
}

android {
namespace = "org.jellyfin.mobile"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 21
Expand Down Expand Up @@ -83,10 +91,6 @@ android {
viewBinding = true
compose = true
}
kotlinOptions {
@Suppress("SuspiciousCollectionReassignment")
freeCompilerArgs += listOf("-Xopt-in=kotlin.RequiresOptIn")
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
Expand All @@ -97,11 +101,9 @@ android {
abortOnError = false
sarifReport = true
}
}

ksp {
arg("room.schemaLocation", "$projectDir/schemas")
arg("room.incremental", "true")
room {
schemaDirectory("$projectDir/schemas")
}
}

dependencies {
Expand Down Expand Up @@ -179,12 +181,6 @@ dependencies {
}

tasks {
withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}

withType<Detekt> {
jvmTarget = JavaVersion.VERSION_11.toString()

Expand All @@ -206,9 +202,9 @@ tasks {
}

register("versionTxt") {
val path = buildDir.resolve("version.txt")

doLast {
val path = layout.buildDirectory.file("version.txt").get().asFile

val versionString = "v${android.defaultConfig.versionName}=${android.defaultConfig.versionCode}"
println("Writing [$versionString] to $path")
path.writeText("$versionString\n")
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/assets/native/nativeshell.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,6 @@ function getDeviceProfile(profileBuilder, item) {
return i.Type === "Audio";
});

profile.SubtitleProfiles.push(
{
Format: "ssa",
Method: "External"
},
{
Format: "ass",
Method: "External"
}
);

profile.CodecProfiles.push({
Type: "Video",
Container: "avi",
Expand Down
21 changes: 11 additions & 10 deletions app/src/main/java/org/jellyfin/mobile/app/ApiClientController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.jellyfin.mobile.data.entity.ServerEntity
import org.jellyfin.sdk.Jellyfin
import org.jellyfin.sdk.api.client.ApiClient
import org.jellyfin.sdk.model.DeviceInfo
import org.jellyfin.sdk.model.serializer.toUUID

class ApiClientController(
private val appPreferences: AppPreferences,
Expand All @@ -27,7 +26,7 @@ class ApiClientController(
appPreferences.currentServerId = withContext(Dispatchers.IO) {
serverDao.getServerByHostname(hostname)?.id ?: serverDao.insert(hostname)
}
apiClient.baseUrl = hostname
apiClient.update(baseUrl = hostname)
}

suspend fun setupUser(serverId: Long, userId: String, accessToken: String) {
Expand Down Expand Up @@ -69,19 +68,21 @@ class ApiClientController(
}

private fun configureApiClientServer(server: ServerEntity?) {
apiClient.baseUrl = server?.hostname
apiClient.update(baseUrl = server?.hostname)
}

private fun configureApiClientUser(userId: String, accessToken: String) {
apiClient.userId = userId.toUUID()
apiClient.accessToken = accessToken
// Append user id to device id to ensure uniqueness across sessions
apiClient.deviceInfo = baseDeviceInfo.copy(id = baseDeviceInfo.id + userId)
apiClient.update(
accessToken = accessToken,
// Append user id to device id to ensure uniqueness across sessions
deviceInfo = baseDeviceInfo.copy(id = baseDeviceInfo.id + userId),
)
}

private fun resetApiClientUser() {
apiClient.userId = null
apiClient.accessToken = null
apiClient.deviceInfo = baseDeviceInfo
apiClient.update(
accessToken = null,
deviceInfo = baseDeviceInfo,
)
}
}
Loading

0 comments on commit 4754762

Please sign in to comment.