Skip to content

Commit 9a031e6

Browse files
authored
Merge pull request #779 from arabcoders/dev
General improvements to underlying codebase
2 parents 6724fb7 + c359926 commit 9a031e6

File tree

378 files changed

+13841
-5724
lines changed

Some content is hidden

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

378 files changed

+13841
-5724
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
validate-build-config:
5555
name: Validate Build Configuration
5656
runs-on: ubuntu-latest
57-
permissions: { }
57+
permissions: {}
5858
steps:
5959
- name: Ensure at least one architecture is enabled
6060
run: |
@@ -70,13 +70,13 @@ jobs:
7070
test:
7171
name: Tests & Frontend Build
7272
runs-on: ubuntu-latest
73-
needs: [ validate-build-config ]
73+
needs: [validate-build-config]
7474
permissions:
7575
contents: read
7676
strategy:
7777
fail-fast: true
7878
matrix:
79-
php: [ 8.4 ]
79+
php: [8.4]
8080
steps:
8181
- name: Checkout
8282
uses: actions/checkout@v4
@@ -113,6 +113,12 @@ jobs:
113113
- name: Install PHP dependencies
114114
run: composer install --prefer-dist --no-interaction --no-progress
115115

116+
- name: Run PHP formatter check
117+
run: composer run format:ci
118+
119+
- name: Run PHP linter
120+
run: composer run lint
121+
116122
- name: Run PHP tests
117123
run: composer run test
118124

@@ -130,10 +136,22 @@ jobs:
130136

131137
- name: Install frontend dependencies
132138
working-directory: frontend
133-
env:
134-
NODE_ENV: production
135139
run: pnpm install --frozen-lockfile --prefer-offline
136140

141+
- name: Run nuxt prepare
142+
working-directory: frontend
143+
env:
144+
NODE_ENV: development
145+
run: pnpm run prepare:test
146+
147+
- name: Run frontend linter
148+
working-directory: frontend
149+
run: pnpm run lint
150+
151+
- name: Run frontend typecheck
152+
working-directory: frontend
153+
run: pnpm run lint:tsc
154+
137155
- name: Build frontend
138156
working-directory: frontend
139157
env:
@@ -166,8 +184,8 @@ jobs:
166184
docker-build-amd64:
167185
name: Build Container (amd64)
168186
runs-on: ubuntu-latest
169-
needs: [ test, validate-build-config ]
170-
if: (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.build == 'true')) && vars.BUILD_AMD64 != 'false'
187+
needs: [test, validate-build-config]
188+
if: (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.build)) && vars.BUILD_AMD64 != 'false'
171189
permissions:
172190
packages: write
173191
contents: write
@@ -257,15 +275,15 @@ jobs:
257275
push: true
258276
tags: ${{ steps.meta.outputs.tags }}
259277
labels: ${{ steps.meta.outputs.labels }}
260-
cache-from: type=gha,scope=${{ github.workflow }}-${{ env.ARCH }}
261-
cache-to: type=gha,mode=max,scope=${{ github.workflow }}-${{ env.ARCH }}
278+
cache-from: type=gha,scope=${{ github.workflow_ref }}-${{ env.ARCH }}
279+
cache-to: type=gha,mode=max,scope=${{ github.workflow_ref }}-${{ env.ARCH }}
262280
provenance: true
263281

264282
docker-build-arm64:
265283
name: Build Container (arm64)
266284
runs-on: ubuntu-latest
267-
needs: [ test, validate-build-config ]
268-
if: (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.build == 'true')) && vars.BUILD_ARM64 != 'false'
285+
needs: [test, validate-build-config]
286+
if: (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.build)) && vars.BUILD_ARM64 != 'false'
269287
permissions:
270288
packages: write
271289
contents: write
@@ -362,7 +380,7 @@ jobs:
362380
docker-publish-manifest:
363381
name: Publish multi-arch manifest
364382
runs-on: ubuntu-latest
365-
needs: [ docker-build-amd64, docker-build-arm64 ]
383+
needs: [docker-build-amd64, docker-build-arm64]
366384
if: |
367385
!cancelled() && github.event_name != 'pull_request' &&
368386
(needs.docker-build-amd64.result == 'success' || needs.docker-build-arm64.result == 'success')

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
/frontend/exported/
77
.phpactor.json
88
**.php-cs-fixer.cache
9+
src/Backends/Plex/PlexJWT.php
10+
tests/Backends/Plex/PlexJWTTest.php

