Commit Graph

293 Commits

Author SHA1 Message Date
Niels van Velzen
9dd2f05ca6 Update AGP to 7.1.2 2022-03-03 08:41:38 +01:00
Niels van Velzen
d978be4bff Update process lifecycle to avoid startup crash 2022-02-26 10:35:10 +01:00
Niels van Velzen
22c50d50f5 Rewrite all unit tests using kotest 2022-02-19 19:01:41 +01:00
Niels van Velzen
2cfd134a83 Remove unused koin-test dependencies 2022-02-19 19:01:41 +01:00
Niels van Velzen
65e53d340a Update AGP to 7.1.1 2022-02-12 12:02:11 +01:00
gradle-update-robot
9b7f6f7236 Update Gradle Wrapper from 7.3.3 to 7.4.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2022-02-09 19:04:27 +01:00
DavidFair
9e74f2dc7a
Include Jellyfin Exoplayer FFmpeg dep (#1369)
* Include Jellyfin Exoplayer FFmpeg dep

Port the includes from the Android repo as-is into this repo to include
the dependency

Convert our initialisation to prefer the built in extensions. This
should avoid flaky device logic and matches the Android app choice too.

* Drop check for DCS / DCA on firestick gen 1

FFmpeg should handle the decoding on these devices for us natively, and
likely uses the same codepath as libVLC. This should help us stick with
the native player instead of VLC where possible

* Replace TvApp.getApplication with getting context from activity

This removes another deprecated usage of TvApp by the reviewer

* Add new codecs to list of supported profiles

Adds the new codecs to reflect the new capabilities available from our
FFmpeg extensions.

* Refactor duplicated audio codec list into method

Refactor the duplicated audio codecs. Whilst I can't think of a case
where a user might play say DTS / TrueHD audio files, I equally can't
think of a reason why not to support it.

This simplifies the code, whilst allowing us to still extend the list
with some Audio only codecs for audio direct-play

* Lowercase PCM formats

This matches the format found on the server and the Android mobile
implementation to be safe

* AudioDirectPlayProfile: Replace vaarg with Array<String>

This allows us to easily combine two arrays together without having to
create copies with spread operators.
Internally the copies still function the same as we have an interable
type we are applying joinToString(",") with

* Switch to using EXTENSION_RENDERER_MODE_ON

This will use the system core renderers first. To get the fallback
behaviour we simply needed to add `setEnabledDecoderFallback`. This
allows Exoplayer to try the first decoder, then silently fallback on
error to ffmpeg.

Functionally this matches the implementation goals in the Android Mobile where
they will manually fallback instead. Since we can't access / restart the
media queue easily in this repo.

* Code cleanup from PR review

Addresses various comments where we can improve the readability around
the various changes we've made

* Drop ExoPlayerProfileTests

Since it only check hardcoded values which rarely change are there

* Whitespace tidy up + manual reformatting

Some various tidy ups and manual reformatting as pointed out from the
PR. This helps reduce down the amount of empty whitespace in the file

* Formatting fixes

Various hand-fixes where the formatter hasn't quite got it right
2022-02-03 19:37:31 -08:00
Niels van Velzen
ea080fed7a Upgrade Android Gradle Plugin to 7.1.0 2022-01-29 10:36:24 +01:00
Niels van Velzen
13b8ce2c5b Replace slf4j-android with slf4j-timber 2021-12-30 19:16:10 +01:00
DavidFair
926a2b7a4b
Add Mockk and one test to exercise the new dep (#1312)
* Add Mockk to test framework deps

Add Mockk as this is aware of Kotlin inheritence unlike Mockito.
This primarily shows up where classes are not marked open. We can
either:
- Mark all unit tested classes open (least viable option)
- Add boilerplate to Mockito each time we test a Kotlin class
- Add a mocking framework that is Kotlin aware.

In this case I've opted for the latter, since it also avoids us having
to look up the boilerplate for static mocks...etc.

* Stub out testing Android.utils.log

Slf4j will try to invoke IsLoggable, despite stubbing out everything
else, which is explicitly disabled within the Android SDK.

We could revert to hacks, such as using Android -> returnDefaultValue=true in the
testing options. But according to the docs this should be a last resort.

Instead we can simply stub out the logging to forward calls to println,
allowing us to mock / init anything that uses SLF4J implicitly.

* Add tests and null checks for DeviceUtils

This commit does two things to help testing going forwards:

- It adds a null check for Build.MODEL, typically found in unit tests.
Allowing us to simply avoid having to mock all the various capability
tests which were throwing NPEs in unit tests.

- Adds tests for the existing functionality. This requires Mockk to
easily overwrite static class methods. We also add a small shim method
to make mocking much easier too.

* Run CustomSeekProvider through automatic Java->Kotlin

Convert the file to Kotlin. This means all of our unit tests that use
Mockk will have the same syntax inside, making it much easier for future
developers to reason with.

* Convert Mockito to Mockk

Converts the single usage of Mockito to Mockk, so we can use the same
mocking framework throughout the codebase.

* Drop Mockito in favour of Mockk

Drops Mockito to use Mockk throughout the project.
This is because we have a mix between Java and Kotlin. The latter is
"harder" to mock as classes are not marked open by default.

This means Mockito requires boilerplate in comparison to Mockk.
Additionally, using a single framework lowers the burden on developers
to known multiple tools

* Run Android Studio formatter over code

Despite having format on save enabled, many lines were missed (probably
from the cherry-pick).
Run formatter over the code to address PR reviewer comments.

* Return string instead of null from getBuildModel

This removes a number of null checks from the implementation, and allows
us to mark the method as nonNull too.
2021-12-30 18:44:21 +01:00
Niels van Velzen
be9890f5ab Update SDK to 1.1.2
Fixes an crash when using display preferences
2021-12-27 16:34:57 +01:00
David Fairbrother
2990ffad09 Add Koin unit testing deps implementation
This allows Koin to do DI during unit tests and allows us to establish
Junit rules which involve Koin
This is essential for testing some classes as the playback code, where
DI is used heavily
2021-12-25 12:17:24 +01:00
gradle-update-robot
8113f01777 Update Gradle Wrapper from 7.3.2 to 7.3.3.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-12-22 14:46:59 +01:00
Niels van Velzen
59150dc811 Update all dependencies 2021-12-20 09:33:42 +01:00
Niels van Velzen
cac209f47f Always use version references in version catalog
This makes it easier to update the versions and makes the file more readable
2021-12-20 09:33:42 +01:00
Niels van Velzen
ced03b82de
Move Gradle plugins to plugin catalog (#1296)
* Move Gradle plugins to plugin catalog

* Fix linter config for playback module
2021-12-19 14:44:28 +01:00
gradle-update-robot
e3c471e141 Update Gradle Wrapper from 7.3.1 to 7.3.2.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-12-16 08:52:15 +01:00
gradle-update-robot
c33312ca29 Update Gradle Wrapper from 7.3 to 7.3.1.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-12-02 08:35:01 +01:00
gradle-update-robot
c9cedd26a6 Update Gradle Wrapper from 7.2 to 7.3.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-11-10 13:10:51 +01:00
Niels van Velzen
79afee7ce6 Move Koin initialization to androidx.startup 2021-11-06 21:33:26 +01:00
Niels van Velzen
a292045091 Show licenses from used libraries 2021-10-21 17:43:12 +02:00
Niels van Velzen
960212b832 Migrate to Jellyfin Kotlin SDK v1.1 2021-10-18 19:08:14 +02:00
Niels van Velzen
500cd55e23 Migrate to Koin 3 2021-09-30 14:35:53 +02:00
jellyfin-bot
49748457bb
Update Gradle Wrapper from 7.1.1 to 7.2. (#1093)
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>

Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-08-18 17:39:42 +02:00
Niels van Velzen
cbcf2c9b7c Use the process lifecycle to (re)load user sessions
This simplifies our code as there is now only a single place to restore the session. This automatically supports opening the app after putting it in the background.
2021-08-11 23:00:15 +02:00
Bill Thornton
8a4e0b3afc
Merge pull request #1033 from nielsvanvelzen/acra-update
Update ACRA to 5.8.x
2021-07-29 06:39:18 -07:00
Niels van Velzen
f1414902f8
Update androidx.window to alpha09 (#1042) 2021-07-28 19:38:40 +02:00
Niels van Velzen
33bfb43253 Update ACRA to 5.8.x 2021-07-25 11:09:15 +02:00
Niels van Velzen
cda958d30e Update jellyfin-sdk-kotlin to 1.0.1
Fixes an issue with special characters in device names
2021-07-13 16:10:34 +02:00
Niels van Velzen
01db6e195b Refactor build scripts for consistency with jellyfin-sdk-kotlin 2021-07-08 22:33:05 +02:00
gradle-update-robot
2f7d0ca116 Update Gradle Wrapper from 7.1 to 7.1.1.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-07-03 04:23:46 +00:00
gradle-update-robot
96d744f62f Update Gradle Wrapper from 7.0.2 to 7.1.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-06-16 04:24:40 +00:00
gradle-update-robot
8d638ee7eb Update Gradle Wrapper from 7.0.1 to 7.0.2.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-05-15 04:30:00 +00:00
gradle-update-robot
c9a13878e3 Update Gradle Wrapper from 7.0 to 7.0.1.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-05-11 04:25:54 +00:00
gradle-update-robot
06615a73c3 Update Gradle Wrapper from 6.8.3 to 7.0.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-04-10 04:08:21 +00:00
gradle-update-robot
3e52b20292 Update Gradle Wrapper from 6.7 to 6.8.3.
Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc>
2021-02-25 04:22:27 +00:00
Niels van Velzen
4a7e94c02f Update Gradle, Gradle plugins, Android target/compile version and app dependencies to latest versions 2020-11-13 16:54:25 +01:00
Niels van Velzen
65e2b1e1a0 Update Gradle wrapper to version 6.4.1 2020-05-30 10:30:36 +02:00
Niels van Velzen
ed9601f12d Upgrade Gradle wrapper to version 6.2.1 2020-03-03 21:31:53 +01:00
Niels van Velzen
40a37d9418 Update Gradle and Gradle wrapper to latest version 2020-02-09 21:59:27 +01:00
Andreas Ackermann
101bc5b043 Upgrading Gradle Version to 5.4.1
Also adding myself to CONTRIBUTORS.md now, as this ate way too much time :D
2019-11-20 22:05:02 +01:00
dkanada
e02f07929b fix build error 2019-09-06 20:06:54 -07:00
Bill Thornton
2a946a76a8 Restore gradle wrapper 2019-02-08 16:37:23 -05:00