FAQ.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ to see list of loaded environment variables, click on `Env` page.
309309
> the `compose.yaml` file.
310310
311311
| Key | Type | Description | Default |
312-
|---------------|---------|------------------------------------|---------|
312+
| ------------- | ------- | ---------------------------------- | ------- |
313313
| DISABLE_CRON | integer | Disable included `Task Scheduler`. | `0` |
314314
| DISABLE_CACHE | integer | Disable included `Cache Server`. | `0` |
315315

@@ -417,9 +417,23 @@ Sadly, this is due to bug in jellyfin, where it marks the item as played without
417417
such, watchstate doesn't really know the item has changed since last sync. Unfortunately, there is no way to fix this
418418
issue from our side for the `state:import` task as it working as intended.
419419

420+
### Workarounds.
421+
422+
There are two possible workarounds:
423+
424+
### (1) Webhooks (Recommended)
425+
420426
However, we managed implemented a workaround for this issue using the webhooks as workaround, until jellyfin devs fixes
421427
the issue. Please enable webhooks for your jellyfin backend to avoid this issue.
422428

429+
### (1) by special handling
430+
431+
We have added an experimental workaround for this issue in the `state:import` command, to enable it, add the env `WS_CLIENTS_JELLYFIN_FIX_PLAYED` via the `Env` page. It's turned off by default as it may cause some issues as it's untested in production, so please use it with caution and report any issues you find.
432+
433+
## CODE: DM001 - Marking the item as tainted and re-processing.
434+
435+
This warning appears when there is a mismatch between the local database and a backend regarding the item. This error mostly occurs in some edge cases. which can be fixed by forced state export to the backend.
436+
423437
---
424438

425439
# How does the file integrity feature works?

composer.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,28 @@
1010
"optimize-autoloader": true,
1111
"preferred-install": {
1212
"*": "dist"
13+
},
14+
"allow-plugins": {
15+
"carthage-software/mago": true
1316
}
1417
},
1518
"scripts": {
1619
"test": "vendor/bin/phpunit",
1720
"tests": "vendor/bin/phpunit",
18-
"ui_update": "pnpm up --dir ./frontend --latest",
19-
"ui_gen": "pnpm run --dir ./frontend generate",
20-
"ui_dev": "pnpm run --dir ./frontend dev",
21-
"ui_tc": "pnpm run --dir ./frontend typecheck"
21+
"format": "vendor/bin/mago format",
22+
"format:ci": "vendor/bin/mago format --check",
23+
"test:all": "php -d display_errors=1 -d display_startup_errors=1 -d error_reporting=E_ALL vendor/bin/phpunit",
24+
"test:coverage": [
25+
"mkdir -p var/coverage",
26+
"php -d zend_extension=xdebug -d xdebug.mode=coverage -d xdebug.start_with_request=no vendor/bin/phpunit --coverage-filter src/ --coverage-clover var/coverage/clover.xml --coverage-xml var/coverage/xml --coverage-text",
27+
"echo 'Coverage reports generated in ./var/coverage/'"
28+
],
29+
"lint": "vendor/bin/mago lint",
30+
"frontend:update": "pnpm up --dir ./frontend --latest",
31+
"frontend:gen": "pnpm run --dir ./frontend generate",
32+
"frontend:dev": "pnpm run --dir ./frontend dev",
33+
"frontend:tc": "pnpm run --dir ./frontend typecheck",
34+
"frontend:prepare": "pnpm run --dir ./frontend prepare --envName=development"
2235
},
2336
"require": {
2437
"php": "^8.4",
@@ -62,8 +75,7 @@
6275
"roave/security-advisories": "dev-latest",
6376
"symfony/var-dumper": "^7.2",
6477
"phpunit/phpunit": "^11.5.2",
65-
"phpstan/phpstan": "^2.0",
66-
"psalm/phar": "^5.26"
78+
"carthage-software/mago": "^1.3.0"
6779
},
6880
"autoload-dev": {
6981
"psr-4": {

0 commit comments

Comments
 (0)